Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
xpcwrappednativescope.cpp File Reference
#include "xpcprivate.h"
#include "XPCNativeWrapper.h"

Go to the source code of this file.

Classes

struct  ShutdownData

Defines

#define DEBUG_TrackNewScope(scope)   ((void)0)
#define DEBUG_TrackDeleteScope(scope)   ((void)0)
#define DEBUG_TrackScopeTraversal()   ((void)0)
#define DEBUG_TrackScopeShutdown()   ((void)0)
#define DEBUG_CheckForComponentsInScope(ccx, obj, OKIfNotInitialized)   ((void)0)

Functions

 WrappedNativeJSGCThingMarker (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WrappedNativeMarker (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WrappedNativeProtoMarker (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WrappedNativeTearoffSweeper (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WrappedNativeShutdownEnumerator (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WrappedNativeProtoShutdownEnumerator (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
static XPCWrappedNativeScopeGetScopeOfObject (JSContext *cx, JSObject *obj)
 WNProtoSecPolicyClearer (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WNSecPolicyClearer (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)
 WNProtoRemover (JSDHashTable *table, JSDHashEntryHdr *hdr, uint32 number, void *arg)

Define Documentation

#define DEBUG_CheckForComponentsInScope (   ccx,
  obj,
  OKIfNotInitialized 
)    ((void)0)

Definition at line 578 of file xpcwrappednativescope.cpp.

Definition at line 103 of file xpcwrappednativescope.cpp.

#define DEBUG_TrackNewScope (   scope)    ((void)0)

Definition at line 102 of file xpcwrappednativescope.cpp.

Definition at line 105 of file xpcwrappednativescope.cpp.

Definition at line 104 of file xpcwrappednativescope.cpp.


Function Documentation

static XPCWrappedNativeScope* GetScopeOfObject ( JSContext cx,
JSObject obj 
) [static]

Definition at line 524 of file xpcwrappednativescope.cpp.

{
    nsISupports* supports;
    JSClass* clazz = JS_GET_CLASS(cx, obj);

    if(!clazz ||
       !(clazz->flags & JSCLASS_HAS_PRIVATE) ||
       !(clazz->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS) ||
       !(supports = (nsISupports*) JS_GetPrivate(cx, obj)))
        return nsnull;

    nsCOMPtr<nsIXPConnectWrappedNative> iface = do_QueryInterface(supports);
    if(iface)
    {
        // We can fairly safely assume that this is really one of our
        // nsXPConnectWrappedNative objects. No other component in our
        // universe should be creating objects that implement the
        // nsIXPConnectWrappedNative interface!
        return ((XPCWrappedNative*)supports)->GetScope();
    }
    return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

WNProtoRemover ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 671 of file xpcwrappednativescope.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

WNProtoSecPolicyClearer ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 633 of file xpcwrappednativescope.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

WNSecPolicyClearer ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 643 of file xpcwrappednativescope.cpp.

{
    XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;
    if(wrapper->HasProto() && !wrapper->HasSharedProto())
        *(wrapper->GetProto()->GetSecurityInfoAddr()) = nsnull;
    return JS_DHASH_NEXT;
}

Here is the call graph for this function:

Here is the caller graph for this function:

WrappedNativeJSGCThingMarker ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 243 of file xpcwrappednativescope.cpp.

{
    XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;
    if(wrapper->HasExternalReference())
    {
        JS_MarkGCThing((JSContext*)arg, wrapper->GetFlatJSObject(), 
                       "XPCWrappedNative::mFlatJSObject", nsnull);
    }
    return JS_DHASH_NEXT;
}

Here is the call graph for this function:

Here is the caller graph for this function:

WrappedNativeMarker ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 327 of file xpcwrappednativescope.cpp.

{
    ((Native2WrappedNativeMap::Entry*)hdr)->value->Mark();
    return JS_DHASH_NEXT;
}

Here is the caller graph for this function:

WrappedNativeProtoMarker ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 337 of file xpcwrappednativescope.cpp.

{
    ((ClassInfo2WrappedNativeProtoMap::Entry*)hdr)->value->Mark();
    return JS_DHASH_NEXT;
}

Here is the caller graph for this function:

WrappedNativeProtoShutdownEnumerator ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 450 of file xpcwrappednativescope.cpp.

{
    ShutdownData* data = (ShutdownData*) arg;
    ((ClassInfo2WrappedNativeProtoMap::Entry*)hdr)->value->
        SystemIsBeingShutDown(data->ccx);
    data->sharedProtoCount++;
    return JS_DHASH_REMOVE;
}

Here is the caller graph for this function:

WrappedNativeShutdownEnumerator ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 433 of file xpcwrappednativescope.cpp.

{
    ShutdownData* data = (ShutdownData*) arg;
    XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;

    if(wrapper->IsValid())
    {
        if(wrapper->HasProto() && !wrapper->HasSharedProto())
            data->nonSharedProtoCount++;
        wrapper->SystemIsBeingShutDown(data->ccx);
        data->wrapperCount++;
    }
    return JS_DHASH_REMOVE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

WrappedNativeTearoffSweeper ( JSDHashTable table,
JSDHashEntryHdr hdr,
uint32  number,
void arg 
)

Definition at line 389 of file xpcwrappednativescope.cpp.

{
    ((Native2WrappedNativeMap::Entry*)hdr)->value->SweepTearOffs();
    return JS_DHASH_NEXT;
}

Here is the caller graph for this function: