Bug 1318888 - Remove a few other mentions of appId's from Necko; r=mcmanus
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 19 Nov 2016 16:53:32 -0500
changeset 370976 51735fb6b7e05eeefe901c2fbdfe1e748907a43f
parent 370975 1eafbe8e6188b85d0a14c419f7f28a91714d2334
child 370977 b5e0bcbb12dd3b0e18e7f136cc156119c7631bf9
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1318888
milestone53.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 1318888 - Remove a few other mentions of appId's from Necko; r=mcmanus
netwerk/base/nsNetUtil.cpp
netwerk/base/nsUDPSocket.cpp
netwerk/base/nsUDPSocket.h
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cookie/CookieServiceParent.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -567,18 +567,17 @@ NS_LoadGroupMatchesPrincipal(nsILoadGrou
                                   getter_AddRefs(loadContext));
     NS_ENSURE_TRUE(loadContext, false);
 
     // Verify load context browser flag match the principal
     bool contextInIsolatedBrowser;
     nsresult rv = loadContext->GetIsInIsolatedMozBrowserElement(&contextInIsolatedBrowser);
     NS_ENSURE_SUCCESS(rv, false);
 
-    return nsIScriptSecurityManager::NO_APP_ID == aPrincipal->GetAppId() &&
-           contextInIsolatedBrowser == aPrincipal->GetIsInIsolatedMozBrowserElement();
+    return contextInIsolatedBrowser == aPrincipal->GetIsInIsolatedMozBrowserElement();
 }
 
 nsresult
 NS_NewDownloader(nsIStreamListener   **result,
                  nsIDownloadObserver  *observer,
                  nsIFile              *downloadLocation /* = nullptr */)
 {
     nsresult rv;
@@ -2345,21 +2344,20 @@ NS_CompareLoadInfoAndLoadContext(nsIChan
   if (NS_FAILED(rv)) {
     return NS_ERROR_UNEXPECTED;
   }
 
   OriginAttributes originAttrsLoadInfo = loadInfo->GetOriginAttributes();
   DocShellOriginAttributes originAttrsLoadContext;
   loadContext->GetOriginAttributes(originAttrsLoadContext);
 
-  LOG(("NS_CompareLoadInfoAndLoadContext - loadInfo: %d, %d, %d, %d; "
+  LOG(("NS_CompareLoadInfoAndLoadContext - loadInfo: %d, %d, %d; "
        "loadContext: %d %d, %d. [channel=%p]",
-       originAttrsLoadInfo.mAppId, originAttrsLoadInfo.mInIsolatedMozBrowser,
-       originAttrsLoadInfo.mUserContextId, originAttrsLoadInfo.mPrivateBrowsingId,
-       loadContextIsInBE,
+       originAttrsLoadInfo.mInIsolatedMozBrowser, originAttrsLoadInfo.mUserContextId,
+       originAttrsLoadInfo.mPrivateBrowsingId, loadContextIsInBE,
        originAttrsLoadContext.mUserContextId, originAttrsLoadContext.mPrivateBrowsingId,
        aChannel));
 
   MOZ_ASSERT(originAttrsLoadInfo.mInIsolatedMozBrowser ==
              loadContextIsInBE,
              "The value of InIsolatedMozBrowser in the loadContext and in "
              "the loadInfo are not the same!");
 
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -244,18 +244,16 @@ nsUDPMessage::GetDataAsTArray()
 
 //-----------------------------------------------------------------------------
 // nsUDPSocket
 //-----------------------------------------------------------------------------
 
 nsUDPSocket::nsUDPSocket()
   : mLock("nsUDPSocket.mLock")
   , mFD(nullptr)
-  , mAppId(NECKO_UNKNOWN_APP_ID)
-  , mIsInIsolatedMozBrowserElement(false)
   , mAttached(false)
   , mByteReadCount(0)
   , mByteWriteCount(0)
 {
   mAddr.raw.family = PR_AF_UNSPEC;
   // we want to be able to access the STS directly, and it may not have been
   // constructed yet.  the STS constructor sets gSocketTransportService.
   if (!gSocketTransportService)
@@ -612,31 +610,16 @@ nsUDPSocket::InitWithAddress(const NetAd
 
   mFD = PR_OpenUDPSocket(aAddr->raw.family);
   if (!mFD)
   {
     NS_WARNING("unable to create UDP socket");
     return NS_ERROR_FAILURE;
   }
 
-  if (aPrincipal) {
-    mAppId = aPrincipal->GetAppId();
-    mIsInIsolatedMozBrowserElement =
-      aPrincipal->GetIsInIsolatedMozBrowserElement();
-  }
-
-#ifdef MOZ_WIDGET_GONK
-  if (mAppId != NECKO_UNKNOWN_APP_ID) {
-    nsCOMPtr<nsINetworkInfo> activeNetworkInfo;
-    GetActiveNetworkInfo(activeNetworkInfo);
-    mActiveNetworkInfo =
-      new nsMainThreadPtrHolder<nsINetworkInfo>(activeNetworkInfo);
-  }
-#endif
-
   uint16_t port;
   if (NS_FAILED(net::GetPort(aAddr, &port))) {
     NS_WARNING("invalid bind address");
     goto fail;
   }
 
   PRSocketOptionData opt;
 
--- a/netwerk/base/nsUDPSocket.h
+++ b/netwerk/base/nsUDPSocket.h
@@ -60,28 +60,23 @@ private:
 
   void CloseSocket();
 
   // lock protects access to mListener;
   // so mListener is not cleared while being used/locked.
   Mutex                                mLock;
   PRFileDesc                          *mFD;
   NetAddr                              mAddr;
-  uint32_t                             mAppId;
-  bool                                 mIsInIsolatedMozBrowserElement;
   nsCOMPtr<nsIUDPSocketListener>       mListener;
   nsCOMPtr<nsIEventTarget>             mListenerTarget;
   bool                                 mAttached;
   RefPtr<nsSocketTransportService>     mSts;
 
   uint64_t   mByteReadCount;
   uint64_t   mByteWriteCount;
-#ifdef MOZ_WIDGET_GONK
-  nsMainThreadPtrHandle<nsINetworkInfo> mActiveNetworkInfo;
-#endif
 };
 
 //-----------------------------------------------------------------------------
 
 class nsUDPMessage : public nsIUDPMessage
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -2439,17 +2439,17 @@ nsOfflineCacheDevice::Evict(nsILoadConte
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   NS_ENSURE_ARG(aInfo);
 
   nsresult rv;
 
   mozilla::OriginAttributes const *oa = aInfo->OriginAttributesPtr();
 
-  if (oa->mAppId == NECKO_NO_APP_ID && oa->mInIsolatedMozBrowser == false) {
+  if (oa->mInIsolatedMozBrowser == false) {
     nsCOMPtr<nsICacheService> serv = do_GetService(kCacheServiceCID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return nsCacheService::GlobalInstance()->EvictEntriesInternal(nsICache::STORE_OFFLINE);
   }
 
   nsAutoCString jaridsuffix;
   jaridsuffix.Append('%');
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -26,18 +26,16 @@ using mozilla::net::NeckoParent;
 namespace {
 
 // Ignore failures from this function, as they only affect whether we do or
 // don't show a dialog box in private browsing mode if the user sets a pref.
 void
 CreateDummyChannel(nsIURI* aHostURI, NeckoOriginAttributes& aAttrs, bool aIsPrivate,
                    nsIChannel** aChannel)
 {
-  MOZ_ASSERT(aAttrs.mAppId != nsIScriptSecurityManager::UNKNOWN_APP_ID);
-
   PrincipalOriginAttributes attrs;
   attrs.InheritFromNecko(aAttrs);
 
   nsCOMPtr<nsIPrincipal> principal =
     BasePrincipal::CreateCodebasePrincipal(aHostURI, attrs);
   if (!principal) {
     return;
   }
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -2950,18 +2950,16 @@ HttpBaseChannel::SetupReplacementChannel
       if (loadContext) {
         loadContext->GetOriginAttributes(docShellAttrs);
       }
       MOZ_ASSERT(docShellAttrs.mFirstPartyDomain.IsEmpty(),
                  "top-level docshell shouldn't have firstPartyDomain attribute.");
 
       NeckoOriginAttributes attrs = newLoadInfo->GetOriginAttributes();
 
-      MOZ_ASSERT(docShellAttrs.mAppId == attrs.mAppId,
-                "docshell and necko should have the same appId attribute.");
       MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId,
                 "docshell and necko should have the same userContextId attribute.");
       MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser,
                 "docshell and necko should have the same inIsolatedMozBrowser attribute.");
       MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId,
                  "docshell and necko should have the same privateBrowsingId attribute.");
 
       attrs.InheritFromDocShellToNecko(docShellAttrs, true, newURI);