Struct xpcom::interfaces::nsIScriptSecurityManager [] [src]

#[repr(C)]
pub struct nsIScriptSecurityManager { /* fields omitted */ }

interface nsIScriptSecurityManager : nsISupports

Methods

impl nsIScriptSecurityManager
[src]

[src]

Cast this nsIScriptSecurityManager to one of its base interfaces.

impl nsIScriptSecurityManager
[src]

STANDARD: i64 = 0
/**
     * Default CheckLoadURI permissions
     */

LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT: i64 = 1

ALLOW_CHROME: i64 = 2

DISALLOW_INHERIT_PRINCIPAL: i64 = 4

DISALLOW_SCRIPT_OR_DATA: i64 = 4

DISALLOW_SCRIPT: i64 = 8

DONT_REPORT_ERRORS: i64 = 16

NO_APP_ID: i64 = 0

UNKNOWN_APP_ID: i64 = 4294967295

DEFAULT_USER_CONTEXT_ID: i64 = 0

[src]

/**
     * Check that content with principal aPrincipal can load "uri".
     *
     * Will return error code NS_ERROR_DOM_BAD_URI if the load request
     * should be denied.
     *
     * @param aPrincipal the principal identifying the actor causing the load
     * @param uri the URI that is being loaded
     * @param flags the permission set, see above
     */

void checkLoadURIWithPrincipal (in nsIPrincipal aPrincipal, in nsIURI uri, in unsigned long flags);

[src]

/**
     * Similar to checkLoadURIWithPrincipal but there are two differences:
     *
     * 1) The URI is a string, not a URI object.
     * 2) This function assumes that the URI may still be subject to fixup (and
     * hence will check whether fixed-up versions of the URI are allowed to
     * load as well); if any of the versions of this URI is not allowed, this
     * function will return error code NS_ERROR_DOM_BAD_URI.
     */

void checkLoadURIStrWithPrincipal (in nsIPrincipal aPrincipal, in AUTF8String uri, in unsigned long flags);

[src]

/**
     * Returns true if the URI is from a domain that is white-listed through
     * prefs to be allowed to use file:// URIs.
     * @param aUri the URI to be tested
     */

bool inFileURIWhitelist (in nsIURI aUri);

[src]

/**
     * Return the all-powerful system principal.
     */

nsIPrincipal getSystemPrincipal ();

[src]

/**
     * Returns a principal that has the OriginAttributes of the load context.
     * @param loadContext to get the OriginAttributes from.
     */

nsIPrincipal getLoadContextCodebasePrincipal (in nsIURI uri, in nsILoadContext loadContext);

[src]

/**
     * Returns a principal that has the OriginAttributes of the docshell.
     * @param docShell to get the OriginAttributes from.
     */

nsIPrincipal getDocShellCodebasePrincipal (in nsIURI uri, in nsIDocShell docShell);

[src]

/**
     * Returns a principal whose origin is the one we pass in.
     * See nsIPrincipal.idl for a description of origin attributes, and
     * ChromeUtils.webidl for a list of origin attributes and their defaults.
     */

nsIPrincipal createCodebasePrincipalFromOrigin (in ACString origin);

[src]

/**
     * Returns OK if aSourceURI and target have the same "origin"
     * (scheme, host, and port).
     * ReportError flag suppresses error reports for functions that
     * don't need reporting.
     */

void checkSameOriginURI (in nsIURI aSourceURI, in nsIURI aTargetURI, in boolean reportError);

[src]

/**
     * Get the principal for the given channel.  This will typically be the
     * channel owner if there is one, and the codebase principal for the
     * channel's URI otherwise.  aChannel must not be null.
     */

nsIPrincipal getChannelResultPrincipal (in nsIChannel aChannel);

[src]

/**
     * Get the codebase principal for the channel's URI.
     * aChannel must not be null.
     */

nsIPrincipal getChannelURIPrincipal (in nsIChannel aChannel);

[src]

/**
     * Check whether a given principal is a system principal.  This allows us
     * to avoid handing back the system principal to script while allowing
     * script to check whether a given principal is system.
     */

boolean isSystemPrincipal (in nsIPrincipal aPrincipal);

[src]

/**
     * Per-domain controls to enable and disable script. This system is designed
     * to be used by at most one consumer, and enforces this with its semantics.
     *
     * Initially, domainPolicyActive is false. When activateDomainPolicy() is
     * invoked, domainPolicyActive becomes true, and subsequent calls to
     * activateDomainPolicy() will fail until deactivate() is invoked on the
     * nsIDomainPolicy returned from activateDomainPolicy(). At this point,
     * domainPolicyActive becomes false again, and a new consumer may acquire
     * control of the system by invoking activateDomainPolicy().
     */

nsIDomainPolicy activateDomainPolicy ();

[src]

readonly attribute boolean domainPolicyActive;

[src]

/**
     * Only the parent process can directly access domain policies, child
     * processes only have a read-only mirror to the one in the parent.
     * For child processes the mirror is updated via messages
     * and ContentChild will hold the DomainPolicy by calling
     * ActivateDomainPolicyInternal directly. New consumer to this
     * function should not be addded.
     */

[noscript] nsIDomainPolicy activateDomainPolicyInternal ();

[src]

/**
     * Query mechanism for the above policy.
     *
     * If domainPolicyEnabled is false, this simply returns the current value
     * of javascript.enabled. Otherwise, it returns the same value, but taking
     * the various blacklist/whitelist exceptions into account.
     */

bool policyAllowsScript (in nsIURI aDomain);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsIScriptSecurityManager
[src]

IID: nsIID = nsID(1373285767, 14860, 17612, [182, 32, 115, 86, 128, 28, 144, 34])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsIScriptSecurityManager
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIScriptSecurityManager
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.