Bug 1238160 - Rename TabContext::IsBrowserElement. r=billm,mayhemer draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Sat, 06 Feb 2016 00:40:51 -0600
changeset 330587 3484f8458853b51318e86e110f33fd497b98fd74
parent 330586 dee4158588a046c4c6dcfb4a48c8cfcc0fbef766
child 330588 bf8abbabb58fb680cfad1bf0bcaed78e5d9e5d6a
push id10774
push userbmo:jryans@gmail.com
push dateThu, 11 Feb 2016 23:52:47 +0000
reviewersbillm, mayhemer
bugs1238160
milestone47.0a1
Bug 1238160 - Rename TabContext::IsBrowserElement. r=billm,mayhemer This change renames TabContext::IsBrowserElement to add "Isolated". Other methods that pass these values around also have name changes. No behavior changes are made in this patch, so some renamed methods may have have nonsensical implementations. These are corrected in subsequent patches focused on behavior. MozReview-Commit-ID: 3rss1Q9nNhu
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/PTabContext.ipdlh
dom/ipc/TabChild.cpp
dom/ipc/TabContext.cpp
dom/ipc/TabContext.h
dom/ipc/nsIContentParent.cpp
dom/network/TCPServerSocket.cpp
dom/network/TCPServerSocketParent.cpp
dom/network/TCPServerSocketParent.h
dom/network/TCPSocket.cpp
dom/network/TCPSocket.h
dom/network/TCPSocketParent.cpp
dom/network/TCPSocketParent.h
dom/workers/ServiceWorkerManagerService.cpp
netwerk/ipc/NeckoParent.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -798,17 +798,17 @@ ContentChild::ProvideWindowCommon(TabChi
 
   nsAutoPtr<IPCTabContext> ipcContext;
   TabId openerTabId = TabId(0);
 
   if (aTabOpener) {
     PopupIPCTabContext context;
     openerTabId = aTabOpener->GetTabId();
     context.opener() = openerTabId;
-    context.isBrowserElement() = aTabOpener->IsBrowserElement();
+    context.isIsolatedBrowserElement() = aTabOpener->IsIsolatedBrowserElement();
     ipcContext = new IPCTabContext(context);
   } else {
     // It's possible to not have a TabChild opener in the case
     // of ServiceWorker::OpenWindow.
     UnsafeIPCTabContext unsafeTabContext;
     ipcContext = new IPCTabContext(unsafeTabContext);
   }
 
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1253,29 +1253,29 @@ ContentParent::CreateBrowserOrApp(const 
   TabId tabId;
 
   nsIDocShell* docShell = GetOpenerDocShellHelper(aFrameElement);
   TabId openerTabId;
   if (docShell) {
     openerTabId = TabParent::GetTabIdFrom(docShell);
   }
 
-  if (aContext.IsBrowserElement() || !aContext.HasOwnApp()) {
+  if (aContext.IsIsolatedBrowserElement() || !aContext.HasOwnApp()) {
     RefPtr<TabParent> tp;
     RefPtr<nsIContentParent> constructorSender;
     if (isInContentProcess) {
-      MOZ_ASSERT(aContext.IsBrowserElement());
+      MOZ_ASSERT(aContext.IsIsolatedBrowserElement());
       constructorSender = CreateContentBridgeParent(aContext, initialPriority,
                                                     openerTabId, &tabId);
     } else {
       if (aOpenerContentParent) {
         constructorSender = aOpenerContentParent;
       } else {
         constructorSender =
-          GetNewOrUsedBrowserProcess(aContext.IsBrowserElement(),
+          GetNewOrUsedBrowserProcess(aContext.IsIsolatedBrowserElement(),
                                      initialPriority);
         if (!constructorSender) {
           return nullptr;
         }
       }
       tabId = AllocateTabId(openerTabId,
                             aContext.AsIPCTabContext(),
                            constructorSender->ChildID());
--- a/dom/ipc/PTabContext.ipdlh
+++ b/dom/ipc/PTabContext.ipdlh
@@ -8,30 +8,30 @@ include protocol PBrowser;
 include PBrowserOrId;
 
 namespace mozilla {
 namespace dom {
 
 // An IPCTabContext which corresponds to a PBrowser opened by a child when it
 // receives window.open().
 //
-// If isBrowserElement is false, this PopupIPCTabContext corresponds to an app
-// frame, and the frame's app-id and app-frame-owner-app-id will be equal to the
-// opener's values.
+// If isIsolatedBrowserElement is false, this PopupIPCTabContext corresponds to
+// an app frame, and the frame's app-id and app-frame-owner-app-id will be equal
+// to the opener's values.
 //
-// If isBrowserElement is true, the frame's browserFrameOwnerAppId will be equal
-// to the opener's app-id.
+// If isIsolatedBrowserElement is true, the frame's browserFrameOwnerAppId will
+// be equal to the opener's app-id.
 //
-// It's an error to set isBrowserElement == false if opener is a browser
+// It's an error to set isIsolatedBrowserElement == false if opener is a browser
 // element.  Such a PopupIPCTabContext should be rejected by code which receives
 // it.
 struct PopupIPCTabContext
 {
   PBrowserOrId opener;
-  bool isBrowserElement;
+  bool isIsolatedBrowserElement;
 };
 
 // An IPCTabContext which corresponds to an app, browser, or normal frame.
 struct FrameIPCTabContext
 {
   // The stringified originAttributes dictionary.
   nsCString originSuffix;
 
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -825,17 +825,17 @@ void
 TabChild::NotifyTabContextUpdated()
 {
     nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
     MOZ_ASSERT(docShell);
 
     if (docShell) {
         // nsDocShell will do the right thing if we pass NO_APP_ID or
         // UNKNOWN_APP_ID for aOwnOrContainingAppId.
-        if (IsBrowserElement()) {
+        if (IsIsolatedBrowserElement()) {
           docShell->SetIsBrowserInsideApp(BrowserOwnerAppId());
         } else {
           docShell->SetIsApp(OwnAppId());
         }
 
         OriginAttributes attrs = OriginAttributesRef();
         docShell->SetIsSignedPackage(attrs.mSignedPkg);
         docShell->SetUserContextId(attrs.mUserContextId);
@@ -1500,17 +1500,17 @@ TabChild::ApplyShowInfo(const ShowInfo& 
 }
 
 #ifdef MOZ_WIDGET_GONK
 void
 TabChild::MaybeRequestPreinitCamera()
 {
     // Check if this tab is an app (not a browser frame) and will use the
     // `camera` permission,
-    if (IsBrowserElement()) {
+    if (IsIsolatedBrowserElement()) {
       return;
     }
 
     nsCOMPtr<nsIAppsService> appsService = do_GetService("@mozilla.org/AppsService;1");
     if (NS_WARN_IF(!appsService)) {
       return;
     }
 
--- a/dom/ipc/TabContext.cpp
+++ b/dom/ipc/TabContext.cpp
@@ -23,25 +23,25 @@ namespace dom {
 TabContext::TabContext()
   : mInitialized(false)
   , mContainingAppId(NO_APP_ID)
   , mOriginAttributes()
 {
 }
 
 bool
-TabContext::IsBrowserElement() const
+TabContext::IsIsolatedBrowserElement() const
 {
   return mOriginAttributes.mInIsolatedBrowser;
 }
 
 bool
 TabContext::IsBrowserOrApp() const
 {
-  return HasOwnApp() || IsBrowserElement();
+  return HasOwnApp() || IsIsolatedBrowserElement();
 }
 
 uint32_t
 TabContext::OwnAppId() const
 {
   return mOriginAttributes.mAppId;
 }
 
@@ -57,27 +57,27 @@ TabContext::HasOwnApp() const
 {
   nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
   return !!ownApp;
 }
 
 uint32_t
 TabContext::BrowserOwnerAppId() const
 {
-  if (IsBrowserElement()) {
+  if (IsIsolatedBrowserElement()) {
     return mContainingAppId;
   }
   return NO_APP_ID;
 }
 
 already_AddRefed<mozIApplication>
 TabContext::GetBrowserOwnerApp() const
 {
   nsCOMPtr<mozIApplication> ownerApp;
-  if (IsBrowserElement()) {
+  if (IsIsolatedBrowserElement()) {
     ownerApp = mContainingApp;
   }
   return ownerApp.forget();
 }
 
 bool
 TabContext::HasBrowserOwnerApp() const
 {
@@ -234,17 +234,18 @@ MaybeInvalidTabContext::MaybeInvalidTabC
 
   switch(aParams.type()) {
     case IPCTabContext::TPopupIPCTabContext: {
       const PopupIPCTabContext &ipcContext = aParams.get_PopupIPCTabContext();
 
       TabContext *context;
       if (ipcContext.opener().type() == PBrowserOrId::TPBrowserParent) {
         context = TabParent::GetFrom(ipcContext.opener().get_PBrowserParent());
-        if (context->IsBrowserElement() && !ipcContext.isBrowserElement()) {
+        if (context->IsIsolatedBrowserElement() &&
+            !ipcContext.isIsolatedBrowserElement()) {
           // If the TabParent corresponds to a browser element, then it can only
           // open other browser elements, for security reasons.  We should have
           // checked this before calling the TabContext constructor, so this is
           // a fatal error.
           mInvalidReason = "Child is-browser process tried to "
                            "open a non-browser tab.";
           return;
         }
@@ -265,17 +266,17 @@ MaybeInvalidTabContext::MaybeInvalidTabC
       // Browser elements can't nest other browser elements.  So if
       // our opener is browser element, we must be a new DOM window
       // opened by it.  In that case we inherit our containing app ID
       // (if any).
       //
       // Otherwise, we're a new app window and we inherit from our
       // opener app.
       originAttributes = context->mOriginAttributes;
-      if (ipcContext.isBrowserElement()) {
+      if (ipcContext.isIsolatedBrowserElement()) {
         containingAppId = context->OwnOrContainingAppId();
       } else {
         containingAppId = context->mContainingAppId;
       }
       break;
     }
     case IPCTabContext::TFrameIPCTabContext: {
       const FrameIPCTabContext &ipcContext =
--- a/dom/ipc/TabContext.h
+++ b/dom/ipc/TabContext.h
@@ -37,48 +37,52 @@ public:
 
   /**
    * Generates IPCTabContext of type BrowserFrameIPCTabContext or
    * AppFrameIPCTabContext from this TabContext's information.
    */
   IPCTabContext AsIPCTabContext() const;
 
   /**
-   * Does this TabContext correspond to a mozbrowser?  (<iframe mozbrowser
-   * mozapp> is not a browser.)
+   * Does this TabContext correspond to a mozbrowser?
    *
-   * If IsBrowserElement() is true, HasOwnApp() and HasAppOwnerApp() are
+   * <iframe mozbrowser mozapp> does not count as a browser element.
+   * <iframe mozbrowser isolated="false"> does not count as isolated since
+   * isolation is disabled.  Isolation can only be disabled by chrome pages.
+   *
+   * If IsIsolatedBrowserElement() is true, HasOwnApp() and HasAppOwnerApp() are
    * guaranteed to be false.
    *
-   * If IsBrowserElement() is false, HasBrowserOwnerApp() is guaranteed to be
-   * false.
+   * If IsIsolatedBrowserElement() is false, HasBrowserOwnerApp() is guaranteed
+   * to be false.
    */
-  bool IsBrowserElement() const;
+  bool IsIsolatedBrowserElement() const;
 
   /**
    * Does this TabContext correspond to a mozbrowser or mozapp?  This is
-   * equivalent to IsBrowserElement() || HasOwnApp().
+   * equivalent to IsIsolatedBrowserElement() || HasOwnApp().
    */
   bool IsBrowserOrApp() const;
 
   /**
    * OwnAppId() returns the id of the app which directly corresponds to this
    * context's frame.  GetOwnApp() returns the corresponding app object, and
    * HasOwnApp() returns true iff GetOwnApp() would return a non-null value.
    *
-   * If HasOwnApp() is true, IsBrowserElement() is guaranteed to be false.
+   * If HasOwnApp() is true, IsIsolatedBrowserElement() is guaranteed to be
+   * false.
    */
   uint32_t OwnAppId() const;
   already_AddRefed<mozIApplication> GetOwnApp() const;
   bool HasOwnApp() const;
 
   /**
    * BrowserOwnerAppId() gets the ID of the app which contains this browser
-   * frame.  If this is not a browser frame (i.e., if !IsBrowserElement()), then
-   * BrowserOwnerAppId() is guaranteed to return NO_APP_ID.
+   * frame.  If this is not a browser frame (if !IsIsolatedBrowserElement()),
+   * then BrowserOwnerAppId() is guaranteed to return NO_APP_ID.
    *
    * Even if we are a browser frame, BrowserOwnerAppId() may still return
    * NO_APP_ID, if this browser frame is not contained inside an app.
    */
   uint32_t BrowserOwnerAppId() const;
   already_AddRefed<mozIApplication> GetBrowserOwnerApp() const;
   bool HasBrowserOwnerApp() const;
 
--- a/dom/ipc/nsIContentParent.cpp
+++ b/dom/ipc/nsIContentParent.cpp
@@ -89,20 +89,21 @@ nsIContentParent::CanOpenBrowser(const I
     }
 
     auto opener = TabParent::GetFrom(popupContext.opener().get_PBrowserParent());
     if (!opener) {
       ASSERT_UNLESS_FUZZING("Got null opener from child; aborting AllocPBrowserParent.");
       return false;
     }
 
-    // Popup windows of isBrowser frames must be isBrowser if the parent
-    // isBrowser.  Allocating a !isBrowser frame with same app ID would allow
-    // the content to access data it's not supposed to.
-    if (!popupContext.isBrowserElement() && opener->IsBrowserElement()) {
+    // Popup windows of isIsolatedBrowser frames must be isIsolatedBrowser if
+    // the parent isIsolatedBrowser.  Allocating a !isIsolatedBrowser frame with
+    // same app ID would allow the content to access data it's not supposed to.
+    if (!popupContext.isIsolatedBrowserElement() &&
+        opener->IsIsolatedBrowserElement()) {
       ASSERT_UNLESS_FUZZING("Child trying to escalate privileges!  Aborting AllocPBrowserParent.");
       return false;
     }
   }
 
   MaybeInvalidTabContext tc(aContext);
   if (!tc.IsValid()) {
     NS_ERROR(nsPrintfCString("Child passed us an invalid TabContext.  (%s)  "
--- a/dom/network/TCPServerSocket.cpp
+++ b/dom/network/TCPServerSocket.cpp
@@ -143,17 +143,17 @@ TCPServerSocket::FireEvent(const nsAStri
 
 NS_IMETHODIMP
 TCPServerSocket::OnSocketAccepted(nsIServerSocket* aServer, nsISocketTransport* aTransport)
 {
   nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal();
   RefPtr<TCPSocket> socket = TCPSocket::CreateAcceptedSocket(global, aTransport, mUseArrayBuffers);
   if (mServerBridgeParent) {
     socket->SetAppIdAndBrowser(mServerBridgeParent->GetAppId(),
-                               mServerBridgeParent->GetInBrowser());
+                               mServerBridgeParent->GetInIsolatedBrowser());
   }
   FireEvent(NS_LITERAL_STRING("connect"), socket);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TCPServerSocket::OnStopListening(nsIServerSocket* aServer, nsresult aStatus)
 {
--- a/dom/network/TCPServerSocketParent.cpp
+++ b/dom/network/TCPServerSocketParent.cpp
@@ -70,22 +70,22 @@ TCPServerSocketParent::GetAppId()
     TabParent *tab = TabParent::GetFrom(browser);
     return tab->OwnAppId();
   } else {
     return nsIScriptSecurityManager::UNKNOWN_APP_ID;
   }
 }
 
 bool
-TCPServerSocketParent::GetInBrowser()
+TCPServerSocketParent::GetInIsolatedBrowser()
 {
   const PContentParent *content = Manager()->Manager();
   if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
     TabParent *tab = TabParent::GetFrom(browser);
-    return tab->IsBrowserElement();
+    return tab->IsIsolatedBrowserElement();
   } else {
     return false;
   }
 }
 
 nsresult
 TCPServerSocketParent::SendCallbackAccept(TCPSocketParent *socket)
 {
@@ -145,17 +145,17 @@ TCPServerSocketParent::RecvRequestDelete
   mozilla::Unused << Send__delete__(this);
   return true;
 }
 
 void
 TCPServerSocketParent::OnConnect(TCPServerSocketEvent* event)
 {
   RefPtr<TCPSocket> socket = event->Socket();
-  socket->SetAppIdAndBrowser(GetAppId(), GetInBrowser());
+  socket->SetAppIdAndBrowser(GetAppId(), GetInIsolatedBrowser());
 
   RefPtr<TCPSocketParent> socketParent = new TCPSocketParent();
   socketParent->SetSocket(socket);
 
   socket->SetSocketBridgeParent(socketParent);
 
   SendCallbackAccept(socketParent);
 }
--- a/dom/network/TCPServerSocketParent.h
+++ b/dom/network/TCPServerSocketParent.h
@@ -30,17 +30,17 @@ public:
                         uint16_t aBacklog, bool aUseArrayBuffers);
 
   void Init();
 
   virtual bool RecvClose() override;
   virtual bool RecvRequestDelete() override;
 
   uint32_t GetAppId();
-  bool GetInBrowser();
+  bool GetInIsolatedBrowser();
 
   void AddIPDLReference();
   void ReleaseIPDLReference();
 
   void OnConnect(TCPServerSocketEvent* event);
 
 private:
   ~TCPServerSocketParent();
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -161,17 +161,17 @@ TCPSocket::TCPSocket(nsIGlobalObject* aG
   , mBufferedAmount(0)
   , mSuspendCount(0)
   , mTrackingNumber(0)
   , mWaitingForStartTLS(false)
 #ifdef MOZ_WIDGET_GONK
   , mTxBytes(0)
   , mRxBytes(0)
   , mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID)
-  , mInBrowser(false)
+  , mInIsolatedBrowser(false)
 #endif
 {
   if (aGlobal) {
     nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal);
     if (window) {
       mInnerWindowID = window->WindowID();
     }
   }
@@ -1095,21 +1095,21 @@ TCPSocket::OnStopRequest(nsIRequest* aRe
 
 void
 TCPSocket::SetSocketBridgeParent(TCPSocketParent* aBridgeParent)
 {
   mSocketBridgeParent = aBridgeParent;
 }
 
 void
-TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInBrowser)
+TCPSocket::SetAppIdAndBrowser(uint32_t aAppId, bool aInIsolatedBrowser)
 {
 #ifdef MOZ_WIDGET_GONK
   mAppId = aAppId;
-  mInBrowser = aInBrowser;
+  mInIsolatedBrowser = aInIsolatedBrowser;
 #endif
 }
 
 NS_IMETHODIMP
 TCPSocket::UpdateReadyState(uint32_t aReadyState)
 {
   MOZ_ASSERT(mSocketBridgeChild);
   mReadyState = static_cast<TCPReadyState>(aReadyState);
@@ -1150,18 +1150,18 @@ TCPSocket::SaveNetworkStats(bool aEnforc
   }
 
   nsCOMPtr<nsINetworkStatsServiceProxy> nssProxy =
     do_GetService("@mozilla.org/networkstatsServiceProxy;1");
   if (!nssProxy) {
     return;
   }
 
-  nssProxy->SaveAppStats(mAppId, mInBrowser, mActiveNetworkInfo, PR_Now(),
-                         mRxBytes, mTxBytes, false, nullptr);
+  nssProxy->SaveAppStats(mAppId, mInIsolatedBrowser, mActiveNetworkInfo,
+                         PR_Now(), mRxBytes, mTxBytes, false, nullptr);
 
   // Reset the counters once the statistics is saved to NetworkStatsServiceProxy.
   mTxBytes = mRxBytes = 0;
 }
 #endif
 
 NS_IMETHODIMP
 TCPSocket::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
--- a/dom/network/TCPSocket.h
+++ b/dom/network/TCPSocket.h
@@ -237,18 +237,18 @@ private:
 
 #ifdef MOZ_WIDGET_GONK
   // Number of bytes sent.
   uint32_t mTxBytes;
   // Number of bytes received.
   uint32_t mRxBytes;
   // The app that owns this socket.
   uint32_t mAppId;
-  // Was this socket created inside of a mozbrowser frame?
-  bool mInBrowser;
+  // Was this socket created inside of an isolated browser frame?
+  bool mInIsolatedBrowser;
   // The name of the active network used by this socket.
   nsCOMPtr<nsINetworkInfo> mActiveNetworkInfo;
 #endif
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/network/TCPSocketParent.cpp
+++ b/dom/network/TCPSocketParent.cpp
@@ -72,22 +72,22 @@ TCPSocketParent::GetAppId()
     TabParent *tab = TabParent::GetFrom(browser);
     return tab->OwnAppId();
   } else {
     return nsIScriptSecurityManager::UNKNOWN_APP_ID;
   }
 };
 
 bool
-TCPSocketParent::GetInBrowser()
+TCPSocketParent::GetInIsolatedBrowser()
 {
   const PContentParent *content = Manager()->Manager();
   if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
     TabParent *tab = TabParent::GetFrom(browser);
-    return tab->IsBrowserElement();
+    return tab->IsIsolatedBrowserElement();
   } else {
     return false;
   }
 }
 
 nsresult
 TCPSocketParent::OfflineNotification(nsISupports *aSubject)
 {
@@ -150,26 +150,26 @@ TCPSocketParent::RecvOpen(const nsString
   if (net::UsingNeckoIPCSecurity() &&
       !AssertAppProcessPermission(Manager()->Manager(), "tcp-socket")) {
     FireInteralError(this, __LINE__);
     return true;
   }
 
   // Obtain App ID
   uint32_t appId = GetAppId();
-  bool     inBrowser = GetInBrowser();
+  bool     inIsolatedBrowser = GetInIsolatedBrowser();
 
   if (NS_IsAppOffline(appId)) {
     NS_ERROR("Can't open socket because app is offline");
     FireInteralError(this, __LINE__);
     return true;
   }
 
   mSocket = new TCPSocket(nullptr, aHost, aPort, aUseSSL, aUseArrayBuffers);
-  mSocket->SetAppIdAndBrowser(appId, inBrowser);
+  mSocket->SetAppIdAndBrowser(appId, inIsolatedBrowser);
   mSocket->SetSocketBridgeParent(this);
   NS_ENSURE_SUCCESS(mSocket->Init(), true);
   return true;
 }
 
 bool
 TCPSocketParent::RecvOpenBind(const nsCString& aRemoteHost,
                               const uint16_t& aRemotePort,
@@ -216,28 +216,28 @@ TCPSocketParent::RecvOpenBind(const nsCS
   rv = socketTransport->Bind(&addr);
   if (NS_FAILED(rv)) {
     FireInteralError(this, __LINE__);
     return true;
   }
 
   // Obtain App ID
   uint32_t appId = nsIScriptSecurityManager::NO_APP_ID;
-  bool     inBrowser = false;
+  bool     inIsolatedBrowser = false;
   const PContentParent *content = Manager()->Manager();
   if (PBrowserParent* browser = SingleManagedOrNull(content->ManagedPBrowserParent())) {
     // appId's are for B2G only currently, where managees.Count() == 1
     // This is not guaranteed currently in Desktop, so skip this there.
     TabParent *tab = TabParent::GetFrom(browser);
     appId = tab->OwnAppId();
-    inBrowser = tab->IsBrowserElement();
+    inIsolatedBrowser = tab->IsIsolatedBrowserElement();
   }
 
   mSocket = new TCPSocket(nullptr, NS_ConvertUTF8toUTF16(aRemoteHost), aRemotePort, aUseSSL, aUseArrayBuffers);
-  mSocket->SetAppIdAndBrowser(appId, inBrowser);
+  mSocket->SetAppIdAndBrowser(appId, inIsolatedBrowser);
   mSocket->SetSocketBridgeParent(this);
   rv = mSocket->InitWithUnconnectedTransport(socketTransport);
   NS_ENSURE_SUCCESS(rv, true);
   return true;
 }
 
 bool
 TCPSocketParent::RecvStartTLS()
--- a/dom/network/TCPSocketParent.h
+++ b/dom/network/TCPSocketParent.h
@@ -63,17 +63,17 @@ public:
   virtual bool RecvSuspend() override;
   virtual bool RecvResume() override;
   virtual bool RecvClose() override;
   virtual bool RecvData(const SendableData& aData,
                         const uint32_t& aTrackingNumber) override;
   virtual bool RecvRequestDelete() override;
   virtual nsresult OfflineNotification(nsISupports *) override;
   virtual uint32_t GetAppId() override;
-  bool GetInBrowser();
+  bool GetInIsolatedBrowser();
 
   void FireErrorEvent(const nsAString& aName, const nsAString& aType, TCPReadyState aReadyState);
   void FireEvent(const nsAString& aType, TCPReadyState aReadyState);
   void FireArrayBufferDataEvent(nsTArray<uint8_t>& aBuffer, TCPReadyState aReadyState);
   void FireStringDataEvent(const nsACString& aData, TCPReadyState aReadyState);
 
   void SetSocket(TCPSocket *socket);
   nsresult GetHost(nsAString& aHost);
--- a/dom/workers/ServiceWorkerManagerService.cpp
+++ b/dom/workers/ServiceWorkerManagerService.cpp
@@ -63,17 +63,17 @@ public:
         // mContentParent needs to be released in the main thread.
         data.mContentParent = nullptr;
         // We only send the notification about the soft update to the
         // tabs/apps with the same appId and inIsolatedBrowser values.
         // Sending a notification to the wrong process will make the process
         // to be killed.
         for (uint32_t j = 0; j < contextArray.Length(); ++j) {
           if ((contextArray[j].OwnOrContainingAppId() == mOriginAttributes.mAppId) &&
-              (contextArray[j].IsBrowserElement() == mOriginAttributes.mInIsolatedBrowser)) {
+              (contextArray[j].IsIsolatedBrowserElement() == mOriginAttributes.mInIsolatedBrowser)) {
             continue;
           }
           // Array entries with no mParent won't receive any notification.
           data.mParent = nullptr;
         }
       }
       nsresult rv = mBackgroundThread->Dispatch(this, NS_DISPATCH_NORMAL);
       MOZ_ALWAYS_TRUE(NS_SUCCEEDED(rv));
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -123,27 +123,27 @@ NeckoParent::GetValidatedAppInfo(const S
 
   nsTArray<TabContext> contextArray =
     static_cast<ContentParent*>(aContent)->GetManagedTabContext();
   for (uint32_t i = 0; i < contextArray.Length(); i++) {
     TabContext tabContext = contextArray[i];
     uint32_t appId = tabContext.OwnOrContainingAppId();
     bool inBrowserElement = aSerialized.IsNotNull() ?
                               aSerialized.mOriginAttributes.mInIsolatedBrowser :
-                              tabContext.IsBrowserElement();
+                              tabContext.IsIsolatedBrowserElement();
 
     if (appId == NECKO_UNKNOWN_APP_ID) {
       continue;
     }
     // We may get appID=NO_APP if child frame is neither a browser nor an app
     if (appId == NECKO_NO_APP_ID) {
       if (tabContext.HasOwnApp()) {
         continue;
       }
-      if (UsingNeckoIPCSecurity() && tabContext.IsBrowserElement()) {
+      if (UsingNeckoIPCSecurity() && tabContext.IsIsolatedBrowserElement()) {
         // <iframe mozbrowser> which doesn't have an <iframe mozapp> above it.
         // This is not supported now, and we'll need to do a code audit to make
         // sure we can handle it (i.e don't short-circuit using separate
         // namespace if just appID==0)
         continue;
       }
     }