Bug 1492011 assert that ConsoleStructuredCloneData::mGlobal is cleared before ConsoleRunnable destruction r=baku
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 24 Mar 2020 10:02:10 +0000
changeset 520324 4b2314fe45c7756d46ac94dec83a4550fe411139
parent 520323 643c68ed31dd24befb68a2695370e4e7dd9c4a43
child 520325 58d155b0b54abe3fc6ce31261853b37bd2dcb538
push id37247
push userbtara@mozilla.com
push dateWed, 25 Mar 2020 09:34:57 +0000
treeherdermozilla-central@2abd352490a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1492011
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1492011 assert that ConsoleStructuredCloneData::mGlobal is cleared before ConsoleRunnable destruction r=baku Depends on D68000 Differential Revision: https://phabricator.services.mozilla.com/D68001
dom/console/Console.cpp
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -248,16 +248,18 @@ class MainThreadConsoleData final {
   RefPtr<JSObjectHolder> mSandbox;
   nsTArray<nsString> mGroupStack;
 };
 
 // This base class must be extended for Worker and for Worklet.
 class ConsoleRunnable : public StructuredCloneHolderBase {
  public:
   ~ConsoleRunnable() override {
+    MOZ_ASSERT(!mClonedData.mGlobal,
+               "mClonedData.mGlobal is set and cleared in a main thread scope");
     // Clear the StructuredCloneHolderBase class.
     Clear();
   }
 
  protected:
   JSObject* CustomReadHandler(JSContext* aCx, JSStructuredCloneReader* aReader,
                               const JS::CloneDataPolicy& aCloneDataPolicy,
                               uint32_t aTag, uint32_t aIndex) override {