Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsPref.cpp File Reference
#include "nsIPref.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranchInternal.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#include "nsIObserver.h"
#include "nsCOMPtr.h"
#include "nsMemory.h"
#include "prefapi.h"
#include "nsIFileSpec.h"
#include "nsString.h"
#include "nsILocalFile.h"
#include "nsIPrefLocalizedString.h"
#include "nsISecurityPref.h"
#include "nsIPrefService.h"
#include "nsISupportsPrimitives.h"
#include "nsWeakReference.h"
#include "nsIModule.h"
#include "nsIGenericFactory.h"
#include "plstr.h"
#include "prmem.h"
#include "prprf.h"

Go to the source code of this file.

Classes

class  nsPref

Functions

 NS_IMPL_THREADSAFE_ISUPPORTS8 (nsPref, nsIPref, nsIPrefService, nsIObserver, nsIPrefBranch, nsIPrefBranch2, nsIPrefBranchInternal, nsISecurityPref, nsISupportsWeakReference) nsPref
NS_IMETHODIMP nsPrefConstructor (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Variables

static PRInt32 g_InstanceCount = 0

Function Documentation

Definition at line 148 of file nsPref.cpp.

{
  PR_AtomicIncrement(&g_InstanceCount);

  mPrefService = do_GetService(NS_PREFSERVICE_CONTRACTID);
  NS_ASSERTION(mPrefService, "Preference Service failed to start up!!");

  if (mPrefService)
    mPrefService->GetDefaultBranch("", getter_AddRefs(mDefaultBranch));
}

Here is the call graph for this function:

NS_IMETHODIMP nsPrefConstructor ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
)

Definition at line 731 of file nsPref.cpp.

{
  nsresult rv;
    
  if (NULL == aResult) {
    rv = NS_ERROR_NULL_POINTER;
    return rv;
  }
  *aResult = NULL;
  if (NULL != aOuter) {
    rv = NS_ERROR_NO_AGGREGATION;
    return rv;
  }

  nsPref *inst = nsPref::GetInstance();

  if (NULL == inst) {
    rv = NS_ERROR_OUT_OF_MEMORY;
    return rv;
  }
  NS_ADDREF(inst);
  rv = inst->QueryInterface(aIID, aResult);
  NS_RELEASE(inst);

  return rv;
}

Here is the call graph for this function:


Variable Documentation

PRInt32 g_InstanceCount = 0 [static]

Definition at line 145 of file nsPref.cpp.