mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 413447 - "nsXBLDocumentInfo can keep closed global window alive". r+sr=sicking, a=blocking1.9.
This commit is contained in:
parent
faedce29c4
commit
5e954a2668
@ -361,12 +361,6 @@ nsXBLPrototypeBinding::Traverse(nsCycleCollectionTraversalCallback &cb) const
|
||||
mInsertionPointTable->Enumerate(TraverseInsertionPoint, &cb);
|
||||
if (mInterfaceTable)
|
||||
mInterfaceTable->Enumerate(TraverseBinding, &cb);
|
||||
|
||||
nsXBLPrototypeHandler* curr = mPrototypeHandler;
|
||||
while (curr) {
|
||||
curr->Traverse(cb);
|
||||
curr = curr->GetNextHandler();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -161,12 +161,6 @@ nsXBLPrototypeHandler::~nsXBLPrototypeHandler()
|
||||
delete mNextHandler;
|
||||
}
|
||||
|
||||
void
|
||||
nsXBLPrototypeHandler::Traverse(nsCycleCollectionTraversalCallback &cb) const
|
||||
{
|
||||
cb.NoteXPCOMChild(mGlobalForCachedHandler);
|
||||
}
|
||||
|
||||
void
|
||||
nsXBLPrototypeHandler::Trace(TraceCallback aCallback, void *aClosure) const
|
||||
{
|
||||
@ -375,12 +369,16 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal,
|
||||
nsScriptObjectHolder &aHandler)
|
||||
{
|
||||
// Check to see if we've already compiled this
|
||||
if (mCachedHandler && mGlobalForCachedHandler == aGlobal) {
|
||||
aHandler.set(mCachedHandler);
|
||||
if (!aHandler)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return NS_OK;
|
||||
if (mCachedHandler) {
|
||||
nsCOMPtr<nsIScriptGlobalObject> cachedGlobal =
|
||||
do_QueryReferent(mGlobalForCachedHandler);
|
||||
if (cachedGlobal == aGlobal) {
|
||||
aHandler.set(mCachedHandler);
|
||||
if (!aHandler)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that we have something to compile
|
||||
@ -401,7 +399,7 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mCachedHandler = aHandler;
|
||||
mGlobalForCachedHandler = aGlobal;
|
||||
mGlobalForCachedHandler = do_GetWeakReference(aGlobal);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -153,7 +153,6 @@ public:
|
||||
return (mType & NS_HANDLER_ALLOW_UNTRUSTED) != 0;
|
||||
}
|
||||
|
||||
void Traverse(nsCycleCollectionTraversalCallback &cb) const;
|
||||
void Trace(TraceCallback aCallback, void *aClosure) const;
|
||||
void Unlink();
|
||||
|
||||
@ -233,7 +232,7 @@ protected:
|
||||
|
||||
// cache a handler to avoid compiling each time
|
||||
void *mCachedHandler;
|
||||
nsCOMPtr<nsIScriptGlobalObject> mGlobalForCachedHandler;
|
||||
nsWeakPtr mGlobalForCachedHandler;
|
||||
|
||||
// Prototype handlers are chained. We own the next handler in the chain.
|
||||
nsXBLPrototypeHandler* mNextHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user