mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 738700 - unmark wrapped gray objects from nsISupports. r=smaug
This commit is contained in:
parent
6b700b5814
commit
a59c979d1b
@ -1110,9 +1110,7 @@ nsFrameMessageManager::MarkForCC()
|
||||
{
|
||||
PRUint32 len = mListeners.Length();
|
||||
for (PRUint32 i = 0; i < len; ++i) {
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wjs =
|
||||
do_QueryInterface(mListeners[i].mListener);
|
||||
xpc_UnmarkGrayObject(wjs);
|
||||
xpc_TryUnmarkWrappedGrayObject(mListeners[i].mListener);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -4585,9 +4585,7 @@ void
|
||||
nsGenericElement::MarkUserDataHandler(void* aObject, nsIAtom* aKey,
|
||||
void* aChild, void* aData)
|
||||
{
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wjs =
|
||||
do_QueryInterface(static_cast<nsISupports*>(aChild));
|
||||
xpc_UnmarkGrayObject(wjs);
|
||||
xpc_TryUnmarkWrappedGrayObject(static_cast<nsISupports*>(aChild));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -201,9 +201,7 @@ private:
|
||||
|
||||
#define NS_UNMARK_LISTENER_WRAPPER(_event) \
|
||||
if (tmp->mOn##_event##Listener) { \
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wjs = \
|
||||
do_QueryInterface(tmp->mOn##_event##Listener->GetInner()); \
|
||||
xpc_UnmarkGrayObject(wjs); \
|
||||
xpc_TryUnmarkWrappedGrayObject(tmp->mOn##_event##Listener->GetInner()); \
|
||||
}
|
||||
|
||||
#endif // nsDOMEventTargetHelper_h_
|
||||
|
@ -1050,8 +1050,7 @@ nsEventListenerManager::UnmarkGrayJSListeners()
|
||||
xpc_UnmarkGrayObject(jsl->GetHandler());
|
||||
xpc_UnmarkGrayObject(jsl->GetEventScope());
|
||||
} else if (ls.mWrappedJS) {
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wjs = do_QueryInterface(ls.mListener);
|
||||
xpc_UnmarkGrayObject(wjs);
|
||||
xpc_TryUnmarkWrappedGrayObject(ls.mListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -860,11 +860,12 @@ xpc_MarkInCCGeneration(nsISupports* aVariant, PRUint32 aGeneration)
|
||||
}
|
||||
|
||||
void
|
||||
xpc_UnmarkGrayObject(nsIXPConnectWrappedJS* aWrappedJS)
|
||||
xpc_TryUnmarkWrappedGrayObject(nsISupports* aWrappedJS)
|
||||
{
|
||||
if (aWrappedJS) {
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wjs = do_QueryInterface(aWrappedJS);
|
||||
if (wjs) {
|
||||
// Unmarks gray JSObject.
|
||||
static_cast<nsXPCWrappedJS*>(aWrappedJS)->GetJSObject();
|
||||
static_cast<nsXPCWrappedJS*>(wjs.get())->GetJSObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@
|
||||
#include "nsTArray.h"
|
||||
|
||||
class nsIPrincipal;
|
||||
class nsIXPConnectWrappedJS;
|
||||
struct nsDOMClassInfoData;
|
||||
|
||||
#ifndef BAD_TLS_INDEX
|
||||
@ -196,9 +195,9 @@ xpc_UnmarkGrayObject(JSObject *obj)
|
||||
extern void
|
||||
xpc_MarkInCCGeneration(nsISupports* aVariant, PRUint32 aGeneration);
|
||||
|
||||
// Unmarks aWrappedJS's JSObject.
|
||||
// If aWrappedJS is a JS wrapper, unmark its JSObject.
|
||||
extern void
|
||||
xpc_UnmarkGrayObject(nsIXPConnectWrappedJS* aWrappedJS);
|
||||
xpc_TryUnmarkWrappedGrayObject(nsISupports* aWrappedJS);
|
||||
|
||||
extern void
|
||||
xpc_UnmarkSkippableJSHolders();
|
||||
|
Loading…
Reference in New Issue
Block a user