Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsScriptNameSpaceManager.cpp File Reference
#include "nsScriptNameSpaceManager.h"
#include "nsCOMPtr.h"
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"
#include "nsICategoryManager.h"
#include "nsIServiceManager.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIScriptExternalNameSet.h"
#include "nsIScriptNameSpaceManager.h"
#include "nsIScriptContext.h"
#include "nsIInterfaceInfoManager.h"
#include "nsIInterfaceInfo.h"
#include "xptinfo.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsHashKeys.h"
#include "nsDOMClassInfo.h"
#include "nsCRT.h"

Go to the source code of this file.

Classes

class  GlobalNameMapEntry

Defines

#define NS_INTERFACE_PREFIX   "nsI"
#define NS_DOM_INTERFACE_PREFIX   "nsIDOM"

Functions

 GlobalNameHashGetKey (PLDHashTable *table, PLDHashEntryHdr *entry)
 GlobalNameHashHashKey (PLDHashTable *table, const void *key)
 GlobalNameHashMatchEntry (PLDHashTable *table, const PLDHashEntryHdr *entry, const void *key)
 GlobalNameHashClearEntry (PLDHashTable *table, PLDHashEntryHdr *entry)
 GlobalNameHashInitEntry (PLDHashTable *table, PLDHashEntryHdr *entry, const void *key)
 NameSetInitCallback (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)

Define Documentation

Definition at line 59 of file nsScriptNameSpaceManager.cpp.

Definition at line 58 of file nsScriptNameSpaceManager.cpp.


Function Documentation

Definition at line 99 of file nsScriptNameSpaceManager.cpp.

{
  GlobalNameMapEntry *e = NS_STATIC_CAST(GlobalNameMapEntry *, entry);

  // An entry is being cleared, let the key (nsString) do its own
  // cleanup.
  e->mKey.~nsString();
  if (e->mGlobalName.mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
    nsIClassInfo* ci = GET_CLEAN_CI_PTR(e->mGlobalName.mData->mCachedClassInfo);

    // If we constructed an internal helper, we'll let the helper delete 
    // the nsDOMClassInfoData structure, if not we do it here.
    if (!ci || e->mGlobalName.mData->u.mExternalConstructorFptr) {
      delete e->mGlobalName.mData;
    }

    // Release our pointer to the helper.
    NS_IF_RELEASE(ci);
  }
  else if (e->mGlobalName.mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {
    delete e->mGlobalName.mAlias;
  }

  // This will set e->mGlobalName.mType to
  // nsGlobalNameStruct::eTypeNotInitialized
  memset(&e->mGlobalName, 0, sizeof(nsGlobalNameStruct));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 72 of file nsScriptNameSpaceManager.cpp.

{
  GlobalNameMapEntry *e = NS_STATIC_CAST(GlobalNameMapEntry *, entry);

  return NS_STATIC_CAST(const nsAString *, &e->mKey);
}

Here is the caller graph for this function:

GlobalNameHashHashKey ( PLDHashTable table,
const void key 
)

Definition at line 80 of file nsScriptNameSpaceManager.cpp.

{
  const nsAString *str = NS_STATIC_CAST(const nsAString *, key);

  return HashString(*str);
}

Here is the call graph for this function:

Here is the caller graph for this function:

GlobalNameHashInitEntry ( PLDHashTable table,
PLDHashEntryHdr entry,
const void key 
)

Definition at line 128 of file nsScriptNameSpaceManager.cpp.

{
  GlobalNameMapEntry *e = NS_STATIC_CAST(GlobalNameMapEntry *, entry);
  const nsAString *keyStr = NS_STATIC_CAST(const nsAString *, key);

  // Initialize the key in the entry with placement new
  new (&e->mKey) nsString(*keyStr);

  // This will set e->mGlobalName.mType to
  // nsGlobalNameStruct::eTypeNotInitialized
  memset(&e->mGlobalName, 0, sizeof(nsGlobalNameStruct));
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 88 of file nsScriptNameSpaceManager.cpp.

{
  const GlobalNameMapEntry *e =
    NS_STATIC_CAST(const GlobalNameMapEntry *, entry);
  const nsAString *str = NS_STATIC_CAST(const nsAString *, key);

  return str->Equals(e->mKey);
}

Here is the caller graph for this function:

NameSetInitCallback ( PLDHashTable table,
PLDHashEntryHdr hdr,
PRUint32  number,
void arg 
)

Definition at line 506 of file nsScriptNameSpaceManager.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: