Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
XPCContext Class Reference

#include <xpcprivate.h>

Collaboration diagram for XPCContext:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LangType { LANG_UNKNOWN, LANG_JS, LANG_NATIVE }

Public Member Functions

XPCJSRuntimeGetRuntime () const
JSContextGetJSContext () const
void Mark ()
void Unmark ()
JSBool IsMarked () const
LangType GetCallingLangType () const
LangType SetCallingLangType (LangType lt)
JSBool CallerTypeIsJavaScript () const
JSBool CallerTypeIsNative () const
JSBool CallerTypeIsKnown () const
nsresult GetException (nsIException **e)
void SetException (nsIException *e)
nsresult GetLastResult ()
void SetLastResult (nsresult rc)
nsresult GetPendingResult ()
void SetPendingResult (nsresult rc)
nsIXPCSecurityManagerGetSecurityManager () const
void SetSecurityManager (nsIXPCSecurityManager *aSecurityManager)
PRUint16 GetSecurityManagerFlags () const
void SetSecurityManagerFlags (PRUint16 f)
nsIXPCSecurityManagerGetAppropriateSecurityManager (PRUint16 flags) const
void DebugDump (PRInt16 depth)
 ~XPCContext ()

Static Public Member Functions

static XPCContextnewXPCContext (XPCJSRuntime *aRuntime, JSContext *aJSContext)

Private Member Functions

 XPCContext ()
 XPCContext (XPCJSRuntime *aRuntime, JSContext *aJSContext)

Private Attributes

XPCJSRuntimemRuntime
JSContextmJSContext
nsresult mLastResult
nsresult mPendingResult
nsIXPCSecurityManagermSecurityManager
nsIExceptionmException
LangType mCallingLangType
PRUint16 mSecurityManagerFlags
JSPackedBool mMarked

Detailed Description

Definition at line 693 of file xpcprivate.h.


Member Enumeration Documentation

Enumerator:
LANG_UNKNOWN 
LANG_JS 
LANG_NATIVE 

Definition at line 702 of file xpcprivate.h.


Constructor & Destructor Documentation

Definition at line 80 of file xpccontext.cpp.

{
    MOZ_COUNT_DTOR(XPCContext);
    NS_IF_RELEASE(mException);
    NS_IF_RELEASE(mSecurityManager);
    // we do not call JS_RemoveArgumentFormatter because we now only
    // delete XPCContext *after* the underlying JSContext is dead
}
XPCContext::XPCContext ( ) [private]

Here is the caller graph for this function:

XPCContext::XPCContext ( XPCJSRuntime aRuntime,
JSContext aJSContext 
) [private]

Member Function Documentation

Definition at line 719 of file xpcprivate.h.

        {
            return LANG_JS == mCallingLangType;
        }

Here is the caller graph for this function:

Definition at line 727 of file xpcprivate.h.

Here is the caller graph for this function:

Definition at line 723 of file xpcprivate.h.

        {
            return LANG_NATIVE == mCallingLangType;
        }

Here is the caller graph for this function:

Definition at line 90 of file xpccontext.cpp.

{
#ifdef DEBUG
    depth--;
    XPC_LOG_ALWAYS(("XPCContext @ %x", this));
        XPC_LOG_INDENT();
        XPC_LOG_ALWAYS(("mRuntime @ %x", mRuntime));
        XPC_LOG_ALWAYS(("mJSContext @ %x", mJSContext));
        XPC_LOG_ALWAYS(("mLastResult of %x", mLastResult));
        XPC_LOG_ALWAYS(("mPendingResult of %x", mPendingResult));
        XPC_LOG_ALWAYS(("mSecurityManager @ %x", mSecurityManager));
        XPC_LOG_ALWAYS(("mSecurityManagerFlags of %x", mSecurityManagerFlags));

        XPC_LOG_ALWAYS(("mException @ %x", mException));
        if(depth && mException)
        {
            // XXX show the exception here...
        }

        XPC_LOG_ALWAYS(("mCallingLangType of %s",
                         mCallingLangType == LANG_UNKNOWN ? "LANG_UNKNOWN" :
                         mCallingLangType == LANG_JS      ? "LANG_JS" :
                                                            "LANG_NATIVE"));
        XPC_LOG_OUTDENT();
#endif
}

