From a2029f145a0e84957f87bfee49ce62160f7ede54 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 28 Dec 2012 19:18:38 -0500 Subject: [PATCH] Backed out changeset 6cd44513d285 (bug 782542) --- .../test_child_process_shutdown_message.html | 8 - .../templates/src/crashtests/crashtests.list | 2 +- docshell/base/LoadContext.cpp | 12 +- docshell/base/LoadContext.h | 17 +- .../mochitest/browserElementTestHelpers.js | 15 -- dom/devicestorage/ipc/test_ipc.html | 3 - dom/indexedDB/ipc/test_ipc.html | 3 - dom/indexedDB/test/file_app_isolation.js | 7 +- dom/ipc/PBrowser.ipdl | 3 + dom/ipc/TabChild.cpp | 2 + dom/ipc/TabChild.h | 2 + dom/ipc/TabParent.cpp | 8 +- dom/ipc/TabParent.h | 2 + netwerk/cookie/CookieServiceChild.cpp | 26 +--- netwerk/cookie/CookieServiceParent.cpp | 65 +++----- netwerk/cookie/CookieServiceParent.h | 7 +- netwerk/cookie/PCookieService.ipdl | 7 +- netwerk/ipc/NeckoChild.cpp | 6 +- netwerk/ipc/NeckoChild.h | 5 +- netwerk/ipc/NeckoParent.cpp | 147 +----------------- netwerk/ipc/NeckoParent.h | 35 +---- netwerk/ipc/PNecko.ipdl | 4 +- netwerk/protocol/ftp/FTPChannelChild.cpp | 31 +--- netwerk/protocol/ftp/FTPChannelParent.cpp | 21 +-- netwerk/protocol/ftp/FTPChannelParent.h | 8 +- netwerk/protocol/ftp/PFTPChannel.ipdl | 4 +- netwerk/protocol/http/HttpChannelParent.cpp | 18 ++- netwerk/protocol/http/HttpChannelParent.h | 10 +- netwerk/protocol/websocket/PWebSocket.ipdl | 3 +- .../websocket/WebSocketChannelChild.cpp | 6 +- .../websocket/WebSocketChannelParent.cpp | 19 ++- .../websocket/WebSocketChannelParent.h | 8 +- netwerk/protocol/wyciwyg/PWyciwygChannel.ipdl | 4 +- .../protocol/wyciwyg/WyciwygChannelChild.cpp | 12 +- .../protocol/wyciwyg/WyciwygChannelParent.cpp | 17 +- .../protocol/wyciwyg/WyciwygChannelParent.h | 7 +- .../prefetch/OfflineCacheUpdateChild.cpp | 1 + .../prefetch/OfflineCacheUpdateParent.cpp | 13 +- uriloader/prefetch/OfflineCacheUpdateParent.h | 8 +- 39 files changed, 161 insertions(+), 415 deletions(-) diff --git a/content/base/test/test_child_process_shutdown_message.html b/content/base/test/test_child_process_shutdown_message.html index dfebea910c7..40d5c7f6bea 100644 --- a/content/base/test/test_child_process_shutdown_message.html +++ b/content/base/test/test_child_process_shutdown_message.html @@ -112,10 +112,6 @@ function setUp() { SpecialPowers.setBoolPref("dom.ipc.browser_frames.oop_by_default", true); SpecialPowers.addPermission("browser", true, window.document); SpecialPowers.addPermission("embed-apps", true, window.document); - - // TODO: remove in bug 820712 - SpecialPowers.setBoolPref("network.disable.ipc.security", true); - runNextTest(); } @@ -140,10 +136,6 @@ function makeKillTest(isApp) function testKill() { function tearDown() { SpecialPowers.clearUserPref("dom.mozBrowserFramesEnabled"); SpecialPowers.clearUserPref("dom.ipc.browser_frames.oop_by_default"); - - // TODO: remove in bug 820712 - SpecialPowers.clearUserPref("network.disable.ipc.security"); - SimpleTest.finish(); } diff --git a/content/xul/templates/src/crashtests/crashtests.list b/content/xul/templates/src/crashtests/crashtests.list index fbc33ba1675..6ffd2e9ec7c 100644 --- a/content/xul/templates/src/crashtests/crashtests.list +++ b/content/xul/templates/src/crashtests/crashtests.list @@ -1,7 +1,7 @@ load 257752-1-recursion.xul load 329335-1.xul load 329884-1.xul -skip-if(winWidget||browserIsRemote) HTTP load 330010-1.xul # bugs 742455 and 823470 +skip-if(winWidget) HTTP load 330010-1.xul # bug 742455 skip-if(winWidget) load 330012-1.xul # bug 742455 skip-if(winWidget) load 397148-1.xul # bug 742455 load 404346-1.xul diff --git a/docshell/base/LoadContext.cpp b/docshell/base/LoadContext.cpp index 7bf55a46659..6861ecac3d6 100644 --- a/docshell/base/LoadContext.cpp +++ b/docshell/base/LoadContext.cpp @@ -8,12 +8,22 @@ #include "nsIScriptSecurityManager.h" #include "nsServiceManagerUtils.h" #include "nsContentUtils.h" -#include "mozIApplication.h" namespace mozilla { NS_IMPL_ISUPPORTS1(LoadContext, nsILoadContext); +LoadContext::LoadContext(const IPC::SerializedLoadContext& aToCopy, + nsIDOMElement* aTopFrameElemenet) + : mIsNotNull(aToCopy.mIsNotNull) + , mIsContent(aToCopy.mIsContent) + , mUsePrivateBrowsing(aToCopy.mUsePrivateBrowsing) + , mIsInBrowserElement(aToCopy.mIsInBrowserElement) + , mAppId(aToCopy.mAppId) + , mTopFrameElement(do_GetWeakReference(aTopFrameElemenet)) +{} + + //----------------------------------------------------------------------------- // LoadContext::nsILoadContext //----------------------------------------------------------------------------- diff --git a/docshell/base/LoadContext.h b/docshell/base/LoadContext.h index c1ba521b9bb..29961ca44ac 100644 --- a/docshell/base/LoadContext.h +++ b/docshell/base/LoadContext.h @@ -10,9 +10,6 @@ #include "SerializedLoadContext.h" #include "mozilla/Attributes.h" #include "nsWeakReference.h" -#include "nsIDOMElement.h" - -class mozIApplication; namespace mozilla { @@ -32,19 +29,17 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSILOADCONTEXT - // AppId/inBrowser arguments override those in SerializedLoadContext provided - // by child process. - LoadContext(const IPC::SerializedLoadContext& aToCopy, - nsIDOMElement* aTopFrameElement, - uint32_t aAppId, bool aInBrowser) + LoadContext(const IPC::SerializedLoadContext& aToCopy) : mIsNotNull(aToCopy.mIsNotNull) , mIsContent(aToCopy.mIsContent) , mUsePrivateBrowsing(aToCopy.mUsePrivateBrowsing) - , mIsInBrowserElement(aInBrowser) - , mAppId(aAppId) - , mTopFrameElement(do_GetWeakReference(aTopFrameElement)) + , mIsInBrowserElement(aToCopy.mIsInBrowserElement) + , mAppId(aToCopy.mAppId) {} + LoadContext(const IPC::SerializedLoadContext& aToCopy, + nsIDOMElement* aTopFrameElemenet); + private: bool mIsNotNull; bool mIsContent; diff --git a/dom/browser-element/mochitest/browserElementTestHelpers.js b/dom/browser-element/mochitest/browserElementTestHelpers.js index 4d9b1e56d46..356e8f0f92f 100644 --- a/dom/browser-element/mochitest/browserElementTestHelpers.js +++ b/dom/browser-element/mochitest/browserElementTestHelpers.js @@ -65,14 +65,6 @@ const browserElementTestHelpers = { return this._setBoolPref("dom.ipc.browser_frames.oop_by_default", value); }, - getIPCSecurityDisabledPref: function() { - return this._getBoolPref("network.disable.ipc.security"); - }, - - setIPCSecurityDisabledPref: function(value) { - return this._setBoolPref("network.disable.ipc.security", value); - }, - getPageThumbsEnabledPref: function() { return this._getBoolPref('browser.pageThumbs.enabled'); }, @@ -102,7 +94,6 @@ const browserElementTestHelpers = { this.setOOPDisabledPref(this.origOOPDisabledPref); this.setOOPByDefaultPref(this.origOOPByDefaultPref); this.setPageThumbsEnabledPref(this.origPageThumbsEnabledPref); - this.setIPCSecurityDisabledPref(this.origIPCSecurityPref); this.removeAllTempPermissions(); }, @@ -110,7 +101,6 @@ const browserElementTestHelpers = { 'origOOPDisabledPref': null, 'origOOPByDefaultPref': null, 'origPageThumbsEnabledPref': null, - 'origIPCSecurityPref': null, 'tempPermissions': [], // Some basically-empty pages from different domains you can load. @@ -132,7 +122,6 @@ browserElementTestHelpers.origEnabledPref = browserElementTestHelpers.getEnabled browserElementTestHelpers.origOOPDisabledPref = browserElementTestHelpers.getOOPDisabledPref(); browserElementTestHelpers.origOOPByDefaultPref = browserElementTestHelpers.getOOPByDefaultPref(); browserElementTestHelpers.origPageThumbsEnabledPref = browserElementTestHelpers.getPageThumbsEnabledPref(); -browserElementTestHelpers.origIPCSecurityPref = browserElementTestHelpers.getIPCSecurityDisabledPref(); // Disable tab view; it seriously messes us up. browserElementTestHelpers.setPageThumbsEnabledPref(false); @@ -144,10 +133,6 @@ var oop = location.pathname.indexOf('_inproc_') == -1; browserElementTestHelpers.setOOPByDefaultPref(oop); browserElementTestHelpers.setOOPDisabledPref(false); -// Disable the networking security checks; our test harness just tests browser elements -// without sticking them in apps, and the security checks dislike that. -browserElementTestHelpers.setIPCSecurityDisabledPref(true); - addEventListener('unload', function() { browserElementTestHelpers.restoreOriginalPrefs(); }); diff --git a/dom/devicestorage/ipc/test_ipc.html b/dom/devicestorage/ipc/test_ipc.html index 1366f54dd27..f0836eacd35 100644 --- a/dom/devicestorage/ipc/test_ipc.html +++ b/dom/devicestorage/ipc/test_ipc.html @@ -153,9 +153,6 @@ ["device.storage.testing", true], ["device.storage.prompt.testing", true], - // TODO: remove this as part of bug 820712 - ["network.disable.ipc.security", true], - ["dom.ipc.browser_frames.oop_by_default", true], ["dom.mozBrowserFramesEnabled", true], ["browser.pageThumbs.enabled", false] diff --git a/dom/indexedDB/ipc/test_ipc.html b/dom/indexedDB/ipc/test_ipc.html index fe4e0c72264..7cb1971aaf7 100644 --- a/dom/indexedDB/ipc/test_ipc.html +++ b/dom/indexedDB/ipc/test_ipc.html @@ -168,9 +168,6 @@ SpecialPowers.addPermission("browser", true, document); SpecialPowers.pushPrefEnv({ "set": [ - // TODO: remove this as part of bug 820712 - ["network.disable.ipc.security", true], - ["dom.ipc.browser_frames.oop_by_default", true], ["dom.mozBrowserFramesEnabled", true] ] diff --git a/dom/indexedDB/test/file_app_isolation.js b/dom/indexedDB/test/file_app_isolation.js index 704288f7b26..514fb5824b6 100644 --- a/dom/indexedDB/test/file_app_isolation.js +++ b/dom/indexedDB/test/file_app_isolation.js @@ -159,10 +159,5 @@ if (!SpecialPowers.isMainProcess()) { todo(false, "We should make this work on content process"); SimpleTest.finish(); } else { - // TODO: remove unsetting network.disable.ipc.security as part of bug 820712 - SpecialPowers.pushPrefEnv({ - "set": [ - ["network.disable.ipc.security", true], - ] - }, startTest); + startTest(); } diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index a7270b93d55..7ccc34c952b 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -216,6 +216,8 @@ parent: * URI of the manifest to fetch, the application cache group ID * @param documentURI * URI of the document that referred the manifest + * @param clientID + * The group cache version identifier to use * @param stickDocument * True if the update was initiated by a document load that referred * a manifest. @@ -233,6 +235,7 @@ parent: * has already been cached (stickDocument=false). */ POfflineCacheUpdate(URIParams manifestURI, URIParams documentURI, + bool isInBrowserElement, uint32_t appId, bool stickDocument); sync PIndexedDB(nsCString asciiOrigin) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index eb480234d38..03fe4aa97ec 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -1576,6 +1576,8 @@ TabChild::RecvActivateFrameEvent(const nsString& aType, const bool& capture) POfflineCacheUpdateChild* TabChild::AllocPOfflineCacheUpdate(const URIParams& manifestURI, const URIParams& documentURI, + const bool& isInBrowserElement, + const uint32_t& appId, const bool& stickDocument) { NS_RUNTIMEABORT("unused"); diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index e565c1f1ceb..3e76ee766aa 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -277,6 +277,8 @@ public: virtual POfflineCacheUpdateChild* AllocPOfflineCacheUpdate( const URIParams& manifestURI, const URIParams& documentURI, + const bool& isInBrowserElement, + const uint32_t& appId, const bool& stickDocument); virtual bool DeallocPOfflineCacheUpdate(POfflineCacheUpdateChild* offlineCacheUpdate); diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 70a607aa708..e252345fe79 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1132,13 +1132,15 @@ TabParent::DeallocPRenderFrame(PRenderFrameParent* aFrame) mozilla::docshell::POfflineCacheUpdateParent* TabParent::AllocPOfflineCacheUpdate(const URIParams& aManifestURI, const URIParams& aDocumentURI, + const bool& isInBrowserElement, + const uint32_t& appId, const bool& stickDocument) { nsRefPtr update = - new mozilla::docshell::OfflineCacheUpdateParent(OwnOrContainingAppId(), - IsBrowserElement()); + new mozilla::docshell::OfflineCacheUpdateParent(); - nsresult rv = update->Schedule(aManifestURI, aDocumentURI, stickDocument); + nsresult rv = update->Schedule(aManifestURI, aDocumentURI, + isInBrowserElement, appId, stickDocument); if (NS_FAILED(rv)) return nullptr; diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index bd640e3c9b7..c44528fc8f7 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -191,6 +191,8 @@ public: virtual POfflineCacheUpdateParent* AllocPOfflineCacheUpdate( const URIParams& aManifestURI, const URIParams& aDocumentURI, + const bool& isInBrowserElement, + const uint32_t& appId, const bool& stickDocument); virtual bool DeallocPOfflineCacheUpdate(POfflineCacheUpdateParent* actor); diff --git a/netwerk/cookie/CookieServiceChild.cpp b/netwerk/cookie/CookieServiceChild.cpp index d0e88c57810..a20b33bff15 100644 --- a/netwerk/cookie/CookieServiceChild.cpp +++ b/netwerk/cookie/CookieServiceChild.cpp @@ -4,14 +4,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/net/CookieServiceChild.h" -#include "mozilla/dom/TabChild.h" + #include "mozilla/ipc/URIUtils.h" #include "mozilla/net/NeckoChild.h" #include "nsIURI.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" -#include "nsITabChild.h" -#include "nsNetUtil.h" using namespace mozilla::ipc; @@ -117,19 +115,10 @@ CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI, URIParams uriParams; SerializeURI(aHostURI, uriParams); - nsCOMPtr iTabChild; - mozilla::dom::TabChild* tabChild = nullptr; - if (aChannel) { - NS_QueryNotificationCallbacks(aChannel, iTabChild); - if (iTabChild) { - tabChild = static_cast(iTabChild.get()); - } - } - // Synchronously call the parent. nsAutoCString result; SendGetCookieString(uriParams, !!isForeign, aFromHttp, - IPC::SerializedLoadContext(aChannel), tabChild, &result); + IPC::SerializedLoadContext(aChannel), &result); if (!result.IsEmpty()) *aCookieString = ToNewCString(result); @@ -159,18 +148,9 @@ CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI, URIParams uriParams; SerializeURI(aHostURI, uriParams); - nsCOMPtr iTabChild; - mozilla::dom::TabChild* tabChild = nullptr; - if (aChannel) { - NS_QueryNotificationCallbacks(aChannel, iTabChild); - if (iTabChild) { - tabChild = static_cast(iTabChild.get()); - } - } - // Synchronously call the parent. SendSetCookieString(uriParams, !!isForeign, cookieString, serverTime, - aFromHttp, IPC::SerializedLoadContext(aChannel), tabChild); + aFromHttp, IPC::SerializedLoadContext(aChannel)); return NS_OK; } diff --git a/netwerk/cookie/CookieServiceParent.cpp b/netwerk/cookie/CookieServiceParent.cpp index 7cc0c57a12b..90cb528574f 100644 --- a/netwerk/cookie/CookieServiceParent.cpp +++ b/netwerk/cookie/CookieServiceParent.cpp @@ -4,44 +4,37 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/net/CookieServiceParent.h" -#include "mozilla/dom/PBrowserParent.h" -#include "mozilla/net/NeckoParent.h" #include "mozilla/ipc/URIUtils.h" #include "nsCookieService.h" #include "nsNetUtil.h" -#include "nsPrintfCString.h" using namespace mozilla::ipc; -using mozilla::dom::PBrowserParent; -using mozilla::net::NeckoParent; + +static void +GetAppInfoFromLoadContext(const IPC::SerializedLoadContext &aLoadContext, + uint32_t& aAppId, + bool& aIsInBrowserElement, + bool& aIsPrivate) +{ + // TODO: bug 782542: what to do when we get null loadContext? For now assume + // NECKO_NO_APP_ID. + aAppId = NECKO_NO_APP_ID; + aIsInBrowserElement = false; + aIsPrivate = false; + + if (aLoadContext.IsNotNull()) { + aAppId = aLoadContext.mAppId; + aIsInBrowserElement = aLoadContext.mIsInBrowserElement; + } + + if (aLoadContext.IsPrivateBitValid()) + aIsPrivate = aLoadContext.mUsePrivateBrowsing; +} namespace mozilla { namespace net { -MOZ_WARN_UNUSED_RESULT -static bool -GetAppInfoFromParams(const IPC::SerializedLoadContext &aLoadContext, - PBrowserParent* aBrowser, - uint32_t& aAppId, - bool& aIsInBrowserElement) -{ - aAppId = NECKO_NO_APP_ID; - aIsInBrowserElement = false; - - const char* error = NeckoParent::GetValidatedAppInfo(aLoadContext, aBrowser, - &aAppId, - &aIsInBrowserElement); - if (error) { - NS_WARNING(nsPrintfCString("CookieServiceParent: GetAppInfoFromParams: " - "FATAL error: %s: KILLING CHILD PROCESS\n", - error).get()); - return false; - } - - return true; -} - CookieServiceParent::CookieServiceParent() { // Instantiate the cookieservice via the service manager, so it sticks around @@ -64,7 +57,6 @@ CookieServiceParent::RecvGetCookieString(const URIParams& aHost, const bool& aFromHttp, const IPC::SerializedLoadContext& aLoadContext, - PBrowserParent* aBrowser, nsCString* aResult) { if (!mCookieService) @@ -78,11 +70,7 @@ CookieServiceParent::RecvGetCookieString(const URIParams& aHost, uint32_t appId; bool isInBrowserElement, isPrivate; - bool valid = GetAppInfoFromParams(aLoadContext, aBrowser, appId, - isInBrowserElement); - if (!valid) { - return false; - } + GetAppInfoFromLoadContext(aLoadContext, appId, isInBrowserElement, isPrivate); mCookieService->GetCookieStringInternal(hostURI, aIsForeign, aFromHttp, appId, isInBrowserElement, isPrivate, *aResult); @@ -96,8 +84,7 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost, const nsCString& aServerTime, const bool& aFromHttp, const IPC::SerializedLoadContext& - aLoadContext, - PBrowserParent* aBrowser) + aLoadContext) { if (!mCookieService) return true; @@ -110,11 +97,7 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost, uint32_t appId; bool isInBrowserElement, isPrivate; - bool valid = GetAppInfoFromParams(aLoadContext, aBrowser, appId, - isInBrowserElement); - if (!valid) { - return false; - } + GetAppInfoFromLoadContext(aLoadContext, appId, isInBrowserElement, isPrivate); nsDependentCString cookieString(aCookieString, 0); //TODO: bug 812475, pass a real channel object diff --git a/netwerk/cookie/CookieServiceParent.h b/netwerk/cookie/CookieServiceParent.h index ec228ae6a67..d51a209287f 100644 --- a/netwerk/cookie/CookieServiceParent.h +++ b/netwerk/cookie/CookieServiceParent.h @@ -13,9 +13,6 @@ class nsCookieService; class nsIIOService; namespace mozilla { -namespace dom { - class PBrowserParent; -} namespace net { class CookieServiceParent : public PCookieServiceParent @@ -30,7 +27,6 @@ protected: const bool& aFromHttp, const IPC::SerializedLoadContext& loadContext, - mozilla::dom::PBrowserParent* aBrowser, nsCString* aResult); virtual bool RecvSetCookieString(const URIParams& aHost, @@ -39,8 +35,7 @@ protected: const nsCString& aServerTime, const bool& aFromHttp, const IPC::SerializedLoadContext& - loadContext, - mozilla::dom::PBrowserParent* aBrowser); + loadContext); nsRefPtr mCookieService; }; diff --git a/netwerk/cookie/PCookieService.ipdl b/netwerk/cookie/PCookieService.ipdl index 5a004a9b158..768eabf1f53 100644 --- a/netwerk/cookie/PCookieService.ipdl +++ b/netwerk/cookie/PCookieService.ipdl @@ -6,7 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include protocol PNecko; -include protocol PBrowser; include URIParams; include "SerializedLoadContext.h"; @@ -65,8 +64,7 @@ parent: sync GetCookieString(URIParams host, bool isForeign, bool fromHttp, - SerializedLoadContext loadContext, - nullable PBrowser browser) + SerializedLoadContext loadContext) returns (nsCString result); /* @@ -103,8 +101,7 @@ parent: nsCString cookieString, nsCString serverTime, bool fromHttp, - SerializedLoadContext loadContext, - nullable PBrowser browser); + SerializedLoadContext loadContext); __delete__(); }; diff --git a/netwerk/ipc/NeckoChild.cpp b/netwerk/ipc/NeckoChild.cpp index 195495a2ee4..2eaa36849e1 100644 --- a/netwerk/ipc/NeckoChild.cpp +++ b/netwerk/ipc/NeckoChild.cpp @@ -86,8 +86,7 @@ NeckoChild::DeallocPHttpChannel(PHttpChannelChild* channel) } PFTPChannelChild* -NeckoChild::AllocPFTPChannel(PBrowserChild* aBrowser, - const SerializedLoadContext& aSerialized) +NeckoChild::AllocPFTPChannel() { // We don't allocate here: see FTPChannelChild::AsyncOpen() NS_RUNTIMEABORT("AllocPFTPChannel should not be called"); @@ -141,8 +140,7 @@ NeckoChild::DeallocPWyciwygChannel(PWyciwygChannelChild* channel) } PWebSocketChild* -NeckoChild::AllocPWebSocket(PBrowserChild* browser, - const SerializedLoadContext& aSerialized) +NeckoChild::AllocPWebSocket(PBrowserChild* browser) { NS_NOTREACHED("AllocPWebSocket should not be called"); return nullptr; diff --git a/netwerk/ipc/NeckoChild.h b/netwerk/ipc/NeckoChild.h index c8c10de230e..1b3455a4c72 100644 --- a/netwerk/ipc/NeckoChild.h +++ b/netwerk/ipc/NeckoChild.h @@ -33,10 +33,9 @@ protected: virtual bool DeallocPCookieService(PCookieServiceChild*); virtual PWyciwygChannelChild* AllocPWyciwygChannel(); virtual bool DeallocPWyciwygChannel(PWyciwygChannelChild*); - virtual PFTPChannelChild* AllocPFTPChannel(PBrowserChild* aBrowser, - const SerializedLoadContext& aSerialized); + virtual PFTPChannelChild* AllocPFTPChannel(); virtual bool DeallocPFTPChannel(PFTPChannelChild*); - virtual PWebSocketChild* AllocPWebSocket(PBrowserChild*, const SerializedLoadContext&); + virtual PWebSocketChild* AllocPWebSocket(PBrowserChild*); virtual bool DeallocPWebSocket(PWebSocketChild*); virtual PTCPSocketChild* AllocPTCPSocket(const nsString& aHost, const uint16_t& aPort, diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp index a550d4568f8..9c5e80739a7 100644 --- a/netwerk/ipc/NeckoParent.cpp +++ b/netwerk/ipc/NeckoParent.cpp @@ -17,8 +17,7 @@ #include "mozilla/dom/network/TCPSocketParent.h" #include "mozilla/ipc/URIUtils.h" #include "mozilla/Preferences.h" -#include "mozilla/LoadContext.h" -#include "nsPrintfCString.h" + #include "nsHTMLDNSPrefetch.h" #include "nsIAppsService.h" #include "nsEscape.h" @@ -26,7 +25,6 @@ using mozilla::dom::TabParent; using mozilla::net::PTCPSocketParent; using mozilla::dom::TCPSocketParent; -using IPC::SerializedLoadContext; namespace mozilla { namespace net { @@ -59,116 +57,11 @@ NeckoParent::~NeckoParent() { } -static PBOverrideStatus -PBOverrideStatusFromLoadContext(const SerializedLoadContext& aSerialized) -{ - if (!aSerialized.IsNotNull() && aSerialized.IsPrivateBitValid()) { - return aSerialized.mUsePrivateBrowsing ? - kPBOverride_Private : - kPBOverride_NotPrivate; - } - return kPBOverride_Unset; -} - -const char* -NeckoParent::GetValidatedAppInfo(const SerializedLoadContext& aSerialized, - PBrowserParent* aBrowser, - uint32_t* aAppId, - bool* aInBrowserElement) -{ - if (!gDisableIPCSecurity) { - if (!aBrowser) { - return "missing required PBrowser argument"; - } - if (!aSerialized.IsNotNull()) { - return "SerializedLoadContext from child is null"; - } - } - - *aAppId = NECKO_UNKNOWN_APP_ID; - *aInBrowserElement = false; - - if (aBrowser) { - nsRefPtr tabParent = static_cast(aBrowser); - - *aAppId = tabParent->OwnOrContainingAppId(); - *aInBrowserElement = tabParent->IsBrowserElement(); - - if (*aAppId == NECKO_UNKNOWN_APP_ID) { - return "TabParent reports appId=NECKO_UNKNOWN_APP_ID!"; - } - // We may get appID=NO_APP if child frame is neither a browser nor an app - if (*aAppId == NECKO_NO_APP_ID) { - if (tabParent->HasOwnApp()) { - return "TabParent reports NECKO_NO_APP_ID but also is an app"; - } - if (!gDisableIPCSecurity && tabParent->IsBrowserElement()) { - //