Bug 1519910 - Rename ChromeBrowsingContext to CanonicalBrowsingContext. r=nika
authorAndreas Farre <farre@mozilla.com>
Tue, 29 Jan 2019 17:32:28 +0000
changeset 455965 de20609039acd48d5cc50932d4355a7679af96ae
parent 455964 905f08f4eab0a91d06092dcf4fea9cb69f090c23
child 455966 d085f7afb20a6718b42e4735c269a1b81f2c0065
push id35465
push usershindli@mozilla.com
push dateWed, 30 Jan 2019 04:10:12 +0000
treeherdermozilla-central@9e919be867b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1519910
milestone67.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 1519910 - Rename ChromeBrowsingContext to CanonicalBrowsingContext. r=nika Differential Revision: https://phabricator.services.mozilla.com/D17957
docshell/base/BrowsingContext.cpp
docshell/base/CanonicalBrowsingContext.cpp
docshell/base/CanonicalBrowsingContext.h
docshell/base/ChromeBrowsingContext.cpp
docshell/base/ChromeBrowsingContext.h
docshell/base/moz.build
dom/base/nsFrameLoader.cpp
dom/chrome-webidl/BrowsingContext.webidl
dom/chrome-webidl/WindowGlobalActors.webidl
dom/ipc/ContentParent.cpp
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/ipc/WindowGlobalParent.cpp
dom/ipc/WindowGlobalParent.h
--- a/docshell/base/BrowsingContext.cpp
+++ b/docshell/base/BrowsingContext.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/BrowsingContext.h"
 
-#include "mozilla/dom/ChromeBrowsingContext.h"
+#include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/BrowsingContextBinding.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/Location.h"
 #include "mozilla/dom/LocationBinding.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "mozilla/dom/WindowProxyHolder.h"
 #include "mozilla/Assertions.h"
@@ -115,18 +115,18 @@ BrowsingContext* BrowsingContext::TopLev
   uint64_t id = nsContentUtils::GenerateBrowsingContextId();
 
   MOZ_LOG(GetLog(), LogLevel::Debug,
           ("Creating 0x%08" PRIx64 " in %s", id,
            XRE_IsParentProcess() ? "Parent" : "Child"));
 
   RefPtr<BrowsingContext> context;
   if (XRE_IsParentProcess()) {
-    context = new ChromeBrowsingContext(aParent, aOpener, aName, id,
-                                        /* aProcessId */ 0, aType);
+    context = new CanonicalBrowsingContext(aParent, aOpener, aName, id,
+                                          /* aProcessId */ 0, aType);
   } else {
     context = new BrowsingContext(aParent, aOpener, aName, id, aType);
   }
 
   Register(context);
 
   // Attach the browsing context to the tree.
   context->Attach();
@@ -142,17 +142,17 @@ BrowsingContext* BrowsingContext::TopLev
   MOZ_DIAGNOSTIC_ASSERT(!aParent || aParent->IsContent());
 
   MOZ_LOG(GetLog(), LogLevel::Debug,
           ("Creating 0x%08" PRIx64 " from IPC (origin=0x%08" PRIx64 ")", aId,
            aOriginProcess ? uint64_t(aOriginProcess->ChildID()) : 0));
 
   RefPtr<BrowsingContext> context;
   if (XRE_IsParentProcess()) {
-    context = new ChromeBrowsingContext(
+    context = new CanonicalBrowsingContext(
         aParent, aOpener, aName, aId, aOriginProcess->ChildID(), Type::Content);
   } else {
     context = new BrowsingContext(aParent, aOpener, aName, aId, Type::Content);
   }
 
   Register(context);
 
   context->Attach();
@@ -375,25 +375,25 @@ void BrowsingContext::ResetUserGestureAc
   mIsActivatedByUserGesture = false;
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(BrowsingContext)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(BrowsingContext)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell, mChildren, mParent)
   if (XRE_IsParentProcess()) {
-    ChromeBrowsingContext::Cast(tmp)->Unlink();
+    CanonicalBrowsingContext::Cast(tmp)->Unlink();
   }
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(BrowsingContext)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocShell, mChildren, mParent)
   if (XRE_IsParentProcess()) {
-    ChromeBrowsingContext::Cast(tmp)->Traverse(cb);
+    CanonicalBrowsingContext::Cast(tmp)->Traverse(cb);
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(BrowsingContext)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(BrowsingContext, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(BrowsingContext, Release)
 
rename from docshell/base/ChromeBrowsingContext.cpp
rename to docshell/base/CanonicalBrowsingContext.cpp
--- a/docshell/base/ChromeBrowsingContext.cpp
+++ b/docshell/base/CanonicalBrowsingContext.cpp
@@ -1,111 +1,113 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "mozilla/dom/ChromeBrowsingContext.h"
+#include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/WindowGlobalParent.h"
 
 namespace mozilla {
 namespace dom {
 
 extern mozilla::LazyLogModule gUserInteractionPRLog;
 
 #define USER_ACTIVATION_LOG(msg, ...) \
   MOZ_LOG(gUserInteractionPRLog, LogLevel::Debug, (msg, ##__VA_ARGS__))
 
-ChromeBrowsingContext::ChromeBrowsingContext(BrowsingContext* aParent,
-                                             BrowsingContext* aOpener,
-                                             const nsAString& aName,
-                                             uint64_t aBrowsingContextId,
-                                             uint64_t aProcessId,
-                                             BrowsingContext::Type aType)
+CanonicalBrowsingContext::CanonicalBrowsingContext(BrowsingContext* aParent,
+                                                 BrowsingContext* aOpener,
+                                                 const nsAString& aName,
+                                                 uint64_t aBrowsingContextId,
+                                                 uint64_t aProcessId,
+                                                 BrowsingContext::Type aType)
     : BrowsingContext(aParent, aOpener, aName, aBrowsingContextId, aType),
       mProcessId(aProcessId) {
-  // You are only ever allowed to create ChromeBrowsingContexts in the
+  // You are only ever allowed to create CanonicalBrowsingContexts in the
   // parent process.
   MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
 }
 
-// TODO(farre): ChromeBrowsingContext::CleanupContexts starts from the
+// TODO(farre): CanonicalBrowsingContext::CleanupContexts starts from the
 // list of root BrowsingContexts. This isn't enough when separate
 // BrowsingContext nodes of a BrowsingContext tree, not in a crashing
 // child process, are from that process and thus needs to be
 // cleaned. [Bug 1472108]
-/* static */ void ChromeBrowsingContext::CleanupContexts(uint64_t aProcessId) {
+/* static */ void CanonicalBrowsingContext::CleanupContexts(
+    uint64_t aProcessId) {
   nsTArray<RefPtr<BrowsingContext>> roots;
   BrowsingContext::GetRootBrowsingContexts(roots);
 
   for (RefPtr<BrowsingContext> context : roots) {
     if (Cast(context)->IsOwnedByProcess(aProcessId)) {
       context->Detach();
     }
   }
 }
 
-/* static */ already_AddRefed<ChromeBrowsingContext> ChromeBrowsingContext::Get(
-    uint64_t aId) {
+/* static */ already_AddRefed<CanonicalBrowsingContext>
+CanonicalBrowsingContext::Get(uint64_t aId) {
   MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
-  return BrowsingContext::Get(aId).downcast<ChromeBrowsingContext>();
+  return BrowsingContext::Get(aId).downcast<CanonicalBrowsingContext>();
 }
 
-/* static */ ChromeBrowsingContext* ChromeBrowsingContext::Cast(
+/* static */ CanonicalBrowsingContext* CanonicalBrowsingContext::Cast(
     BrowsingContext* aContext) {
   MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
-  return static_cast<ChromeBrowsingContext*>(aContext);
+  return static_cast<CanonicalBrowsingContext*>(aContext);
 }
 
-/* static */ const ChromeBrowsingContext* ChromeBrowsingContext::Cast(
+/* static */ const CanonicalBrowsingContext* CanonicalBrowsingContext::Cast(
     const BrowsingContext* aContext) {
   MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
-  return static_cast<const ChromeBrowsingContext*>(aContext);
+  return static_cast<const CanonicalBrowsingContext*>(aContext);
 }
 
-void ChromeBrowsingContext::GetWindowGlobals(
+void CanonicalBrowsingContext::GetWindowGlobals(
     nsTArray<RefPtr<WindowGlobalParent>>& aWindows) {
   aWindows.SetCapacity(mWindowGlobals.Count());
   for (auto iter = mWindowGlobals.Iter(); !iter.Done(); iter.Next()) {
     aWindows.AppendElement(iter.Get()->GetKey());
   }
 }
 
-void ChromeBrowsingContext::RegisterWindowGlobal(WindowGlobalParent* aGlobal) {
+void CanonicalBrowsingContext::RegisterWindowGlobal(
+    WindowGlobalParent* aGlobal) {
   MOZ_ASSERT(!mWindowGlobals.Contains(aGlobal), "Global already registered!");
   mWindowGlobals.PutEntry(aGlobal);
 }
 
-void ChromeBrowsingContext::UnregisterWindowGlobal(
+void CanonicalBrowsingContext::UnregisterWindowGlobal(
     WindowGlobalParent* aGlobal) {
   MOZ_ASSERT(mWindowGlobals.Contains(aGlobal), "Global not registered!");
   mWindowGlobals.RemoveEntry(aGlobal);
 
   // Our current window global should be in our mWindowGlobals set. If it's not
   // anymore, clear that reference.
   if (aGlobal == mCurrentWindowGlobal) {
     mCurrentWindowGlobal = nullptr;
   }
 }
 
-void ChromeBrowsingContext::SetCurrentWindowGlobal(
+void CanonicalBrowsingContext::SetCurrentWindowGlobal(
     WindowGlobalParent* aGlobal) {
   MOZ_ASSERT(mWindowGlobals.Contains(aGlobal), "Global not registered!");
 
   // TODO: This should probably assert that the processes match.
   mCurrentWindowGlobal = aGlobal;
 }
 
-JSObject* ChromeBrowsingContext::WrapObject(JSContext* aCx,
-                                            JS::Handle<JSObject*> aGivenProto) {
-  return ChromeBrowsingContext_Binding::Wrap(aCx, this, aGivenProto);
+JSObject* CanonicalBrowsingContext::WrapObject(
+    JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
+  return CanonicalBrowsingContext_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-void ChromeBrowsingContext::NotifySetUserGestureActivationFromIPC(
+void CanonicalBrowsingContext::NotifySetUserGestureActivationFromIPC(
     bool aIsUserGestureActivation) {
   if (!mCurrentWindowGlobal) {
     return;
   }
 
   if (aIsUserGestureActivation) {
     SetUserGestureActivation();
   } else {
@@ -116,20 +118,20 @@ void ChromeBrowsingContext::NotifySetUse
                       " would notify other browsing contexts for updating "
                       "user gesture activation flag.",
                       Id());
   // XXX(alwu) : we need to sync the flag to other browsing contexts which are
   // not in the same child process where the flag was set. Will implement that
   // in bug1519229.
 }
 
-void ChromeBrowsingContext::Traverse(nsCycleCollectionTraversalCallback& cb) {
-  ChromeBrowsingContext* tmp = this;
+void CanonicalBrowsingContext::Traverse(nsCycleCollectionTraversalCallback& cb) {
+  CanonicalBrowsingContext* tmp = this;
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindowGlobals);
 }
 
-void ChromeBrowsingContext::Unlink() {
-  ChromeBrowsingContext* tmp = this;
+void CanonicalBrowsingContext::Unlink() {
+  CanonicalBrowsingContext* tmp = this;
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindowGlobals);
 }
 
 }  // namespace dom
 }  // namespace mozilla
rename from docshell/base/ChromeBrowsingContext.h
rename to docshell/base/CanonicalBrowsingContext.h
--- a/docshell/base/ChromeBrowsingContext.h
+++ b/docshell/base/CanonicalBrowsingContext.h
@@ -1,40 +1,40 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_ChromeBrowsingContext_h
-#define mozilla_dom_ChromeBrowsingContext_h
+#ifndef mozilla_dom_CanonicalBrowsingContext_h
+#define mozilla_dom_CanonicalBrowsingContext_h
 
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/RefPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "nsTHashtable.h"
 #include "nsHashKeys.h"
 
 class nsIDocShell;
 
 namespace mozilla {
 namespace dom {
 
 class WindowGlobalParent;
 
-// ChromeBrowsingContext is a BrowsingContext living in the parent
+// CanonicalBrowsingContext is a BrowsingContext living in the parent
 // process, with whatever extra data that a BrowsingContext in the
 // parent needs.
-class ChromeBrowsingContext final : public BrowsingContext {
+class CanonicalBrowsingContext final : public BrowsingContext {
  public:
   static void CleanupContexts(uint64_t aProcessId);
-  static already_AddRefed<ChromeBrowsingContext> Get(uint64_t aId);
-  static ChromeBrowsingContext* Cast(BrowsingContext* aContext);
-  static const ChromeBrowsingContext* Cast(const BrowsingContext* aContext);
+  static already_AddRefed<CanonicalBrowsingContext> Get(uint64_t aId);
+  static CanonicalBrowsingContext* Cast(BrowsingContext* aContext);
+  static const CanonicalBrowsingContext* Cast(const BrowsingContext* aContext);
 
   bool IsOwnedByProcess(uint64_t aProcessId) const {
     return mProcessId == aProcessId;
   }
   uint64_t OwnerProcessId() const { return mProcessId; }
 
   void GetWindowGlobals(nsTArray<RefPtr<WindowGlobalParent>>& aWindows);
 
@@ -58,28 +58,28 @@ class ChromeBrowsingContext final : publ
   // function)
   void NotifySetUserGestureActivationFromIPC(bool aIsUserGestureActivation);
 
  protected:
   void Traverse(nsCycleCollectionTraversalCallback& cb);
   void Unlink();
 
   using Type = BrowsingContext::Type;
-  ChromeBrowsingContext(BrowsingContext* aParent, BrowsingContext* aOpener,
-                        const nsAString& aName, uint64_t aBrowsingContextId,
-                        uint64_t aProcessId, Type aType = Type::Chrome);
+  CanonicalBrowsingContext(BrowsingContext* aParent, BrowsingContext* aOpener,
+                          const nsAString& aName, uint64_t aBrowsingContextId,
+                          uint64_t aProcessId, Type aType = Type::Chrome);
 
  private:
   friend class BrowsingContext;
 
   // XXX(farre): Store a ContentParent pointer here rather than mProcessId?
   // Indicates which process owns the docshell.
   uint64_t mProcessId;
 
   // All live window globals within this browsing context.
   nsTHashtable<nsRefPtrHashKey<WindowGlobalParent>> mWindowGlobals;
   RefPtr<WindowGlobalParent> mCurrentWindowGlobal;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
-#endif  // !defined(mozilla_dom_ChromeBrowsingContext_h)
+#endif  // !defined(mozilla_dom_CanonicalBrowsingContext_h)
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -72,24 +72,24 @@ EXPORTS += [
 
 EXPORTS.mozilla += [
     'IHistory.h',
     'LoadContext.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'BrowsingContext.h',
+    'CanonicalBrowsingContext.h',
     'ChildProcessChannelListener.h',
-    'ChromeBrowsingContext.h'
 ]
 
 UNIFIED_SOURCES += [
     'BrowsingContext.cpp',
+    'CanonicalBrowsingContext.cpp',
     'ChildProcessChannelListener.cpp',
-    'ChromeBrowsingContext.cpp',
     'LoadContext.cpp',
     'nsAboutRedirector.cpp',
     'nsDefaultURIFixup.cpp',
     'nsDocShell.cpp',
     'nsDocShellEditorData.cpp',
     'nsDocShellEnumerator.cpp',
     'nsDocShellLoadState.cpp',
     'nsDocShellTreeOwner.cpp',
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -95,17 +95,17 @@
 #include "mozilla/dom/CustomEvent.h"
 
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/WebBrowserPersistLocalDocument.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/ParentSHistory.h"
 #include "mozilla/dom/ChildSHistory.h"
-#include "mozilla/dom/ChromeBrowsingContext.h"
+#include "mozilla/dom/CanonicalBrowsingContext.h"
 
 #include "mozilla/dom/HTMLBodyElement.h"
 
 #include "mozilla/ContentPrincipal.h"
 
 #ifdef XP_WIN
 #  include "mozilla/plugins/PPluginWidgetParent.h"
 #  include "../plugins/ipc/PluginWidgetParent.h"
--- a/dom/chrome-webidl/BrowsingContext.webidl
+++ b/dom/chrome-webidl/BrowsingContext.webidl
@@ -14,13 +14,13 @@ interface BrowsingContext {
   readonly attribute nsIDocShell? docShell;
 
   readonly attribute unsigned long long id;
 
   readonly attribute BrowsingContext? opener;
 };
 
 [Exposed=Window, ChromeOnly]
-interface ChromeBrowsingContext : BrowsingContext {
+interface CanonicalBrowsingContext : BrowsingContext {
   sequence<WindowGlobalParent> getWindowGlobals();
 
   readonly attribute WindowGlobalParent? currentWindowGlobal;
 };
--- a/dom/chrome-webidl/WindowGlobalActors.webidl
+++ b/dom/chrome-webidl/WindowGlobalActors.webidl
@@ -6,17 +6,17 @@
 interface Principal;
 interface URI;
 interface nsIDocShell;
 
 [Exposed=Window, ChromeOnly]
 interface WindowGlobalParent {
   readonly attribute boolean isClosed;
   readonly attribute boolean isInProcess;
-  readonly attribute ChromeBrowsingContext browsingContext;
+  readonly attribute CanonicalBrowsingContext browsingContext;
 
   readonly attribute boolean isCurrentGlobal;
 
   readonly attribute unsigned long long innerWindowId;
   readonly attribute unsigned long long outerWindowId;
 
   readonly attribute FrameLoader? rootFrameLoader; // Embedded (browser) only
 
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -33,17 +33,17 @@
 #include "mozilla/AntiTrackingCommon.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/DataStorage.h"
 #include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
 #include "mozilla/docshell/OfflineCacheUpdateParent.h"
 #include "mozilla/dom/BrowsingContext.h"
-#include "mozilla/dom/ChromeBrowsingContext.h"
+#include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/ClientManager.h"
 #include "mozilla/dom/ClientOpenWindowOpActors.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FileCreatorHelper.h"
 #include "mozilla/dom/FileSystemSecurity.h"
 #include "mozilla/dom/IPCBlobUtils.h"
@@ -1746,17 +1746,17 @@ void ContentParent::ActorDestroy(ActorDe
   }
 
   mBlobURLs.Clear();
 
 #if defined(XP_WIN32) && defined(ACCESSIBILITY)
   a11y::AccessibleWrap::ReleaseContentProcessIdFor(ChildID());
 #endif
 
-  ChromeBrowsingContext::CleanupContexts(ChildID());
+  CanonicalBrowsingContext::CleanupContexts(ChildID());
 }
 
 bool ContentParent::TryToRecycle() {
   // This life time check should be replaced by a memory health check (memory
   // usage + fragmentation).
   const double kMaxLifeSpan = 5;
   if (mShutdownPending || mCalledKillHard || !IsAlive() ||
       !mRemoteType.EqualsLiteral(DEFAULT_REMOTE_TYPE) ||
@@ -5582,17 +5582,18 @@ mozilla::ipc::IPCResult ContentParent::R
     const Principal& aPrincipal) {
   AntiTrackingCommon::StoreUserInteractionFor(aPrincipal);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvAttachBrowsingContext(
     const BrowsingContextId& aParentId, const BrowsingContextId& aOpenerId,
     const BrowsingContextId& aChildId, const nsString& aName) {
-  RefPtr<ChromeBrowsingContext> parent = ChromeBrowsingContext::Get(aParentId);
+  RefPtr<CanonicalBrowsingContext> parent =
+      CanonicalBrowsingContext::Get(aParentId);
   if (aParentId && !parent) {
     // Unless 'aParentId' is 0 (which it is when the child is a root
     // BrowsingContext) there should always be a corresponding
     // 'parent'. The only reason for there not beeing one is if the
     // parent has already been detached, in which case the
     // BrowsingContext that tries to attach itself to the context with
     // 'aParentId' is surely doomed and we can safely do nothing.
 
@@ -5648,18 +5649,18 @@ mozilla::ipc::IPCResult ContentParent::R
                                            (uint64_t)aChildId, this);
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvDetachBrowsingContext(
     const BrowsingContextId& aContextId, const bool& aMoveToBFCache) {
-  RefPtr<ChromeBrowsingContext> context =
-      ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> context =
+      CanonicalBrowsingContext::Get(aContextId);
 
   if (!context) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to detach already detached 0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
@@ -5684,18 +5685,18 @@ mozilla::ipc::IPCResult ContentParent::R
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvSetOpenerBrowsingContext(
     const BrowsingContextId& aContextId,
     const BrowsingContextId& aOpenerContextId) {
-  RefPtr<ChromeBrowsingContext> context =
-      ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> context =
+      CanonicalBrowsingContext::Get(aContextId);
 
   if (!context) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to set opener already detached 0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
@@ -5717,18 +5718,18 @@ mozilla::ipc::IPCResult ContentParent::R
   RefPtr<BrowsingContext> opener = BrowsingContext::Get(aOpenerContextId);
   context->SetOpener(opener);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvSetUserGestureActivation(
     const BrowsingContextId& aContextId, const bool& aNewValue) {
-  RefPtr<ChromeBrowsingContext> context =
-      ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> context =
+      CanonicalBrowsingContext::Get(aContextId);
 
   if (!context) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to activate wrong context 0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
@@ -5753,17 +5754,17 @@ void ContentParent::UnregisterRemoveWork
     MessageLoop::current()->PostTask(NewRunnableMethod<ShutDownMethod>(
         "dom::ContentParent::ShutDownProcess", this,
         &ContentParent::ShutDownProcess, SEND_SHUTDOWN_MESSAGE));
   }
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvWindowClose(
     const BrowsingContextId& aContextId, const bool& aTrustedCaller) {
-  RefPtr<ChromeBrowsingContext> bc = ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> bc = CanonicalBrowsingContext::Get(aContextId);
   if (!bc) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to send a message to dead or detached context "
              "0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
@@ -5775,17 +5776,17 @@ mozilla::ipc::IPCResult ContentParent::R
   ContentParent* cp =
       cpm->GetContentProcessById(ContentParentId(bc->OwnerProcessId()));
   Unused << cp->SendWindowClose(aContextId, aTrustedCaller);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvWindowFocus(
     const BrowsingContextId& aContextId) {
-  RefPtr<ChromeBrowsingContext> bc = ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> bc = CanonicalBrowsingContext::Get(aContextId);
   if (!bc) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to send a message to dead or detached context "
              "0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
@@ -5793,17 +5794,17 @@ mozilla::ipc::IPCResult ContentParent::R
   ContentParent* cp =
       cpm->GetContentProcessById(ContentParentId(bc->OwnerProcessId()));
   Unused << cp->SendWindowFocus(aContextId);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvWindowBlur(
     const BrowsingContextId& aContextId) {
-  RefPtr<ChromeBrowsingContext> bc = ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> bc = CanonicalBrowsingContext::Get(aContextId);
   if (!bc) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to send a message to dead or detached context "
              "0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
@@ -5812,17 +5813,17 @@ mozilla::ipc::IPCResult ContentParent::R
       cpm->GetContentProcessById(ContentParentId(bc->OwnerProcessId()));
   Unused << cp->SendWindowBlur(aContextId);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvWindowPostMessage(
     const BrowsingContextId& aContextId, const ClonedMessageData& aMessage,
     const PostMessageData& aData) {
-  RefPtr<ChromeBrowsingContext> bc = ChromeBrowsingContext::Get(aContextId);
+  RefPtr<CanonicalBrowsingContext> bc = CanonicalBrowsingContext::Get(aContextId);
   if (!bc) {
     MOZ_LOG(BrowsingContext::GetLog(), LogLevel::Debug,
             ("ParentIPC: Trying to send a message to dead or detached context "
              "0x%08" PRIx64,
              (uint64_t)aContextId));
     return IPC_OK();
   }
 
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -97,17 +97,17 @@
 #include "UnitTransforms.h"
 #include <algorithm>
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/WebBrowserPersistDocumentParent.h"
 #include "ProcessPriorityManager.h"
 #include "nsString.h"
 #include "IHistory.h"
 #include "mozilla/dom/WindowGlobalParent.h"
-#include "mozilla/dom/ChromeBrowsingContext.h"
+#include "mozilla/dom/CanonicalBrowsingContext.h"
 
 #ifdef XP_WIN
 #  include "mozilla/plugins/PluginWidgetParent.h"
 #endif
 
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
 #  include "mozilla/a11y/AccessibleWrap.h"
 #  include "mozilla/a11y/Compatibility.h"
@@ -1626,18 +1626,17 @@ mozilla::ipc::IPCResult TabParent::RecvA
   CrossProcessCpowHolder cpows(Manager(), aCpows);
   if (!ReceiveMessage(aMessage, false, &data, &cpows, aPrincipal, nullptr)) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult TabParent::RecvSetCursor(
-    const nsCursor& aCursor,
-    const bool& aHasCustomCursor,
+    const nsCursor& aCursor, const bool& aHasCustomCursor,
     const nsCString& aCursorData, const uint32_t& aWidth,
     const uint32_t& aHeight, const uint32_t& aStride,
     const gfx::SurfaceFormat& aFormat, const uint32_t& aHotspotX,
     const uint32_t& aHotspotY, const bool& aForce) {
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return IPC_OK();
   }
@@ -3428,17 +3427,17 @@ mozilla::ipc::IPCResult TabParent::RecvG
     widget->GetSystemFont(*aFontName);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult TabParent::RecvRootBrowsingContext(
     const BrowsingContextId& aId) {
   MOZ_ASSERT(!mBrowsingContext, "May only set browsing context once!");
-  mBrowsingContext = ChromeBrowsingContext::Get(aId);
+  mBrowsingContext = CanonicalBrowsingContext::Get(aId);
   MOZ_ASSERT(mBrowsingContext, "Invalid ID!");
   return IPC_OK();
 }
 
 NS_IMETHODIMP
 FakeChannel::OnAuthAvailable(nsISupports* aContext,
                              nsIAuthInformation* aAuthInfo) {
   nsAuthInformationHolder* holder =
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -62,17 +62,17 @@ struct IMENotification;
 
 namespace gfx {
 class SourceSurface;
 class DataSourceSurface;
 }  // namespace gfx
 
 namespace dom {
 
-class ChromeBrowsingContext;
+class CanonicalBrowsingContext;
 class ClonedMessageData;
 class nsIContentParent;
 class Element;
 class DataTransfer;
 
 namespace ipc {
 class StructuredCloneData;
 }  // namespace ipc
@@ -121,17 +121,17 @@ class TabParent final : public PBrowserP
   }
 
   already_AddRefed<nsILoadContext> GetLoadContext();
 
   already_AddRefed<nsIWidget> GetTopLevelWidget();
 
   nsIXULBrowserWindow* GetXULBrowserWindow();
 
-  ChromeBrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
+  CanonicalBrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
 
   void Destroy();
 
   void RemoveWindowListeners();
 
   void AddWindowListeners();
 
   virtual mozilla::ipc::IPCResult RecvMoveFocus(
@@ -672,17 +672,17 @@ class TabParent final : public PBrowserP
   nsCOMPtr<nsILoadContext> mLoadContext;
 
   // We keep a strong reference to the frameloader after we've sent the
   // Destroy message and before we've received __delete__. This allows us to
   // dispatch message manager messages during this time.
   RefPtr<nsFrameLoader> mFrameLoader;
 
   // The root browsing context loaded in this TabParent.
-  RefPtr<ChromeBrowsingContext> mBrowsingContext;
+  RefPtr<CanonicalBrowsingContext> mBrowsingContext;
 
   TabId mTabId;
 
   // When loading a new tab or window via window.open, the child is
   // responsible for loading the URL it wants into the new TabChild. When the
   // parent receives the CreateWindow message, though, it sends a LoadURL
   // message, usually for about:blank. It's important for the about:blank load
   // to get processed because the Firefox frontend expects every new window to
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/WindowGlobalParent.h"
 #include "mozilla/ipc/InProcessParent.h"
-#include "mozilla/dom/ChromeBrowsingContext.h"
+#include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/WindowGlobalActorsBinding.h"
 #include "mozilla/dom/ChromeUtils.h"
 #include "mozJSComponentLoader.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 
 #include "mozilla/dom/JSWindowActorBinding.h"
 #include "mozilla/dom/JSWindowActorParent.h"
@@ -58,17 +58,17 @@ void WindowGlobalParent::Init(const Wind
   entry.OrInsert([&] { return this; });
 
   // Determine which content process the window global is coming from.
   ContentParentId processId(0);
   if (!mInProcess) {
     processId = static_cast<ContentParent*>(Manager()->Manager())->ChildID();
   }
 
-  mBrowsingContext = ChromeBrowsingContext::Get(aInit.browsingContextId());
+  mBrowsingContext = CanonicalBrowsingContext::Get(aInit.browsingContextId());
   MOZ_ASSERT(mBrowsingContext);
 
   // XXX(nika): This won't be the case soon, but for now this is a good
   // assertion as we can't switch processes. We should relax this eventually.
   MOZ_ASSERT(mBrowsingContext->IsOwnedByProcess(processId));
 
   // Attach ourself to the browsing context.
   mBrowsingContext->RegisterWindowGlobal(this);
--- a/dom/ipc/WindowGlobalParent.h
+++ b/dom/ipc/WindowGlobalParent.h
@@ -14,17 +14,17 @@
 
 class nsIPrincipal;
 class nsIURI;
 class nsFrameLoader;
 
 namespace mozilla {
 namespace dom {
 
-class ChromeBrowsingContext;
+class CanonicalBrowsingContext;
 class WindowGlobalChild;
 class JSWindowActorParent;
 
 /**
  * A handle in the parent process to a specific nsGlobalWindowInner object.
  */
 class WindowGlobalParent final : public nsISupports,
                                  public nsWrapperCache,
@@ -61,17 +61,17 @@ class WindowGlobalParent final : public 
   already_AddRefed<TabParent> GetTabParent();
 
   // The principal of this WindowGlobal. This value will not change over the
   // lifetime of the WindowGlobal object, even to reflect changes in
   // |document.domain|.
   nsIPrincipal* DocumentPrincipal() { return mDocumentPrincipal; }
 
   // The BrowsingContext which this WindowGlobal has been loaded into.
-  ChromeBrowsingContext* BrowsingContext() { return mBrowsingContext; }
+  CanonicalBrowsingContext* BrowsingContext() { return mBrowsingContext; }
 
   // Get the root nsFrameLoader object for the tree of BrowsingContext nodes
   // which this WindowGlobal is a part of. This will be the nsFrameLoader
   // holding the TabParent for remote tabs, and the root content frameloader for
   // non-remote tabs.
   nsFrameLoader* GetRootFrameLoader() { return mFrameLoader; }
 
   // The current URI which loaded in the document.
@@ -106,17 +106,17 @@ class WindowGlobalParent final : public 
  private:
   ~WindowGlobalParent();
 
   // NOTE: This document principal doesn't reflect possible |document.domain|
   // mutations which may have been made in the actual document.
   nsCOMPtr<nsIPrincipal> mDocumentPrincipal;
   nsCOMPtr<nsIURI> mDocumentURI;
   RefPtr<nsFrameLoader> mFrameLoader;
-  RefPtr<ChromeBrowsingContext> mBrowsingContext;
+  RefPtr<CanonicalBrowsingContext> mBrowsingContext;
   nsRefPtrHashtable<nsStringHashKey, JSWindowActorParent> mWindowActors;
   uint64_t mInnerWindowId;
   uint64_t mOuterWindowId;
   bool mInProcess;
   bool mIPCClosed;
 };
 
 }  // namespace dom