summaryrefslogtreecommitdiff
path: root/dom/xhr
diff options
context:
space:
mode:
Diffstat (limited to 'dom/xhr')
-rw-r--r--dom/xhr/XMLHttpRequestMainThread.cpp31
-rw-r--r--dom/xhr/XMLHttpRequestMainThread.h6
2 files changed, 11 insertions, 26 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)
diff --git a/dom/xhr/XMLHttpRequestMainThread.h b/dom/xhr/XMLHttpRequestMainThread.h
index 5f1a729011..4a6eeec2ef 100644
--- a/dom/xhr/XMLHttpRequestMainThread.h
+++ b/dom/xhr/XMLHttpRequestMainThread.h
@@ -525,8 +525,10 @@ public:
void SetRequestObserver(nsIRequestObserver* aObserver);
- NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(XMLHttpRequestMainThread,
- XMLHttpRequest)
+ NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(XMLHttpRequestMainThread,
+ XMLHttpRequest)
+ virtual bool IsCertainlyAliveForCC() const override;
+
bool AllowUploadProgress();
virtual void DisconnectFromOwner() override;