From c1e3671c9775f5a0f3b6d7bbb2404d455a744f02 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Thu, 26 Mar 2020 10:49:06 +0000 Subject: [PATCH] Bug 1624810 - Set the multi-zone JS holder flag on appropriate cycle collected classes r=mccr8 Set the flag on the affected classes, which are: - CallbackTimeoutHandler - nsJSArgArray - CallbackObject - Console - MessageEvent - IDBIndexCursor - ExtendableMessageEvent - JSPurpleBuffer Differential Revision: https://phabricator.services.mozilla.com/D68196 --HG-- extra : moz-landing-system : lando --- dom/base/TimeoutHandler.cpp | 2 +- dom/base/nsJSEnvironment.cpp | 2 +- dom/bindings/CallbackObject.cpp | 2 +- dom/console/Console.cpp | 2 +- dom/events/MessageEvent.cpp | 2 +- dom/indexedDB/IDBCursor.cpp | 15 +++++++++++---- dom/script/ModuleLoadRequest.cpp | 2 +- dom/serviceworkers/ServiceWorkerEvents.cpp | 2 +- xpcom/base/nsCycleCollector.cpp | 2 +- 9 files changed, 19 insertions(+), 12 deletions(-) diff --git a/dom/base/TimeoutHandler.cpp b/dom/base/TimeoutHandler.cpp index c43c98573fbc..5fad22a95f91 100644 --- a/dom/base/TimeoutHandler.cpp +++ b/dom/base/TimeoutHandler.cpp @@ -103,7 +103,7 @@ CallbackTimeoutHandler::CallbackTimeoutHandler( mArgs = std::move(aArguments); } -NS_IMPL_CYCLE_COLLECTION_CLASS(CallbackTimeoutHandler) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CallbackTimeoutHandler) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackTimeoutHandler) NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index d8b6cea090f1..5270df0a871b 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2776,7 +2776,7 @@ void nsJSArgArray::ReleaseJSObjects() { } // QueryInterface implementation for nsJSArgArray -NS_IMPL_CYCLE_COLLECTION_CLASS(nsJSArgArray) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(nsJSArgArray) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSArgArray) tmp->ReleaseJSObjects(); diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp index e64b2d567bf6..1e16aca5e362 100644 --- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -32,7 +32,7 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(CallbackObject) NS_IMPL_CYCLE_COLLECTING_RELEASE(CallbackObject) -NS_IMPL_CYCLE_COLLECTION_CLASS(CallbackObject) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(CallbackObject) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackObject) tmp->ClearJSReferences(); diff --git a/dom/console/Console.cpp b/dom/console/Console.cpp index 2083363e8547..d4f02f2f5fff 100644 --- a/dom/console/Console.cpp +++ b/dom/console/Console.cpp @@ -783,7 +783,7 @@ class ConsoleProfileWorkerRunnable final : public ConsoleWorkerRunnable { nsString mAction; }; -NS_IMPL_CYCLE_COLLECTION_CLASS(Console) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(Console) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Console) NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal) diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp index 4e8ae41433ce..b30073b2009f 100644 --- a/dom/events/MessageEvent.cpp +++ b/dom/events/MessageEvent.cpp @@ -17,7 +17,7 @@ namespace mozilla { namespace dom { -NS_IMPL_CYCLE_COLLECTION_CLASS(MessageEvent) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(MessageEvent) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MessageEvent, Event) tmp->mData.setUndefined(); diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index 6e97e6877b37..69651c3d883f 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -812,9 +812,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END // Don't unlink mRequest or mSource in // NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED! -#define NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(_subclassName) \ - NS_IMPL_CYCLE_COLLECTION_CLASS(_subclassName) \ - \ +#define NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS_METHODS(_subclassName) \ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_subclassName, IDBCursor) \ NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSource) \ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \ @@ -830,9 +828,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_ADDREF_INHERITED(_subclassName, IDBCursor) \ NS_IMPL_RELEASE_INHERITED(_subclassName, IDBCursor) +#define NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(_subclassName) \ + NS_IMPL_CYCLE_COLLECTION_CLASS(_subclassName) \ + NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS_METHODS(_subclassName) + +#define NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_MULTI_ZONE_JSHOLDER_SUBCLASS( \ + _subclassName) \ + NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(_subclassName) \ + NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS_METHODS(_subclassName) + NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(IDBObjectStoreCursor) NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(IDBObjectStoreKeyCursor) -NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(IDBIndexCursor) +NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_MULTI_ZONE_JSHOLDER_SUBCLASS(IDBIndexCursor) NS_IMPL_CYCLE_COLLECTION_IDBCURSOR_SUBCLASS(IDBIndexKeyCursor) template diff --git a/dom/script/ModuleLoadRequest.cpp b/dom/script/ModuleLoadRequest.cpp index 5fe3f4077c9f..c2771e6d46a6 100644 --- a/dom/script/ModuleLoadRequest.cpp +++ b/dom/script/ModuleLoadRequest.cpp @@ -21,7 +21,7 @@ namespace dom { NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ModuleLoadRequest) NS_INTERFACE_MAP_END_INHERITING(ScriptLoadRequest) -NS_IMPL_CYCLE_COLLECTION_CLASS(ModuleLoadRequest) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(ModuleLoadRequest) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(ModuleLoadRequest, ScriptLoadRequest) diff --git a/dom/serviceworkers/ServiceWorkerEvents.cpp b/dom/serviceworkers/ServiceWorkerEvents.cpp index e1170c202f32..f0436e93a7e8 100644 --- a/dom/serviceworkers/ServiceWorkerEvents.cpp +++ b/dom/serviceworkers/ServiceWorkerEvents.cpp @@ -1253,7 +1253,7 @@ void ExtendableMessageEvent::GetPorts(nsTArray>& aPorts) { aPorts = mPorts; } -NS_IMPL_CYCLE_COLLECTION_CLASS(ExtendableMessageEvent) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(ExtendableMessageEvent) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(ExtendableMessageEvent, Event) tmp->mData.setUndefined(); diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 721746f0178f..aab573b3ba69 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -2361,7 +2361,7 @@ class JSPurpleBuffer { SegmentedVector mObjects; }; -NS_IMPL_CYCLE_COLLECTION_CLASS(JSPurpleBuffer) +NS_IMPL_CYCLE_COLLECTION_MULTI_ZONE_JSHOLDER_CLASS(JSPurpleBuffer) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(JSPurpleBuffer) tmp->Destroy();