Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsJSUtils.cpp File Reference
#include "nsJSUtils.h"
#include "jsapi.h"
#include "jsdbgapi.h"
#include "prprf.h"
#include "nsIScriptContext.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsIServiceManager.h"
#include "nsIXPConnect.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfo.h"
#include "nsIDOMGCParticipant.h"
#include "nsIWeakReference.h"
#include "nsIScriptSecurityManager.h"

Go to the source code of this file.


#define MARKED_OBJECT_BIT   (PRWord(1<<0))


static nsIXPConnectJSObjectHolderHolderToWrappedJS (void *aKey)

Define Documentation

Definition at line 246 of file nsJSUtils.cpp.

Function Documentation

static nsIXPConnectJSObjectHolder* HolderToWrappedJS ( void aKey) [static]

Definition at line 265 of file nsJSUtils.cpp.

  nsMarkedJSFunctionHolder_base *holder = NS_STATIC_CAST(
    nsMarkedJSFunctionHolder_base*, aKey);

               "yikes, not a marked object");

  nsIWeakReference* weakRef =
    (nsIWeakReference*)(PRWord(holder->mObject) & ~MARKED_OBJECT_BIT);

  // This entire interface is a hack to avoid reference counting, so
  // this actually doesn't do any reference counting, and we don't leak
  // anything.  This is needed so we don't add and remove GC roots in
  // the middle of GC.
  nsWeakRefToIXPConnectWrappedJS *result;
  if (NS_FAILED(CallQueryReferent(weakRef, &result)))
    result = nsnull;
  return result;

Here is the call graph for this function:

Here is the caller graph for this function: