Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
xpcjsid.cpp File Reference
#include "xpcprivate.h"
#include "xpc_map_end.h"

Go to the source code of this file.

Classes

class  SharedScriptableHelperForJSIID

Defines

#define XPC_MAP_CLASSNAME   SharedScriptableHelperForJSIID
#define XPC_MAP_QUOTED_CLASSNAME   "JSIID"
#define XPC_MAP_FLAGS
#define XPC_MAP_CLASSNAME   nsJSIID
#define XPC_MAP_QUOTED_CLASSNAME   "nsJSIID"
#define XPC_MAP_WANT_NEWRESOLVE
#define XPC_MAP_WANT_ENUMERATE
#define XPC_MAP_WANT_HASINSTANCE
#define XPC_MAP_FLAGS
#define XPC_MAP_CLASSNAME   nsJSCID
#define XPC_MAP_QUOTED_CLASSNAME   "nsJSCID"
#define XPC_MAP_WANT_CONSTRUCT
#define XPC_MAP_WANT_HASINSTANCE
#define XPC_MAP_FLAGS   0

Functions

NS_METHOD GetSharedScriptableHelperForJSIID (PRUint32 language, nsISupports **helper)
nsIClassInfoNS_CLASSINFO_NAME (nsJSIID)
nsIClassInfoNS_CLASSINFO_NAME (nsJSCID)
JSBool xpc_InitJSxIDClassObjects ()
void xpc_DestroyJSxIDClassObjects ()
JSObjectxpc_NewIDObject (JSContext *cx, JSObject *jsobj, const nsID &aID)
nsIDxpc_JSObjectToID (JSContext *cx, JSObject *obj)
JSBool xpc_JSObjectIsID (JSContext *cx, JSObject *obj)

Variables

static nsIXPCScriptablegSharedScriptableHelperForJSIID
static JSBool gClassObjectsWereInited = JS_FALSE
static const nsModuleComponentInfo CI_nsJSIID
static const nsModuleComponentInfo CI_nsJSCID

Define Documentation

Definition at line 658 of file xpcjsid.cpp.

Definition at line 658 of file xpcjsid.cpp.

Definition at line 658 of file xpcjsid.cpp.

Value:
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |\
                                    nsIXPCScriptable::ALLOW_PROP_MODS_DURING_RESOLVE

Definition at line 662 of file xpcjsid.cpp.

Value:
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |\
                                    nsIXPCScriptable::ALLOW_PROP_MODS_DURING_RESOLVE

Definition at line 662 of file xpcjsid.cpp.

Definition at line 662 of file xpcjsid.cpp.

Definition at line 659 of file xpcjsid.cpp.

Definition at line 659 of file xpcjsid.cpp.

Definition at line 659 of file xpcjsid.cpp.

Definition at line 660 of file xpcjsid.cpp.

Definition at line 390 of file xpcjsid.cpp.

Definition at line 661 of file xpcjsid.cpp.

Definition at line 661 of file xpcjsid.cpp.

Definition at line 389 of file xpcjsid.cpp.


Function Documentation

NS_METHOD GetSharedScriptableHelperForJSIID ( PRUint32  language,
nsISupports **  helper 
)
JSBool xpc_JSObjectIsID ( JSContext cx,
JSObject obj 
)

Definition at line 1024 of file xpcjsid.cpp.

{
    NS_ASSERTION(cx && obj, "bad param");
    // NOTE: this call does NOT addref
    XPCWrappedNative* wrapper =
        XPCWrappedNative::GetWrappedNativeOfJSObject(cx, obj);
    return wrapper &&
           (wrapper->HasInterfaceNoQI(NS_GET_IID(nsIJSID))  ||
            wrapper->HasInterfaceNoQI(NS_GET_IID(nsIJSIID)) ||
            wrapper->HasInterfaceNoQI(NS_GET_IID(nsIJSCID)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsID* xpc_JSObjectToID ( JSContext cx,
JSObject obj 
)

Definition at line 1004 of file xpcjsid.cpp.

{
    nsID* id = nsnull;
    if(!cx || !obj)
        return nsnull;

    // NOTE: this call does NOT addref
    XPCWrappedNative* wrapper =
        XPCWrappedNative::GetWrappedNativeOfJSObject(cx, obj);
    if(wrapper &&
       (wrapper->HasInterfaceNoQI(NS_GET_IID(nsIJSID))  ||
        wrapper->HasInterfaceNoQI(NS_GET_IID(nsIJSIID)) ||
        wrapper->HasInterfaceNoQI(NS_GET_IID(nsIJSCID))))
    {
        ((nsIJSID*)wrapper->GetIdentityObject())->GetId(&id);
    }
    return id;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JSObject* xpc_NewIDObject ( JSContext cx,
JSObject jsobj,
const nsID aID 
)

Definition at line 973 of file xpcjsid.cpp.

{
    JSObject *obj = nsnull;

    char* idString = aID.ToString();
    if(idString)
    {
        nsCOMPtr<nsIJSID> iid =
            dont_AddRef(NS_STATIC_CAST(nsIJSID*, nsJSID::NewID(idString)));
        PR_Free(idString);
        if(iid)
        {
            nsXPConnect* xpc = nsXPConnect::GetXPConnect();
            if(xpc)
            {
                nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
                nsresult rv = xpc->WrapNative(cx, jsobj,
                                              NS_STATIC_CAST(nsISupports*,iid),
                                              NS_GET_IID(nsIJSID),
                                              getter_AddRefs(holder));
                if(NS_SUCCEEDED(rv) && holder)
                {
                    holder->GetJSObject(&obj);
                }
            }
        }
    }
    return obj;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Initial value:
    {"JSCID",
     {0x9255b5b0, 0x35cf, 0x11d5, { 0x90, 0xb2, 0x0, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }},
     nsnull, nsnull, nsnull,nsnull, nsnull,
     NS_CI_INTERFACE_GETTER_NAME(nsJSCID), nsnull,
     &NS_CLASSINFO_NAME(nsJSCID), 0}

Definition at line 311 of file xpcjsid.cpp.

Initial value:
    {"JSIID",
     {0x26ecb8d0, 0x35c9, 0x11d5, { 0x90, 0xb2, 0x0, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }},
     nsnull, nsnull, nsnull,nsnull, nsnull,
     NS_CI_INTERFACE_GETTER_NAME(nsJSIID),
     GetSharedScriptableHelperForJSIID,
     &NS_CLASSINFO_NAME(nsJSIID), 0}

Definition at line 300 of file xpcjsid.cpp.

Definition at line 295 of file xpcjsid.cpp.

Definition at line 278 of file xpcjsid.cpp.