Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions
nsNSSShutDownList Class Reference

#include <nsNSSShutDown.h>

Collaboration diagram for nsNSSShutDownList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~nsNSSShutDownList ()
PRBool isUIActive ()
PRBool ifPossibleDisallowUI ()
void allowUI ()
nsresult evaporateAllNSSResources ()
nsresult doPK11Logout ()

Static Public Member Functions

static nsNSSShutDownListconstruct ()
static void remember (nsNSSShutDownObject *o)
static void forget (nsNSSShutDownObject *o)
static void remember (nsOnPK11LogoutCancelObject *o)
static void forget (nsOnPK11LogoutCancelObject *o)
static void trackSSLSocketCreate ()
static void trackSSLSocketClose ()
static PRBool areSSLSocketsActive ()
static nsNSSActivityStategetActivityState ()

Protected Attributes

PRLockmListLock
PLDHashTable mObjects
PRUint32 mActiveSSLSockets
PLDHashTable mPK11LogoutCancelObjects
nsNSSActivityState mActivityState

Static Protected Attributes

static nsNSSShutDownListsingleton = nsnull

Private Member Functions

 nsNSSShutDownList ()

Static Private Member Functions

static PLDHashOperator PR_CALLBACK evaporateAllNSSResourcesHelper (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
static PLDHashOperator PR_CALLBACK doPK11LogoutHelper (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)

Detailed Description

Definition at line 134 of file nsNSSShutDown.h.


Constructor & Destructor Documentation

Definition at line 87 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Definition at line 243 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Definition at line 181 of file nsNSSShutDown.cpp.

{
  if (!singleton) {
    // I'd rather prefer to be pessimistic and return PR_TRUE.
    // However, maybe we will get called at a time when the singleton
    // has already been freed, and returning PR_TRUE would bring up an 
    // unnecessary warning.
    return PR_FALSE;
  }
  
  PRBool retval;
  PR_Lock(singleton->mListLock);
    retval = (singleton->mActiveSSLSockets > 0);
  PR_Unlock(singleton->mListLock);

  return retval;
}

Definition at line 284 of file nsNSSShutDown.cpp.

{
  if (singleton) {
    // we should never ever be called twice
    return nsnull;
  }

  singleton = new nsNSSShutDownList();
  return singleton;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 199 of file nsNSSShutDown.cpp.

{
    PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("canceling all open SSL sockets to disallow future IO\n"));
  // During our iteration we will set a bunch of PRBools to PR_TRUE.
  // Nobody else ever modifies that PRBool, only we do.
  // We only must ensure that our objects do not go away.
  // This is guaranteed by holding the list lock.

  PR_Lock(mListLock);
    PL_DHashTableEnumerate(&mPK11LogoutCancelObjects, doPK11LogoutHelper, 0);
  PR_Unlock(mListLock);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PLDHashOperator PR_CALLBACK nsNSSShutDownList::doPK11LogoutHelper ( PLDHashTable table,
PLDHashEntryHdr hdr,
PRUint32  number,
void arg 
) [static, private]

Definition at line 215 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 248 of file nsNSSShutDown.cpp.

{
  if (PR_SUCCESS != mActivityState.restrictActivityToCurrentThread()) {
    PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("failed to restrict activity to current thread\n"));
    return NS_ERROR_FAILURE;
  }

  PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("now evaporating NSS resources\n"));
  int removedCount;
  do {
    PR_Lock(mListLock);
      removedCount = PL_DHashTableEnumerate(&mObjects, evaporateAllNSSResourcesHelper, 0);
    PR_Unlock(mListLock);
  } while (removedCount > 0);

  mActivityState.releaseCurrentThreadActivityRestriction();
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 268 of file nsNSSShutDown.cpp.

{
    ObjectHashEntry *entry = NS_STATIC_CAST(ObjectHashEntry*, hdr);
    PR_Unlock(singleton->mListLock);

  entry->obj->shutdown(nsNSSShutDownObject::calledFromList);

    PR_Lock(singleton->mListLock);

    // Never free more than one entry, because other threads might be calling
    // us and remove themselves while we are iterating over the list,
    // and the behaviour of changing the list while iterating is undefined.
    return (PLDHashOperator)(PL_DHASH_STOP | PL_DHASH_REMOVE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 128 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Definition at line 174 of file nsNSSShutDown.h.

Here is the caller graph for this function:

Definition at line 237 of file nsNSSShutDown.cpp.

{
  PRBool isNowDisallowed = mActivityState.ifPossibleDisallowUI(nsNSSActivityState::do_it_for_real);
  return isNowDisallowed;
}

Here is the call graph for this function:

Definition at line 230 of file nsNSSShutDown.cpp.

{
  PRBool canDisallow = mActivityState.ifPossibleDisallowUI(nsNSSActivityState::test_only);
  PRBool bIsUIActive = !canDisallow;
  return bIsUIActive;
}

Here is the call graph for this function:

Definition at line 117 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 139 of file nsNSSShutDown.cpp.

Here is the call graph for this function:

Definition at line 171 of file nsNSSShutDown.cpp.

Here is the caller graph for this function:

Definition at line 161 of file nsNSSShutDown.cpp.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 192 of file nsNSSShutDown.h.

Definition at line 194 of file nsNSSShutDown.h.

Definition at line 189 of file nsNSSShutDown.h.

Definition at line 191 of file nsNSSShutDown.h.

Definition at line 193 of file nsNSSShutDown.h.

Definition at line 190 of file nsNSSShutDown.h.


The documentation for this class was generated from the following files: