Bug 1119692 - Part 2: Always use scheme jar:remoteopenfile: for out-of-process apps to ease sandboxing code. r=fabrice
☠☠ backed out by 7fc523df399d ☠ ☠
authorTing-Yu Chou <janus926@gmail.com>
Mon, 17 Aug 2015 10:30:22 +0800
changeset 288052 1620bf9f8f2a28b8e965e885754dc5e27fc2658c
parent 288051 0d75db15b6ed6db4fdfcc1fd0775736f09995d25
child 288053 adab97506c343756651670bb9e8486e8ee676ae5
push id4792
push useryura.zenevich@gmail.com
push dateWed, 26 Aug 2015 20:00:52 +0000
reviewersfabrice
bugs1119692
milestone43.0a1
Bug 1119692 - Part 2: Always use scheme jar:remoteopenfile: for out-of-process apps to ease sandboxing code. r=fabrice
netwerk/protocol/app/AppProtocolHandler.cpp
--- 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);