Definition at line 761 of file xpcprivate.h.

        {
            NS_WARN_IF_FALSE(CallerTypeIsKnown(),"missing caller type set somewhere");
            if(!CallerTypeIsJavaScript())
                return nsnull;
            if(mSecurityManager)
            {
                if(flags & mSecurityManagerFlags)
                    return mSecurityManager;
            }
            else
            {
                nsIXPCSecurityManager* mgr;
                nsXPConnect* xpc = mRuntime->GetXPConnect();
                mgr = xpc->GetDefaultSecurityManager();
                if(mgr && (flags & xpc->GetDefaultSecurityManagerFlags()))
                    return mgr;
            }
            return nsnull;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 709 of file xpcprivate.h.

        {
            return mCallingLangType;
        }

Definition at line 732 of file xpcprivate.h.

        {
            NS_IF_ADDREF(mException);
            *e = mException;
            return NS_OK;
        }

Here is the caller graph for this function:

JSContext* XPCContext::GetJSContext ( ) const [inline]

Definition at line 700 of file xpcprivate.h.

{return mJSContext;}

Here is the caller graph for this function:

Definition at line 745 of file xpcprivate.h.

{return mLastResult;}

Definition at line 748 of file xpcprivate.h.

{return mPendingResult;}

Here is the caller graph for this function:

XPCJSRuntime* XPCContext::GetRuntime ( ) const [inline]

Definition at line 699 of file xpcprivate.h.

{return mRuntime;}

Here is the caller graph for this function:

Definition at line 751 of file xpcprivate.h.

        {return mSecurityManager;}

Definition at line 756 of file xpcprivate.h.

JSBool XPCContext::IsMarked ( ) const [inline]

Definition at line 707 of file xpcprivate.h.

{return (JSBool) mMarked;}

Here is the caller graph for this function:

void XPCContext::Mark ( ) [inline]

Definition at line 705 of file xpcprivate.h.

Here is the caller graph for this function:

XPCContext * XPCContext::newXPCContext ( XPCJSRuntime aRuntime,
JSContext aJSContext 
) [static]

Definition at line 49 of file xpccontext.cpp.

{
    NS_PRECONDITION(aRuntime,"bad param");
    NS_PRECONDITION(aJSContext,"bad param");
    NS_ASSERTION(JS_GetRuntime(aJSContext) == aRuntime->GetJSRuntime(),
                 "XPConnect can not be used on multiple JSRuntimes!");

    return new XPCContext(aRuntime, aJSContext);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 713 of file xpcprivate.h.

Here is the caller graph for this function:

Definition at line 738 of file xpcprivate.h.

Here is the caller graph for this function:

Definition at line 746 of file xpcprivate.h.

Here is the caller graph for this function:

Definition at line 749 of file xpcprivate.h.

Here is the caller graph for this function:

void XPCContext::SetSecurityManager ( nsIXPCSecurityManager aSecurityManager) [inline]

Definition at line 753 of file xpcprivate.h.

        {mSecurityManager = aSecurityManager;}

Definition at line 758 of file xpcprivate.h.

void XPCContext::Unmark ( ) [inline]

Definition at line 706 of file xpcprivate.h.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 797 of file xpcprivate.h.

Definition at line 796 of file xpcprivate.h.

Definition at line 792 of file xpcprivate.h.

Definition at line 793 of file xpcprivate.h.

Definition at line 799 of file xpcprivate.h.

Definition at line 794 of file xpcprivate.h.

Definition at line 791 of file xpcprivate.h.

Definition at line 795 of file xpcprivate.h.

Definition at line 798 of file xpcprivate.h.


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