diff --git a/content/base/test/test_child_process_shutdown_message.html b/content/base/test/test_child_process_shutdown_message.html index dfebea910c74..40d5c7f6bea2 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 fbc33ba1675c..6ffd2e9ec7c8 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 7bf55a466590..6861ecac3d61 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 c1ba521b9bbd..29961ca44ac7 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 4d9b1e56d461..356e8f0f92ff 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 1366f54dd27b..f0836eacd35a 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 fe4e0c722640..7cb1971aaf72 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 704288f7b260..514fb5824b65 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 a7270b93d557..7ccc34c952b6 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 eb480234d384..03fe4aa97ecc 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 e565c1f1ceb8..3e76ee766aaa 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 3a490b06084a..3e445f3d950f 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 bd640e3c9b7d..c44528fc8f70 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/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index cd6f4a10a1ff..f3680aa1e1cf 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -773,9 +773,6 @@ pref("security.fileuri.strict_origin_policy", true); // the results pref("network.allow-experiments", true); -// Turn off interprocess security checks. Needed to run xpcshell tests. -pref("network.disable.ipc.security", false); - // Default action for unlisted external protocol handlers pref("network.protocol-handler.external-default", true); // OK to load pref("network.protocol-handler.warn-external-default", true); // warn before load diff --git a/netwerk/cookie/CookieServiceChild.cpp b/netwerk/cookie/CookieServiceChild.cpp index d0e88c578103..a20b33bff158 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 ef9655a69c80..90cb528574f6 100644 --- a/netwerk/cookie/CookieServiceParent.cpp +++ b/netwerk/cookie/CookieServiceParent.cpp @@ -4,44 +4,32 @@ * 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; -MOZ_WARN_UNUSED_RESULT -static bool -GetAppInfoFromParams(const IPC::SerializedLoadContext &aLoadContext, - PBrowserParent* aBrowser, - uint32_t& aAppId, - bool& aIsInBrowserElement, - bool& aIsPrivate) +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; - 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; + if (aLoadContext.IsNotNull()) { + aAppId = aLoadContext.mAppId; + aIsInBrowserElement = aLoadContext.mIsInBrowserElement; } if (aLoadContext.IsPrivateBitValid()) aIsPrivate = aLoadContext.mUsePrivateBrowsing; - - return true; } namespace mozilla { @@ -69,7 +57,6 @@ CookieServiceParent::RecvGetCookieString(const URIParams& aHost, const bool& aFromHttp, const IPC::SerializedLoadContext& aLoadContext, - PBrowserParent* aBrowser, nsCString* aResult) { if (!mCookieService) @@ -83,15 +70,10 @@ CookieServiceParent::RecvGetCookieString(const URIParams& aHost, uint32_t appId; bool isInBrowserElement, isPrivate; - bool valid = GetAppInfoFromParams(aLoadContext, aBrowser, appId, - isInBrowserElement, isPrivate); - if (!valid) { - return false; - } + GetAppInfoFromLoadContext(aLoadContext, appId, isInBrowserElement, isPrivate); mCookieService->GetCookieStringInternal(hostURI, aIsForeign, aFromHttp, appId, - isInBrowserElement, isPrivate, - *aResult); + isInBrowserElement, isPrivate, *aResult); return true; } @@ -102,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; @@ -116,11 +97,7 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost, uint32_t appId; bool isInBrowserElement, isPrivate; - bool valid = GetAppInfoFromParams(aLoadContext, aBrowser, appId, - isInBrowserElement, isPrivate); - 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 ec228ae6a67e..d51a209287ff 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 5a004a9b1581..768eabf1f53e 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 eb415269a2d0..d47242928604 100644 --- a/netwerk/ipc/NeckoChild.cpp +++ b/netwerk/ipc/NeckoChild.cpp @@ -14,22 +14,17 @@ #include "mozilla/net/FTPChannelChild.h" #include "mozilla/net/WebSocketChannelChild.h" #include "mozilla/dom/network/TCPSocketChild.h" -#include "mozilla/Preferences.h" using mozilla::dom::TCPSocketChild; namespace mozilla { namespace net { -static bool gDisableIPCSecurity = false; -static const char kPrefDisableIPCSecurity[] = "network.disable.ipc.security"; - PNeckoChild *gNeckoChild = nullptr; // C++ file contents NeckoChild::NeckoChild() { - Preferences::AddBoolVarCache(&gDisableIPCSecurity, kPrefDisableIPCSecurity); } NeckoChild::~NeckoChild() @@ -85,8 +80,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"); @@ -140,8 +134,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 9bf3021bc450..8006c4c86937 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 7d8aceb04498..ae43859f493c 100644 --- a/netwerk/ipc/NeckoParent.cpp +++ b/netwerk/ipc/NeckoParent.cpp @@ -14,142 +14,30 @@ #include "mozilla/net/WebSocketChannelParent.h" #include "mozilla/dom/TabParent.h" #include "mozilla/dom/network/TCPSocketParent.h" -#include "mozilla/Preferences.h" -#include "mozilla/LoadContext.h" -#include "nsPrintfCString.h" + #include "nsHTMLDNSPrefetch.h" using mozilla::dom::TabParent; using mozilla::net::PTCPSocketParent; using mozilla::dom::TCPSocketParent; -using IPC::SerializedLoadContext; namespace mozilla { namespace net { -static bool gDisableIPCSecurity = false; -static const char kPrefDisableIPCSecurity[] = "network.disable.ipc.security"; - // C++ file contents NeckoParent::NeckoParent() { - Preferences::AddBoolVarCache(&gDisableIPCSecurity, kPrefDisableIPCSecurity); } 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()) { - //