Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
XPCNativeScriptableShared Class Reference

#include <xpcprivate.h>

Collaboration diagram for XPCNativeScriptableShared:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const XPCNativeScriptableFlagsGetFlags () const
JSClassGetJSClass ()
 XPCNativeScriptableShared (JSUint32 aFlags=0, char *aName=nsnull)
 ~XPCNativeScriptableShared ()
char * TransferNameOwnership ()
void PopulateJSClass (JSBool isGlobal)
void Mark ()
void Unmark ()
JSBool IsMarked () const

Private Attributes

XPCNativeScriptableFlags mFlags
JSExtendedClass mJSClass

Detailed Description

Definition at line 1507 of file xpcprivate.h.


Constructor & Destructor Documentation

XPCNativeScriptableShared::XPCNativeScriptableShared ( JSUint32  aFlags = 0,
char *  aName = nsnull 
) [inline]

Definition at line 1513 of file xpcprivate.h.

Here is the call graph for this function:

Definition at line 1519 of file xpcprivate.h.


Member Function Documentation

Definition at line 1510 of file xpcprivate.h.

{return mFlags;}

Here is the caller graph for this function:

Definition at line 1511 of file xpcprivate.h.

{return &mJSClass.base;}

Here is the caller graph for this function:

Definition at line 1531 of file xpcprivate.h.

{return mFlags.IsMarked();}

Here is the caller graph for this function:

Definition at line 1529 of file xpcprivate.h.

{mFlags.Mark();}

Definition at line 1331 of file xpcwrappednativejsops.cpp.

{
    NS_ASSERTION(mJSClass.base.name, "bad state!");

    mJSClass.base.flags = JSCLASS_HAS_PRIVATE |
                          JSCLASS_PRIVATE_IS_NSISUPPORTS |
                          JSCLASS_NEW_RESOLVE |
                          JSCLASS_IS_EXTENDED;

    if(isGlobal)
        mJSClass.base.flags |= JSCLASS_GLOBAL_FLAGS;

    if(mFlags.WantAddProperty())
        mJSClass.base.addProperty = XPC_WN_Helper_AddProperty;
    else if(mFlags.UseJSStubForAddProperty())
        mJSClass.base.addProperty = JS_PropertyStub;
    else if(mFlags.AllowPropModsDuringResolve())
        mJSClass.base.addProperty = XPC_WN_MaybeResolvingPropertyStub;
    else
        mJSClass.base.addProperty = XPC_WN_CannotModifyPropertyStub;

    if(mFlags.WantDelProperty())
        mJSClass.base.delProperty = XPC_WN_Helper_DelProperty;
    else if(mFlags.UseJSStubForDelProperty())
        mJSClass.base.delProperty = JS_PropertyStub;
    else if(mFlags.AllowPropModsDuringResolve())
        mJSClass.base.delProperty = XPC_WN_MaybeResolvingPropertyStub;
    else
        mJSClass.base.delProperty = XPC_WN_CannotModifyPropertyStub;

    if(mFlags.WantGetProperty())
        mJSClass.base.getProperty = XPC_WN_Helper_GetProperty;
    else
        mJSClass.base.getProperty = JS_PropertyStub;

    if(mFlags.WantSetProperty())
        mJSClass.base.setProperty = XPC_WN_Helper_SetProperty;
    else if(mFlags.UseJSStubForSetProperty())
        mJSClass.base.setProperty = JS_PropertyStub;
    else if(mFlags.AllowPropModsDuringResolve())
        mJSClass.base.setProperty = XPC_WN_MaybeResolvingPropertyStub;
    else
        mJSClass.base.setProperty = XPC_WN_CannotModifyPropertyStub;

    // We figure out most of the enumerate strategy at call time.

    if(mFlags.WantNewEnumerate() || mFlags.WantEnumerate() ||
       mFlags.DontEnumStaticProps())
        mJSClass.base.enumerate = JS_EnumerateStub;
    else
        mJSClass.base.enumerate = XPC_WN_Shared_Enumerate;

    // We have to figure out resolve strategy at call time
    mJSClass.base.resolve = (JSResolveOp) XPC_WN_Helper_NewResolve;

    if(mFlags.WantConvert())
        mJSClass.base.convert = XPC_WN_Helper_Convert;
    else
        mJSClass.base.convert = XPC_WN_Shared_Convert;

    if(mFlags.WantFinalize())
        mJSClass.base.finalize = XPC_WN_Helper_Finalize;
    else
        mJSClass.base.finalize = XPC_WN_NoHelper_Finalize;

    // We let the rest default to nsnull unless the helper wants them...
    if(mFlags.WantCheckAccess())
        mJSClass.base.checkAccess = XPC_WN_Helper_CheckAccess;

    // Note that we *must* set
    //   mJSClass.base.getObjectOps = XPC_WN_GetObjectOpsNoCall
    // or
    //   mJSClass.base.getObjectOps = XPC_WN_GetObjectOpsWithCall
    // (even for the cases were it does not do much) because with these
    // dynamically generated JSClasses, the code in
    // XPCWrappedNative::GetWrappedNativeOfJSObject() needs to look for
    // that this callback pointer in order to identify that a given
    // JSObject represents a wrapper.

    if(mFlags.WantCall() || mFlags.WantConstruct())
    {
        mJSClass.base.getObjectOps = XPC_WN_GetObjectOpsWithCall;
        if(mFlags.WantCall())
            mJSClass.base.call = XPC_WN_Helper_Call;
        if(mFlags.WantConstruct())
            mJSClass.base.construct = XPC_WN_Helper_Construct;
    }
    else
    {
        mJSClass.base.getObjectOps = XPC_WN_GetObjectOpsNoCall;
    }

    if(mFlags.WantHasInstance())
        mJSClass.base.hasInstance = XPC_WN_Helper_HasInstance;

    if(mFlags.WantMark())
        mJSClass.base.mark = XPC_WN_Helper_Mark;
    else
        mJSClass.base.mark = XPC_WN_Shared_Mark;

    mJSClass.equality = XPC_WN_Equality;
    mJSClass.outerObject = XPC_WN_OuterObject;
    mJSClass.innerObject = XPC_WN_InnerObject;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1523 of file xpcprivate.h.

        {char* name=(char*)mJSClass.base.name; mJSClass.base.name = nsnull;
        return name;}

Here is the caller graph for this function:

Definition at line 1530 of file xpcprivate.h.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1534 of file xpcprivate.h.

Definition at line 1535 of file xpcprivate.h.


The documentation for this class was generated from the following files: