Bug 1540839 - Assert on browsing context creation in chrome; r=nika
authorKyle Machulis <kyle@nonpolynomial.com>
Mon, 06 May 2019 16:26:57 -0700
changeset 532668 66e1bbe3436b8bf7fafad5055d79a00071c716eb
parent 532667 5159fa6d6d40f136411f1a98b79f0e96bfd9fedd
child 532669 40acaa39dc45c973d2eebc47aab8f5f94f2397e3
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1540839
milestone68.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 1540839 - Assert on browsing context creation in chrome; r=nika We shouldn't be creating browsing contexts in chrome. Add assertion (behind pref that guards the rest of this patch set) to make sure that doesn't happen. Differential Revision: https://phabricator.services.mozilla.com/D30561
docshell/base/BrowsingContext.h
--- a/docshell/base/BrowsingContext.h
+++ b/docshell/base/BrowsingContext.h
@@ -343,16 +343,17 @@ class BrowsingContext : public nsWrapper
     // Include each field, skipping mOpener, as we want to handle it
     // separately.
 #define MOZ_BC_FIELD(name, type) type m##name;
 #include "mozilla/dom/BrowsingContextFieldList.h"
   };
 
   // Create an IPCInitializer object for this BrowsingContext.
   IPCInitializer GetIPCInitializer() {
+    MOZ_ASSERT(IsContent());
     IPCInitializer init;
     init.mId = Id();
     init.mParentId = mParent ? mParent->Id() : 0;
     init.mCached = IsCached();
 
 #define MOZ_BC_FIELD(name, type) init.m##name = m##name;
 #include "mozilla/dom/BrowsingContextFieldList.h"
     return init;