diff options
author | Brian Smith <brian@dbsoft.org> | 2022-08-25 21:59:08 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2022-08-25 21:59:08 -0500 |
commit | d6f18548a664b82489daeebf18fd3051f3edc8ac (patch) | |
tree | 865369a2ddc822f92758edfdb7647348f490b174 /dom/xhr/XMLHttpRequestMainThread.cpp | |
parent | bbc3e455b064320170be03996a87a493f3c18106 (diff) | |
download | uxp-d6f18548a664b82489daeebf18fd3051f3edc8ac.tar.gz |
Issue #1990 - Part 5 - Common up the skippability implementations that are basically copy/pastes of the DOMEventTargetHelper one.
Mozilla Bug Bug 1333540. Skipped the renamed of various functions, but otherwise a direct port.
Diffstat (limited to 'dom/xhr/XMLHttpRequestMainThread.cpp')
-rw-r--r-- | dom/xhr/XMLHttpRequestMainThread.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp index ad999c3584..2c3c3ce295 100644 --- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -310,30 +310,7 @@ XMLHttpRequestMainThread::SetRequestObserver(nsIRequestObserver* aObserver) mRequestObserver = aObserver; } -NS_IMPL_CYCLE_COLLECTION_CLASS(XMLHttpRequestMainThread) - -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(XMLHttpRequestMainThread) - bool isBlack = tmp->IsBlack(); - if (isBlack || tmp->mWaitingForOnStopRequest) { - if (tmp->mListenerManager) { - tmp->mListenerManager->MarkForCC(); - } - if (!isBlack && tmp->PreservingWrapper()) { - // This marks the wrapper black. - tmp->GetWrapper(); - } - return true; - } -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END - -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(XMLHttpRequestMainThread) - return tmp-> - IsBlackAndDoesNotNeedTracing(static_cast<DOMEventTargetHelper*>(tmp)); -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END - -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(XMLHttpRequestMainThread) - return tmp->IsBlack(); -NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END + NS_IMPL_CYCLE_COLLECTION_CLASS(XMLHttpRequestMainThread) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XMLHttpRequestMainThread, XMLHttpRequestEventTarget) @@ -380,6 +357,12 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(XMLHttpRequestMainThread, NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultJSON) NS_IMPL_CYCLE_COLLECTION_TRACE_END +bool +XMLHttpRequestMainThread::IsCertainlyAliveForCC() const +{ + return mWaitingForOnStopRequest; +} + // QueryInterface implementation for XMLHttpRequestMainThread NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(XMLHttpRequestMainThread) NS_INTERFACE_MAP_ENTRY(nsIXMLHttpRequest) |