js/xpconnect/idl/nsIXPCSecurityManager.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/xpconnect/idl/nsIXPCSecurityManager.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +[ptr] native nsAXPCNativeCallContextPtr(nsAXPCNativeCallContext);
    1.13 +
    1.14 +%{ C++
    1.15 +#include "jspubtd.h"
    1.16 +
    1.17 +class nsAXPCNativeCallContext;
    1.18 +%}
    1.19 +
    1.20 +interface nsIClassInfo;
    1.21 +
    1.22 +[ptr] native JSContextPtr(JSContext);
    1.23 +[ptr] native JSObjectPtr(JSObject);
    1.24 +[ptr] native JSStackFramePtr(JSStackFrame);
    1.25 +
    1.26 +[uuid(d4d21714-116b-4851-a785-098c5dfea523)]
    1.27 +interface nsIXPCSecurityManager : nsISupports
    1.28 +{
    1.29 +    /**
    1.30 +    * For each of these hooks returning NS_OK means 'let the action continue'.
    1.31 +    * Returning an error code means 'veto the action'. XPConnect will return
    1.32 +    * false to the js engine if the action is vetoed. The implementor of this
    1.33 +    * interface is responsible for setting a JS exception into the JSContext
    1.34 +    * if that is appropriate.
    1.35 +    */
    1.36 +
    1.37 +    void CanCreateWrapper(in JSContextPtr aJSContext,
    1.38 +                          in nsIIDRef aIID,
    1.39 +                          in nsISupports aObj,
    1.40 +                          in nsIClassInfo aClassInfo);
    1.41 +
    1.42 +    void CanCreateInstance(in JSContextPtr aJSContext,
    1.43 +                           in nsCIDRef aCID);
    1.44 +
    1.45 +    void CanGetService(in JSContextPtr aJSContext,
    1.46 +                       in nsCIDRef aCID);
    1.47 +};

mercurial