Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes
nsJSPrincipals Struct Reference

#include <nsJSPrincipals.h>

Inheritance diagram for nsJSPrincipals:
Inheritance graph
[legend]
Collaboration diagram for nsJSPrincipals:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsJSPrincipals ()
nsresult Init (nsIPrincipal *aPrincipal, const char *aCodebase)
 ~nsJSPrincipals (void)

Static Public Member Functions

static nsresult Startup ()

Public Attributes

nsIPrincipalnsIPrincipalPtr
char * codebase
void *(* JS_DLL_CALLBACK )(JSContext *cx, JSPrincipals *)
JSBool(* JS_DLL_CALLBACK )(JSContext *cx, JSPrincipals *)
void(* JS_DLL_CALLBACK )(JSContext *cx, JSPrincipals *)
jsrefcount refcount

Detailed Description

Definition at line 44 of file nsJSPrincipals.h.


Constructor & Destructor Documentation

Definition at line 189 of file nsJSPrincipals.cpp.

Here is the call graph for this function:

Definition at line 216 of file nsJSPrincipals.cpp.


Member Function Documentation

nsresult nsJSPrincipals::Init ( nsIPrincipal aPrincipal,
const char *  aCodebase 
)

Definition at line 201 of file nsJSPrincipals.cpp.

{
    if (nsIPrincipalPtr) {
        NS_ERROR("Init called twice!");
        return NS_ERROR_UNEXPECTED;
    }

    nsIPrincipalPtr = aPrincipal;
    codebase = PL_strdup(aCodebase);
    if (!codebase)
        return NS_ERROR_OUT_OF_MEMORY;

    return NS_OK;
}

Here is the caller graph for this function:

Definition at line 171 of file nsJSPrincipals.cpp.

{
    static const char rtsvc_id[] = "@mozilla.org/js/xpc/RuntimeService;1";
    nsCOMPtr<nsIJSRuntimeService> rtsvc(do_GetService(rtsvc_id));
    if (!rtsvc)
        return NS_ERROR_FAILURE;

    JSRuntime *rt;
    rtsvc->GetRuntime(&rt);
    NS_ASSERTION(rt != nsnull, "no JSRuntime?!");

    JSPrincipalsTranscoder oldpx;
    oldpx = ::JS_SetPrincipalsTranscoder(rt, nsTranscodeJSPrincipals);
    NS_ASSERTION(oldpx == nsnull, "oops, JS_SetPrincipalsTranscoder wars!");

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

char* JSPrincipals::codebase [inherited]

Definition at line 1460 of file jsapi.h.

Definition at line 1463 of file jsapi.h.

Definition at line 1464 of file jsapi.h.

Definition at line 1469 of file jsapi.h.

Definition at line 51 of file nsJSPrincipals.h.

Definition at line 1467 of file jsapi.h.


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