Bug 1119692 - Part 2: Always use scheme jar:remoteopenfile: for out-of-process apps to ease sandboxing code. r=fabrice
--- a/netwerk/protocol/app/AppProtocolHandler.cpp
+++ b/netwerk/protocol/app/AppProtocolHandler.cpp
@@ -460,22 +460,21 @@ AppProtocolHandler::NewChannel2(nsIURI*
nsRefPtr<nsIChannel> dummyChannel = new DummyChannel();
dummyChannel->SetLoadInfo(aLoadInfo);
dummyChannel.forget(aResult);
return NS_OK;
}
mAppInfoCache.Put(host, appInfo);
}
- bool noRemote = (appInfo->mIsCoreApp ||
- XRE_IsParentProcess());
-
- // In-parent and CoreApps can directly access files, so use jar:file://
- nsAutoCString jarSpec(noRemote ? "jar:file://"
- : "jar:remoteopenfile://");
+ // Even core apps are on /system partition and can be accessed directly, but
+ // to ease sandboxing code not to handle the special case of core apps, only
+ // use scheme jar:file in parent, see bug 1119692 comment 20.
+ nsAutoCString jarSpec(XRE_IsParentProcess() ? "jar:file://"
+ : "jar:remoteopenfile://");
jarSpec += NS_ConvertUTF16toUTF8(appInfo->mPath) +
NS_LITERAL_CSTRING("/application.zip!") +
fileSpec;
nsCOMPtr<nsIURI> jarURI;
rv = NS_NewURI(getter_AddRefs(jarURI),
jarSpec, nullptr, nullptr);
NS_ENSURE_SUCCESS(rv, rv);