new method SetRootedScriptObject. bug 43466 r=brendan

This commit is contained in:
danm%netscape.com 2000-08-26 23:32:52 +00:00
Родитель a8fd33e3d0
Коммит 2b7255f9bf
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -330,6 +330,16 @@ public:
NS_IMETHOD SetTerminationFunction(nsScriptTerminationFunc aFunc,
nsISupports* aRef) = 0;
/**
* Store a single script object to be unrooted from the script garbage
* collector in the implementation's destructor. This obvious hack
* is used to delay the unrooting of an object until that point.
* (At time of writing, it's used only on the window script object).
* This should never be called twice (the stored object will never
* be replaced.)
*/
NS_IMETHOD SetRootedScriptObject(void *aObject) = 0;
/**
* Called to disable/enable script execution in this context.
*/

Просмотреть файл

@ -49,6 +49,7 @@ private:
nsCOMPtr<nsISupports> mRef;
PRBool mScriptsEnabled;
PRUint32 mBranchCallbackCount;
void *mRootedScriptObject; // special case for the window script object
static JSBool PR_CALLBACK DOMBranchCallback(JSContext *cx, JSScript *script);
@ -127,6 +128,7 @@ public:
NS_IMETHOD GetOwner(nsIScriptContextOwner** owner);
NS_IMETHOD SetTerminationFunction(nsScriptTerminationFunc aFunc,
nsISupports* aRef);
NS_IMETHOD SetRootedScriptObject(void *aObject);
NS_IMETHOD GetScriptsEnabled(PRBool *aEnabled);
NS_IMETHOD SetScriptsEnabled(PRBool aEnabled);