Back to index

lightning-sunbird  0.9+nobinonly
nsIXPConnect.idl
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1998
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   John Bandhauer <jband@netscape.com> (original author)
00026  *   Nate Nielsen <nielsen@memberwebs.com> 
00027  *
00028  * Alternatively, the contents of this file may be used under the terms of
00029  * either of the GNU General Public License Version 2 or later (the "GPL"),
00030  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00031  * in which case the provisions of the GPL or the LGPL are applicable instead
00032  * of those above. If you wish to allow use of your version of this file only
00033  * under the terms of either the GPL or the LGPL, and not to allow others to
00034  * use your version of this file under the terms of the MPL, indicate your
00035  * decision by deleting the provisions above and replace them with the notice
00036  * and other provisions required by the GPL or the LGPL. If you do not delete
00037  * the provisions above, a recipient may use your version of this file under
00038  * the terms of any one of the MPL, the GPL or the LGPL.
00039  *
00040  * ***** END LICENSE BLOCK ***** */
00041 
00042 /* The core XPConnect public interfaces. */
00043 
00044 #include "nsISupports.idl"
00045 #include "nsIClassInfo.idl"
00046 #include "xpccomponents.idl"
00047 #include "xpcjsid.idl"
00048 #include "xpcexception.idl"
00049 #include "nsIInterfaceInfo.idl"
00050 #include "nsIInterfaceInfoManager.idl"
00051 #include "nsIExceptionService.idl"
00052 #include "nsIVariant.idl"
00053 #include "nsIWeakReference.idl"
00054 
00055 %{ C++
00056 #include "jspubtd.h"
00057 #include "xptinfo.h"
00058 %}
00059 
00060 /***************************************************************************/
00061 
00062 [ptr] native JSContextPtr(JSContext);
00063 [ptr] native JSObjectPtr(JSObject);
00064 [ptr] native JSValPtr(jsval);
00065       native JSVal(jsval);
00066       native JSID(jsid);
00067 [ptr] native voidPtrPtr(void*);
00068 
00069 /***************************************************************************/
00070 
00071 %{ C++
00072 /***************************************************************************/
00073 #define GENERATE_XPC_FAILURE(x) \
00074             (NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_XPCONNECT,x))
00075 
00076 #define NS_ERROR_XPC_NOT_ENOUGH_ARGS                   GENERATE_XPC_FAILURE( 1)
00077 #define NS_ERROR_XPC_NEED_OUT_OBJECT                   GENERATE_XPC_FAILURE( 2)
00078 #define NS_ERROR_XPC_CANT_SET_OUT_VAL                  GENERATE_XPC_FAILURE( 3)
00079 #define NS_ERROR_XPC_NATIVE_RETURNED_FAILURE           GENERATE_XPC_FAILURE( 4)
00080 #define NS_ERROR_XPC_CANT_GET_INTERFACE_INFO           GENERATE_XPC_FAILURE( 5)
00081 #define NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO         GENERATE_XPC_FAILURE( 6)
00082 #define NS_ERROR_XPC_CANT_GET_METHOD_INFO              GENERATE_XPC_FAILURE( 7)
00083 #define NS_ERROR_XPC_UNEXPECTED                        GENERATE_XPC_FAILURE( 8)
00084 #define NS_ERROR_XPC_BAD_CONVERT_JS                    GENERATE_XPC_FAILURE( 9)
00085 #define NS_ERROR_XPC_BAD_CONVERT_NATIVE                GENERATE_XPC_FAILURE(10)
00086 #define NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF           GENERATE_XPC_FAILURE(11)
00087 #define NS_ERROR_XPC_BAD_OP_ON_WN_PROTO                GENERATE_XPC_FAILURE(12)
00088 #define NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN            GENERATE_XPC_FAILURE(13)
00089 #define NS_ERROR_XPC_CANT_DEFINE_PROP_ON_WN            GENERATE_XPC_FAILURE(14)
00090 #define NS_ERROR_XPC_CANT_WATCH_WN_STATIC              GENERATE_XPC_FAILURE(15)
00091 #define NS_ERROR_XPC_CANT_EXPORT_WN_STATIC             GENERATE_XPC_FAILURE(16)
00092 #define NS_ERROR_XPC_SCRIPTABLE_CALL_FAILED            GENERATE_XPC_FAILURE(17)
00093 #define NS_ERROR_XPC_SCRIPTABLE_CTOR_FAILED            GENERATE_XPC_FAILURE(18)
00094 #define NS_ERROR_XPC_CANT_CALL_WO_SCRIPTABLE           GENERATE_XPC_FAILURE(19)
00095 #define NS_ERROR_XPC_CANT_CTOR_WO_SCRIPTABLE           GENERATE_XPC_FAILURE(20)
00096 #define NS_ERROR_XPC_CI_RETURNED_FAILURE               GENERATE_XPC_FAILURE(21)
00097 #define NS_ERROR_XPC_GS_RETURNED_FAILURE               GENERATE_XPC_FAILURE(22)
00098 #define NS_ERROR_XPC_BAD_CID                           GENERATE_XPC_FAILURE(23)
00099 #define NS_ERROR_XPC_BAD_IID                           GENERATE_XPC_FAILURE(24)
00100 #define NS_ERROR_XPC_CANT_CREATE_WN                    GENERATE_XPC_FAILURE(25)
00101 #define NS_ERROR_XPC_JS_THREW_EXCEPTION                GENERATE_XPC_FAILURE(26)
00102 #define NS_ERROR_XPC_JS_THREW_NATIVE_OBJECT            GENERATE_XPC_FAILURE(27)
00103 #define NS_ERROR_XPC_JS_THREW_JS_OBJECT                GENERATE_XPC_FAILURE(28)
00104 #define NS_ERROR_XPC_JS_THREW_NULL                     GENERATE_XPC_FAILURE(29)
00105 #define NS_ERROR_XPC_JS_THREW_STRING                   GENERATE_XPC_FAILURE(30)
00106 #define NS_ERROR_XPC_JS_THREW_NUMBER                   GENERATE_XPC_FAILURE(31)
00107 #define NS_ERROR_XPC_JAVASCRIPT_ERROR                  GENERATE_XPC_FAILURE(32)
00108 #define NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS     GENERATE_XPC_FAILURE(33)
00109 #define NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY   GENERATE_XPC_FAILURE(34)
00110 #define NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY      GENERATE_XPC_FAILURE(35)
00111 #define NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY      GENERATE_XPC_FAILURE(36)
00112 #define NS_ERROR_XPC_CANT_GET_ARRAY_INFO               GENERATE_XPC_FAILURE(37)
00113 #define NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING        GENERATE_XPC_FAILURE(38)
00114 #define NS_ERROR_XPC_SECURITY_MANAGER_VETO             GENERATE_XPC_FAILURE(39)
00115 #define NS_ERROR_XPC_INTERFACE_NOT_SCRIPTABLE          GENERATE_XPC_FAILURE(40)
00116 #define NS_ERROR_XPC_INTERFACE_NOT_FROM_NSISUPPORTS    GENERATE_XPC_FAILURE(41)
00117 #define NS_ERROR_XPC_CANT_GET_JSOBJECT_OF_DOM_OBJECT   GENERATE_XPC_FAILURE(42)
00118 #define NS_ERROR_XPC_CANT_SET_READ_ONLY_CONSTANT       GENERATE_XPC_FAILURE(43)
00119 #define NS_ERROR_XPC_CANT_SET_READ_ONLY_ATTRIBUTE      GENERATE_XPC_FAILURE(44)
00120 #define NS_ERROR_XPC_CANT_SET_READ_ONLY_METHOD         GENERATE_XPC_FAILURE(45)
00121 #define NS_ERROR_XPC_CANT_ADD_PROP_TO_WRAPPED_NATIVE   GENERATE_XPC_FAILURE(46)
00122 #define NS_ERROR_XPC_CALL_TO_SCRIPTABLE_FAILED         GENERATE_XPC_FAILURE(47)
00123 #define NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED    GENERATE_XPC_FAILURE(48)
00124 #define NS_ERROR_XPC_BAD_ID_STRING                     GENERATE_XPC_FAILURE(49)
00125 #define NS_ERROR_XPC_BAD_INITIALIZER_NAME              GENERATE_XPC_FAILURE(50)
00126 #define NS_ERROR_XPC_HAS_BEEN_SHUTDOWN                 GENERATE_XPC_FAILURE(51)
00127 #define NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN            GENERATE_XPC_FAILURE(52)
00128 #define NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL    GENERATE_XPC_FAILURE(53)
00129 
00130 #ifdef XPC_IDISPATCH_SUPPORT
00131 // IDispatch support related errors
00132 #define NS_ERROR_XPC_COM_UNKNOWN                       GENERATE_XPC_FAILURE(54)
00133 #define NS_ERROR_XPC_COM_ERROR                         GENERATE_XPC_FAILURE(55)
00134 #define NS_ERROR_XPC_COM_INVALID_CLASS_ID              GENERATE_XPC_FAILURE(56)
00135 #define NS_ERROR_XPC_COM_CREATE_FAILED                 GENERATE_XPC_FAILURE(57)
00136 #define NS_ERROR_XPC_IDISPATCH_NOT_ENABLED             GENERATE_XPC_FAILURE(58)
00137 #endif
00138 // any new errors here should have an associated entry added in xpc.msg
00139 /***************************************************************************/
00140 %}
00141 
00142 /***************************************************************************/
00143 
00144 // forward declarations...
00145 interface nsIXPCScriptable;
00146 interface nsIXPConnect;
00147 interface nsIXPConnectWrappedNative;
00148 interface nsIInterfaceInfo;
00149 interface nsIXPCSecurityManager;
00150 interface nsIPrincipal;
00151 
00152 /***************************************************************************/
00153 [uuid(8916a320-d118-11d3-8f3a-0010a4e73d9a)]
00154 interface nsIXPConnectJSObjectHolder : nsISupports
00155 {
00156     readonly attribute JSObjectPtr      JSObject;
00157 };
00158 
00159 [uuid(215DBE02-94A7-11d2-BA58-00805F8A5DD7)]
00160 interface nsIXPConnectWrappedNative : nsIXPConnectJSObjectHolder
00161 {
00162     /* attribute 'JSObject' inherited from nsIXPConnectJSObjectHolder */
00163     readonly attribute nsISupports      Native;
00164     readonly attribute JSObjectPtr      JSObjectPrototype;
00165 
00170     readonly attribute nsIXPConnect XPConnect;
00171     nsIInterfaceInfo FindInterfaceWithMember(in JSVal nameID);
00172     nsIInterfaceInfo FindInterfaceWithName(in JSVal nameID);
00173 
00174     void debugDump(in short depth);
00175 
00176     void refreshPrototype();
00177     /* 
00178      * This returns a pointer into the instance and care should be taken
00179      * to make sure the pointer is not kept past the life time of the
00180      * object it points into.
00181      */
00182     voidPtrPtr GetSecurityInfoAddress();
00183 
00184 %{C++
00188     nsISupports* Native() const { return mIdentity; }
00189 
00190 protected:
00191     nsISupports *mIdentity;
00192 public:
00193 %}
00194 };
00195 
00196 %{C++
00197 inline
00198 const nsQueryInterface
00199 do_QueryWrappedNative(nsIXPConnectWrappedNative *aWrappedNative)
00200 {
00201     return nsQueryInterface(aWrappedNative->Native());
00202 }
00203 
00204 inline
00205 const nsQueryInterfaceWithError
00206 do_QueryWrappedNative(nsIXPConnectWrappedNative *aWrappedNative,
00207                       nsresult *aError)
00208 
00209 {
00210     return nsQueryInterfaceWithError(aWrappedNative->Native(), aError);
00211 }
00212 
00213 %}
00214 
00215 [uuid(BED52030-BCA6-11d2-BA79-00805F8A5DD7)]
00216 interface nsIXPConnectWrappedJS : nsIXPConnectJSObjectHolder
00217 {
00218     /* attribute 'JSObject' inherited from nsIXPConnectJSObjectHolder */
00219     readonly attribute nsIInterfaceInfo InterfaceInfo;
00220     readonly attribute nsIIDPtr         InterfaceIID;
00221 
00222     void debugDump(in short depth);
00223 
00224     void aggregatedQueryInterface(in nsIIDRef uuid,
00225                                   [iid_is(uuid),retval] out nsQIResult result);
00226 };
00227 
00228 [uuid(0f1799d3-13d3-45f7-8361-0a6f211183f4)]
00229 interface nsIXPConnectWrappedJS_MOZILLA_1_8_BRANCH : nsIXPConnectWrappedJS
00230 {
00231     /* This method has the same signature and the same semantics as the
00232      * one method on nsISupportsWeakReference.  However, it exists here
00233      * so that callers who need to manage JS garbage collection for
00234      * wrapped objects themselves can get a weak reference to the
00235      * wrapped JS object:  in other words, it's for callers who know
00236      * that they're dealing with a wrapper, and want a weak reference to
00237      * the wrapper rather than the wrapped object.
00238      */
00239     nsIWeakReference GetWeakReference();
00240 };
00241 
00248 [uuid(3f32871c-d014-4f91-b358-3ece74cbebaa)]
00249 interface nsWeakRefToIXPConnectWrappedJS : nsIXPConnectWrappedJS_MOZILLA_1_8_BRANCH
00250 {
00251 };
00252 
00253 /***************************************************************************/
00254 
00263 [uuid(0FA68A60-8289-11d3-BB1A-00805F8A5DD7)]
00264 interface nsIXPCNativeCallContext : nsISupports
00265 {
00266 
00267     readonly attribute nsISupports                  Callee;
00268     readonly attribute PRUint16                     CalleeMethodIndex;
00269     readonly attribute nsIXPConnectWrappedNative    CalleeWrapper;
00270     readonly attribute JSContextPtr                 JSContext;
00271     readonly attribute PRUint32                     Argc;
00272     readonly attribute JSValPtr                     ArgvPtr;
00276     readonly attribute JSValPtr                     RetValPtr;
00282     attribute PRBool                                ExceptionWasThrown;
00283 
00289     attribute PRBool                                ReturnValueWasSet;
00290 
00291     // Methods added since mozilla 0.6....
00292 
00293     readonly attribute nsIInterfaceInfo             CalleeInterface;
00294     readonly attribute nsIClassInfo                 CalleeClassInfo;
00295 };
00296 
00297 /***************************************************************************/
00298 
00370 [scriptable, uuid(254bb2e0-6439-11d4-8fe0-0010a4e73d9a)]
00371 interface nsIXPCWrappedJSObjectGetter : nsISupports
00372 {
00373     readonly attribute nsISupports neverCalled;
00374 };
00375 
00376 /***************************************************************************/
00377 
00378 /*
00379  * This interface is implemented by outside code and registered with xpconnect
00380  * via nsIXPConnect::setFunctionThisTranslator.
00381  *
00382  * The reason this exists is to support calls to JavaScript event callbacks
00383  * needed by the DOM via xpconnect from C++ code.
00384  *
00385  * We've added support for wrapping JS function objects as xpcom interfaces
00386  * by declaring the given interface as a [function] interface. However, to
00387  * support the requirements of JS event callbacks we need to call the JS
00388  * function with the 'this' set as the JSObject for which the event is being
00389  * fired; e.g. a form node.
00390  *
00391  * We've decided that for all cases we care about the appropriate 'this' object
00392  * can be derived from the first param in the call to the callback. In the
00393  * event handler case the first param is an event object.
00394  *
00395  * Though we can't change all the JS code so that it would setup its own 'this',
00396  * we can add plugin 'helper' support to xpconnect. And that is what we have
00397  * here.
00398  *
00399  * The idea is that at startup time some code that cares about this issue
00400  * (e.g. the DOM helper code) can register a nsIXPCFunctionThisTranslator
00401  * object with xpconnect to handle calls to [function] interfaces of a given
00402  * iid. When xpconnect goes to invoke a method on a wrapped JSObject for
00403  * an interface marked as [function], xpconnect will check if the first param
00404  * of the method is an xpcom object pointer and if so it will check to see if a
00405  * nsIXPCFunctionThisTranslator has been registered for the given iid of the
00406  * interface being called. If so it will call the translator and get an
00407  * interface pointer to use as the 'this' for the call. If the translator
00408  * returns a non-null interface pointer (which it should then have addref'd
00409  * since it is being returned as an out param), xpconnect will attempt to build
00410  * a wrapper around the pointer and get a JSObject from that wrapper to use
00411  * as the 'this' for the call.
00412  *
00413  * If a null interface pointer is returned then xpconnect will use the default
00414  * 'this' - the same JSObject as the function object it is calling.
00415  *
00416  * The translator can also return a non-null aIIDOfResult to tell xpconnect what
00417  * type of wrapper to build. If that is null then xpconnect will assume the
00418  * wrapper should be for nsISupports. For objects that support flattening -
00419  * i.e. expose nsIClassInfo and that interface's getInterfaces method - then
00420  * a flattened wrapper will be created and no iid was really necessary.
00421  *
00422  * XXX aHideFirstParamFromJS is intended to allow the trimming of that first
00423  * param (used to indicate 'this') from the actual call to the JS code. The JS
00424  * DOM does not require this functionality and it is **NOT YET IMPLEMENTED**
00425  *
00426  */
00427 
00428 [uuid(039ef260-2a0d-11d5-90a7-0010a4e73d9a)]
00429 interface nsIXPCFunctionThisTranslator : nsISupports
00430 {
00431     nsISupports TranslateThis(in nsISupports        aInitialThis,
00432                               in nsIInterfaceInfo   aInterfaceInfo,
00433                               in PRUint16           aMethodIndex,
00434                               out PRBool            aHideFirstParamFromJS,
00435                               out nsIIDPtr          aIIDOfResult);
00436 };
00437 
00438 /***************************************************************************/
00439 
00440 %{ C++
00441 // For use with the service manager
00442 // {CB6593E0-F9B2-11d2-BDD6-000064657374}
00443 #define NS_XPCONNECT_CID \
00444 { 0xcb6593e0, 0xf9b2, 0x11d2, \
00445     { 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
00446 %}
00447 
00448 [uuid(DEB1D48E-7469-4B01-B186-D9854C7D3F2D)]
00449 interface nsIXPConnect : nsISupports
00450 {
00451 %{ C++
00452   NS_DEFINE_STATIC_CID_ACCESSOR(NS_XPCONNECT_CID)
00453 %}
00454 
00455     void
00456     initClasses(in JSContextPtr aJSContext,
00457                 in JSObjectPtr  aGlobalJSObj);
00458 
00459     nsIXPConnectJSObjectHolder
00460     initClassesWithNewWrappedGlobal(
00461                   in JSContextPtr aJSContext,
00462                   in nsISupports  aCOMObj,
00463                   in nsIIDRef     aIID,
00464                   in PRUint32     aFlags);
00465 
00466     const PRUint32 INIT_JS_STANDARD_CLASSES  = 1 << 0;
00467     const PRUint32 FLAG_SYSTEM_GLOBAL_OBJECT = 1 << 1;
00468 
00504     nsIXPConnectJSObjectHolder
00505     wrapNative(in JSContextPtr aJSContext,
00506                in JSObjectPtr  aScope,
00507                in nsISupports  aCOMObj,
00508                in nsIIDRef     aIID);
00509 
00533     void
00534     wrapJS(in JSContextPtr aJSContext,
00535            in JSObjectPtr  aJSObj,
00536            in nsIIDRef     aIID,
00537            [iid_is(aIID),retval] out nsQIResult result);
00538 
00543     nsIXPConnectWrappedNative
00544     getWrappedNativeOfJSObject(in JSContextPtr aJSContext,
00545                                in JSObjectPtr  aJSObj);
00546 
00547     void setSecurityManagerForJSContext(in JSContextPtr aJSContext,
00548                                         in nsIXPCSecurityManager aManager,
00549                                         in PRUint16 flags);
00550 
00551     void getSecurityManagerForJSContext(in JSContextPtr aJSContext,
00552                                         out nsIXPCSecurityManager aManager,
00553                                         out PRUint16 flags);
00554 
00559     void setDefaultSecurityManager(in nsIXPCSecurityManager aManager,
00560                                    in PRUint16 flags);
00561 
00562     void getDefaultSecurityManager(out nsIXPCSecurityManager aManager,
00563                                    out PRUint16 flags);
00564 
00565     nsIStackFrame
00566     createStackFrameLocation(in PRUint32       aLanguage,
00567                              in string         aFilename,
00568                              in string         aFunctionName,
00569                              in PRInt32        aLineNumber,
00570                              in nsIStackFrame  aCaller);
00571 
00579     void syncJSContexts();
00580 
00581     readonly attribute nsIStackFrame                CurrentJSStack;
00582     readonly attribute nsIXPCNativeCallContext      CurrentNativeCallContext;
00583     /* pass nsnull to clear pending exception */
00584              attribute nsIException                 PendingException;
00585 
00586     void debugDump(in short depth);
00587     void debugDumpObject(in nsISupports aCOMObj, in short depth);
00588     void debugDumpJSStack(in PRBool showArgs,
00589                           in PRBool showLocals,
00590                           in PRBool showThisProps);
00591     void debugDumpEvalInJSStackFrame(in PRUint32 aFrameNumber,
00592                                      in string aSourceText);
00593 
00601     void setSafeJSContextForCurrentThread(in JSContextPtr cx);
00602 
00617     void
00618     wrapJSAggregatedToNative(in nsISupports  aOuter,
00619                              in JSContextPtr aJSContext,
00620                              in JSObjectPtr  aJSObj,
00621                              in nsIIDRef     aIID,
00622                              [iid_is(aIID),retval] out nsQIResult result);
00623 
00624     // Methods added since mozilla 0.6....
00625 
00630     nsIXPConnectWrappedNative
00631     getWrappedNativeOfNativeObject(in JSContextPtr aJSContext,
00632                                    in JSObjectPtr  aScope,
00633                                    in nsISupports  aCOMObj,
00634                                    in nsIIDRef     aIID);
00635 
00636     nsIXPCFunctionThisTranslator
00637     getFunctionThisTranslator(in nsIIDRef aIID);
00638 
00639     nsIXPCFunctionThisTranslator
00640     setFunctionThisTranslator(in nsIIDRef aIID,
00641                               in nsIXPCFunctionThisTranslator aTranslator);
00642 
00643     nsIXPConnectJSObjectHolder
00644     reparentWrappedNativeIfFound(in JSContextPtr aJSContext,
00645                                  in JSObjectPtr  aScope,
00646                                  in JSObjectPtr  aNewParent,
00647                                  in nsISupports  aCOMObj);
00648 
00649     void clearAllWrappedNativeSecurityPolicies();
00650 
00651     nsIXPConnectJSObjectHolder
00652     getWrappedNativePrototype(in JSContextPtr aJSContext,
00653                               in JSObjectPtr  aScope,
00654                               in nsIClassInfo aClassInfo);
00655 
00656     attribute PRBool collectGarbageOnMainThreadOnly;
00657     attribute PRBool deferReleasesUntilAfterGarbageCollection;
00658 
00659     void releaseJSContext(in JSContextPtr aJSContext, in PRBool noGC);
00660 
00661     JSVal variantToJS(in JSContextPtr ctx, in JSObjectPtr scope, in nsIVariant value);
00662     nsIVariant JSToVariant(in JSContextPtr ctx, in JSVal value);
00663 
00673     void flagSystemFilenamePrefix(in string aFilenamePrefix);
00674 
00681     void restoreWrappedNativePrototype(in JSContextPtr aJSContext,
00682                                        in JSObjectPtr  aScope,
00683                                        in nsIClassInfo aClassInfo,
00684                                        in nsIXPConnectJSObjectHolder aPrototype);
00685 };
00686 
00687 [uuid(4b61f818-d260-45ab-ac4e-d27790b5be5e)]
00688 interface nsIXPConnect_MOZILLA_1_8_BRANCH : nsIXPConnect
00689 {
00690     void
00691     reparentScopeAwareWrappers(in JSContextPtr aJSContext,
00692                                in JSObjectPtr  aOldScope,
00693                                in JSObjectPtr  aNewScope);
00694 
00703    nsIXPConnectJSObjectHolder createSandbox(in JSContextPtr cx,
00704                                             in nsIPrincipal principal);
00705 
00720    JSVal evalInSandboxObject(in AString source, in JSContextPtr cx,
00721                              in nsIXPConnectJSObjectHolder sandbox);
00722 };
00723 
00724 [uuid(f4bec7f9-256b-4acd-b32c-2c3d37615190)]
00725 interface nsIXPConnect_MOZILLA_1_8_BRANCH2 : nsIXPConnect_MOZILLA_1_8_BRANCH
00726 {
00745    JSVal evalInSandboxObject2(in AString source, in JSContextPtr cx,
00746                               in nsIXPConnectJSObjectHolder sandbox,
00747                               in PRBool returnStringOnly);
00748 };