Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsPrefBranch.cpp File Reference
#include "nsPrefBranch.h"
#include "nsILocalFile.h"
#include "nsIObserverService.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIDirectoryService.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsXPIDLString.h"
#include "nsIStringBundle.h"
#include "prefapi.h"
#include "prmem.h"
#include "pldhash.h"
#include "nsPrefsCID.h"
#include "nsIFileSpec.h"
#include "plstr.h"
#include "nsCRT.h"
#include "prefapi_private_data.h"

Go to the source code of this file.


struct  EnumerateData
struct  PrefCallbackData


 pref_enumChild (PLDHashTable *table, PLDHashEntryHdr *heh, PRUint32 i, void *arg)
 NotifyObserver (const char *newpref, void *data)
 PR_STATIC_CALLBACK (nsresult) NotifyObserver(const char *newpref
nsCAutoString suffix (newpref+len)
 if (pData->bIsWeakRef)
observer Observe (pData->pBranch, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, NS_ConvertASCIItoUCS2(suffix).get())


void *data PrefCallbackDatapData = (PrefCallbackData *)data
nsPrefBranchprefBranch = NS_STATIC_CAST(nsPrefBranch *, pData->pBranch)
PRUint32 len = prefBranch->GetRootLength()
nsCOMPtr< nsIObserverobserver = NS_STATIC_CAST(nsIObserver *, pData->pObserver)
return NS_OK

Class Documentation

struct EnumerateData

Definition at line 65 of file nsPrefBranch.cpp.

Class Members
const char * parent
nsVoidArray * pref_list
struct PrefCallbackData

Definition at line 70 of file nsPrefBranch.cpp.

Collaboration diagram for PrefCallbackData:
Class Members
PRBool bIsWeakRef
nsIPrefBranch * pBranch
nsISupports * pObserver

Function Documentation

if ( pData->  bIsWeakRef)

Definition at line 743 of file nsPrefBranch.cpp.

    nsIWeakReference *weakRef = NS_STATIC_CAST(nsIWeakReference *, pData->pObserver);
    observer = do_QueryReferent(weakRef);
    if (!observer) {
      // this weak referenced observer went away, remove them from the list
      nsCOMPtr<nsIPrefBranch2> pbi = do_QueryInterface(pData->pBranch);
      if (pbi) {
        observer = NS_STATIC_CAST(nsIObserver *, pData->pObserver);
        pbi->RemoveObserver(newpref, observer);
      return NS_OK;
  } else

Here is the call graph for this function:

NotifyObserver ( const char *  newpref,
void data 

Here is the caller graph for this function:

pref_enumChild ( PLDHashTable table,
PLDHashEntryHdr heh,
PRUint32  i,
void arg 

Definition at line 874 of file nsPrefBranch.cpp.

  PrefHashEntry *he = NS_STATIC_CAST(PrefHashEntry*, heh);
  EnumerateData *d = NS_REINTERPRET_CAST(EnumerateData *, arg);
  if (PL_strncmp(he->key, d->parent, PL_strlen(d->parent)) == 0) {
  return PL_DHASH_NEXT;

Here is the call graph for this function:

nsCAutoString suffix ( newpref+  len)

Variable Documentation

PRUint32 len = prefBranch->GetRootLength()

Definition at line 739 of file nsPrefBranch.cpp.

Definition at line 760 of file nsPrefBranch.cpp.

else observer = NS_STATIC_CAST(nsIObserver *, pData->pObserver)

Definition at line 742 of file nsPrefBranch.cpp.

Definition at line 734 of file nsPrefBranch.cpp.

Definition at line 735 of file nsPrefBranch.cpp.