Bug 1307467 - Remove RemoteFileOpen, and all app:// related code from JAR channels. r=bagder
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 21 Oct 2016 00:08:57 +0200
changeset 320274 dce4d4b3e4e89ca800e02b9825cb752402665eb1
parent 320273 74b268465bc724c303f44de6fd3bb939c56f52de
child 320275 4b76a90d5cafb31b6c9a03a4f93c50608626c26d
push id30895
push userphilringnalda@gmail.com
push dateTue, 01 Nov 2016 01:31:50 +0000
treeherdermozilla-central@62c5218b7325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs1307467, 815523
milestone52.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 1307467 - Remove RemoteFileOpen, and all app:// related code from JAR channels. r=bagder Removes things added in bug 815523 MozReview-Commit-ID: FuXQceHGLhf
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARChannel.h
modules/libjar/nsJARProtocolHandler.cpp
modules/libjar/test/unit/head_ipc.js
modules/libjar/test/unit/test_jarchannel.js
modules/libjar/test/unit/test_jarchannel_e10s.js
modules/libjar/test/unit/xpcshell.ini
netwerk/ipc/NeckoChild.cpp
netwerk/ipc/NeckoChild.h
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/NeckoParent.h
netwerk/ipc/PNecko.ipdl
netwerk/ipc/PRemoteOpenFile.ipdl
netwerk/ipc/RemoteOpenFileChild.cpp
netwerk/ipc/RemoteOpenFileChild.h
netwerk/ipc/RemoteOpenFileParent.cpp
netwerk/ipc/RemoteOpenFileParent.h
netwerk/ipc/moz.build
netwerk/ipc/nsIRemoteOpenFileListener.idl
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -18,17 +18,16 @@
 #include "nsContentSecurityManager.h"
 
 #include "nsIScriptSecurityManager.h"
 #include "nsIPrincipal.h"
 #include "nsIFileURL.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
-#include "mozilla/net/RemoteOpenFileChild.h"
 #include "nsITabChild.h"
 #include "private/pprio.h"
 #include "nsInputStreamPump.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
@@ -196,17 +195,16 @@ nsJARChannel::nsJARChannel()
     : mOpened(false)
     , mAppURI(nullptr)
     , mContentDisposition(0)
     , mContentLength(-1)
     , mLoadFlags(LOAD_NORMAL)
     , mStatus(NS_OK)
     , mIsPending(false)
     , mIsUnsafe(true)
-    , mOpeningRemote(false)
     , mBlockRemoteFiles(false)
 {
     mBlockRemoteFiles = Preferences::GetBool("network.jar.block-remote-files", false);
 
     // hold an owning reference to the jar handler
     NS_ADDREF(gJarHandler);
 }
 
@@ -220,17 +218,16 @@ nsJARChannel::~nsJARChannel()
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(nsJARChannel,
                             nsHashPropertyBag,
                             nsIRequest,
                             nsIChannel,
                             nsIStreamListener,
                             nsIRequestObserver,
-                            nsIRemoteOpenFileListener,
                             nsIThreadRetargetableRequest,
                             nsIThreadRetargetableStreamListener,
                             nsIJARChannel)
 
 nsresult
 nsJARChannel::Init(nsIURI *uri)
 {
     nsresult rv;
@@ -351,75 +348,17 @@ nsJARChannel::LookupFile(bool aAllowAsyn
     NS_UnescapeURL(mJarEntry);
 
     // try to get a nsIFile directly from the url, which will often succeed.
     {
         nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mJarBaseURI);
         if (fileURL)
             fileURL->GetFile(getter_AddRefs(mJarFile));
     }
-    // if we're in child process and have special "remoteopenfile:://" scheme,
-    // create special nsIFile that gets file handle from parent when opened.
-    if (!mJarFile && !gJarHandler->IsMainProcess()) {
-        nsAutoCString scheme;
-        rv = mJarBaseURI->GetScheme(scheme);
-        if (NS_SUCCEEDED(rv) && scheme.EqualsLiteral("remoteopenfile")) {
-            RefPtr<RemoteOpenFileChild> remoteFile = new RemoteOpenFileChild();
-            rv = remoteFile->Init(mJarBaseURI, mAppURI);
-            NS_ENSURE_SUCCESS(rv, rv);
-            mJarFile = remoteFile;
 
-            nsIZipReaderCache *jarCache = gJarHandler->JarCache();
-            if (jarCache) {
-                bool cached = false;
-                rv = jarCache->IsCached(mJarFile, &cached);
-                if (NS_SUCCEEDED(rv) && cached) {
-                    // zipcache already has file mmapped: don't open on parent,
-                    // just return and proceed to cache hit in CreateJarInput().
-                    // When the file descriptor is needed, get it from JAR cache
-                    // if available, otherwise do the remote open to get a new
-                    // one.
-                    #if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-                    // Windows/OSX desktop builds skip remoting, we don't need
-                    // file descriptor here.
-                    return NS_OK;
-                    #else
-                    PRFileDesc *fd = nullptr;
-                    jarCache->GetFd(mJarFile, &fd);
-                    if (fd) {
-                        return SetRemoteNSPRFileDesc(fd);
-                    }
-                    #endif
-                }
-            }
-
-            if (!aAllowAsync) {
-                mJarFile = nullptr;
-                return NS_OK;
-            }
-
-            mOpeningRemote = true;
-
-            if (gJarHandler->RemoteOpenFileInProgress(remoteFile, this)) {
-                // JarHandler will trigger OnRemoteFileOpen() after the first
-                // request for this file completes and we'll get a JAR cache
-                // hit.
-                return NS_OK;
-            }
-
-            // Open file on parent: OnRemoteFileOpenComplete called when done
-            nsCOMPtr<nsITabChild> tabChild;
-            NS_QueryNotificationCallbacks(this, tabChild);
-            nsCOMPtr<nsILoadContext> loadContext;
-            NS_QueryNotificationCallbacks(this, loadContext);
-            rv = remoteFile->AsyncRemoteFileOpen(PR_RDONLY, this, tabChild,
-                                                 loadContext);
-            NS_ENSURE_SUCCESS(rv, rv);
-        }
-    }
     // try to handle a nested jar
     if (!mJarFile) {
         nsCOMPtr<nsIJARURI> jarURI = do_QueryInterface(mJarBaseURI);
         if (jarURI) {
             nsCOMPtr<nsIFileURL> fileURL;
             nsCOMPtr<nsIURI> innerJarURI;
             rv = jarURI->GetJARFile(getter_AddRefs(innerJarURI));
             if (NS_SUCCEEDED(rv))
@@ -470,34 +409,16 @@ void
 nsJARChannel::FireOnProgress(uint64_t aProgress)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mProgressSink);
 
   mProgressSink->OnProgress(this, nullptr, aProgress, mContentLength);
 }
 
-nsresult
-nsJARChannel::SetRemoteNSPRFileDesc(PRFileDesc *fd)
-{
-    PROsfd osfd = dup(PR_FileDesc2NativeHandle(fd));
-    if (osfd == -1) {
-        return NS_ERROR_FAILURE;
-    }
-
-    RemoteOpenFileChild* remoteFile =
-        static_cast<RemoteOpenFileChild*>(mJarFile.get());
-    nsresult rv = remoteFile->SetNSPRFileDesc(PR_ImportFile(osfd));
-    if (NS_FAILED(rv)) {
-        close(osfd);
-    }
-
-    return rv;
-}
-
 //-----------------------------------------------------------------------------
 // nsIRequest
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsJARChannel::GetName(nsACString &result)
 {
     return mJarURI->GetSpec(result);
@@ -898,19 +819,18 @@ nsJARChannel::AsyncOpen(nsIStreamListene
             return rv;
         }
         if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
             rv = channel->AsyncOpen2(downloader);
         }
         else {
             rv = channel->AsyncOpen(downloader, nullptr);
         }
-    } else if (mOpeningRemote) {
-        // nothing to do: already asked parent to open file.
-    } else {
+    }
+    else {
         rv = OpenLocalFile();
     }
 
     if (NS_FAILED(rv)) {
         mIsPending = false;
         mListenerContext = nullptr;
         mListener = nullptr;
         return rv;
@@ -1085,60 +1005,16 @@ nsJARChannel::OnDownloadComplete(MemoryD
     }
 
     if (NS_FAILED(status)) {
         NotifyError(status);
     }
 }
 
 //-----------------------------------------------------------------------------
-// nsIRemoteOpenFileListener
-//-----------------------------------------------------------------------------
-nsresult
-nsJARChannel::OnRemoteFileOpenComplete(nsresult aOpenStatus)
-{
-    nsresult rv = aOpenStatus;
-
-    // NS_ERROR_ALREADY_OPENED here means we'll hit JAR cache in
-    // OpenLocalFile().
-    if (NS_SUCCEEDED(rv) || rv == NS_ERROR_ALREADY_OPENED) {
-        #if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-        // Windows/OSX desktop builds skip remoting, we don't need file
-        // descriptor here.
-        #else
-        // Set file descriptor from Jar cache into remote Jar file, if it
-        // has not been set previously.
-        mozilla::AutoFDClose fd;
-        nsresult rv2 = mJarFile->OpenNSPRFileDesc(PR_RDONLY, 0, &fd.rwget());
-        if (NS_FAILED(rv2)) {
-            nsIZipReaderCache *jarCache = gJarHandler->JarCache();
-            if (!jarCache) {
-                rv = NS_ERROR_FAILURE;
-            }
-            PRFileDesc *jar_fd = nullptr;
-            jarCache->GetFd(mJarFile, &jar_fd);
-            // If we failed to get fd here, an error rv would be returned
-            // by SetRemoteNSPRFileDesc(), which would then stop the
-            // channel by NotifyError().
-            rv = SetRemoteNSPRFileDesc(jar_fd);
-        }
-        #endif
-        if (NS_SUCCEEDED(rv) || rv == NS_ERROR_ALREADY_OPENED) {
-            rv = OpenLocalFile();
-        }
-    }
-
-    if (NS_FAILED(rv)) {
-        NotifyError(rv);
-    }
-
-    return NS_OK;
-}
-
-//-----------------------------------------------------------------------------
 // nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsJARChannel::OnStartRequest(nsIRequest *req, nsISupports *ctx)
 {
     LOG(("nsJARChannel::OnStartRequest [this=%x %s]\n", this, mSpec.get()));
 
--- a/modules/libjar/nsJARChannel.h
+++ b/modules/libjar/nsJARChannel.h
@@ -8,17 +8,16 @@
 
 #include "mozilla/net/MemoryDownloader.h"
 #include "nsIJARChannel.h"
 #include "nsIJARURI.h"
 #include "nsIInputStreamPump.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIProgressEventSink.h"
 #include "nsIStreamListener.h"
-#include "nsIRemoteOpenFileListener.h"
 #include "nsIZipReader.h"
 #include "nsILoadGroup.h"
 #include "nsILoadInfo.h"
 #include "nsIThreadRetargetableRequest.h"
 #include "nsIThreadRetargetableStreamListener.h"
 #include "nsHashPropertyBag.h"
 #include "nsIFile.h"
 #include "nsIURI.h"
@@ -29,45 +28,42 @@
 class nsJARInputThunk;
 class nsInputStreamPump;
 
 //-----------------------------------------------------------------------------
 
 class nsJARChannel final : public nsIJARChannel
                          , public mozilla::net::MemoryDownloader::IObserver
                          , public nsIStreamListener
-                         , public nsIRemoteOpenFileListener
                          , public nsIThreadRetargetableRequest
                          , public nsIThreadRetargetableStreamListener
                          , public nsHashPropertyBag
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSIREQUEST
     NS_DECL_NSICHANNEL
     NS_DECL_NSIJARCHANNEL
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
-    NS_DECL_NSIREMOTEOPENFILELISTENER
     NS_DECL_NSITHREADRETARGETABLEREQUEST
     NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
     nsJARChannel();
 
     nsresult Init(nsIURI *uri);
 
 private:
     virtual ~nsJARChannel();
 
     nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
     nsresult LookupFile(bool aAllowAsync);
     nsresult OpenLocalFile();
     void NotifyError(nsresult aError);
     void FireOnProgress(uint64_t aProgress);
-    nsresult SetRemoteNSPRFileDesc(PRFileDesc *fd);
     virtual void OnDownloadComplete(mozilla::net::MemoryDownloader* aDownloader,
                                     nsIRequest* aRequest,
                                     nsISupports* aCtxt,
                                     nsresult aStatus,
                                     mozilla::net::MemoryDownloader::Data aData)
         override;
 
     nsCString                       mSpec;
@@ -91,17 +87,16 @@ private:
     /* mContentDisposition is uninitialized if mContentDispositionHeader is
      * empty */
     uint32_t                        mContentDisposition;
     int64_t                         mContentLength;
     uint32_t                        mLoadFlags;
     nsresult                        mStatus;
     bool                            mIsPending;
     bool                            mIsUnsafe;
-    bool                            mOpeningRemote;
 
     mozilla::net::MemoryDownloader::Data mTempMem;
     nsCOMPtr<nsIInputStreamPump>    mPump;
     // mRequest is only non-null during OnStartRequest, so we'll have a pointer
     // to the request if we get called back via RetargetDeliveryTo.
     nsCOMPtr<nsIRequest>            mRequest;
     nsCOMPtr<nsIFile>               mJarFile;
     nsCOMPtr<nsIURI>                mJarBaseURI;
--- a/modules/libjar/nsJARProtocolHandler.cpp
+++ b/modules/libjar/nsJARProtocolHandler.cpp
@@ -12,17 +12,16 @@
 #include "nsJARURI.h"
 #include "nsIURL.h"
 #include "nsJARChannel.h"
 #include "nsXPIDLString.h"
 #include "nsString.h"
 #include "nsNetCID.h"
 #include "nsIMIMEService.h"
 #include "nsMimeTypes.h"
-#include "nsIRemoteOpenFileListener.h"
 #include "nsIHashable.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "nsTArray.h"
 
 static NS_DEFINE_CID(kZipReaderCacheCID, NS_ZIPREADERCACHE_CID);
 
 #define NS_JAR_CACHE_SIZE 32
deleted file mode 100644
--- a/modules/libjar/test/unit/head_ipc.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * If we're running in e10s, determines whether we're in child directory or
- * not.
- */
-
-var inChild = false;
-var filePrefix = "";
-try {
-  inChild = Components.classes["@mozilla.org/xre/runtime;1"].
-              getService(Components.interfaces.nsIXULRuntime).processType
-              != Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
-  if (inChild) {
-    // use "jar:remoteopenfile://" in child instead of "jar:file://"
-    filePrefix = "remoteopen";
-  }
-} 
-catch (e) { }
--- a/modules/libjar/test/unit/test_jarchannel.js
+++ b/modules/libjar/test/unit/test_jarchannel.js
@@ -26,18 +26,17 @@ const obs = Cc["@mozilla.org/observer-se
 
 const nsIBinaryInputStream = ctor("@mozilla.org/binaryinputstream;1",
                                "nsIBinaryInputStream",
                                "setInputStream"
                                );
 
 const fileBase = "test_bug637286.zip";
 const file = do_get_file("data/" + fileBase);
-// on child we'll test with jar:remoteopenfile:// instead of jar:file://
-const jarBase = "jar:" + filePrefix + ios.newFileURI(file).spec + "!";
+const jarBase = "jar:" + ios.newFileURI(file).spec + "!";
 const tmpDir = dirSvc.get("TmpD", Ci.nsIFile);
 
 function Listener(callback) {
     this._callback = callback;
 }
 Listener.prototype = {
     gotStartRequest: false,
     available: -1,
@@ -89,162 +88,129 @@ function testAsync() {
 }
 
 add_test(testAsync);
 // Run same test again so we test the codepath for a zipcache hit
 add_test(testAsync);
 
 /**
  * Basic test for nsIZipReader.
- * This relies on the jar cache to succeed in child processes.
  */
 function testZipEntry() {
     var uri = jarBase + "/inner40.zip";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true})
                       .QueryInterface(Ci.nsIJARChannel);
     var entry = chan.zipEntry;
     do_check_true(entry.CRC32 == 0x8b635486);
     do_check_true(entry.realSize == 184);
     run_next_test();
 }
 
 add_test(testZipEntry);
 
-// In e10s child processes we don't currently support 
-// 1) synchronously opening jar files on parent
-// 2) nested jar channels in e10s: (app:// doesn't use them).
-// 3) we can't do file lock checks on android, so skip those tests too.
-if (!inChild) {
 
-  /**
-   * Basic reading test for synchronously opened jar channels
-   */
-  add_test(function testSync() {
-      var uri = jarBase + "/inner40.zip";
-      var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-      var stream = chan.open2();
-      do_check_true(chan.contentLength > 0);
-      do_check_eq(stream.available(), chan.contentLength);
-      stream.close();
-      stream.close(); // should still not throw
+/**
+ * Basic reading test for synchronously opened jar channels
+ */
+add_test(function testSync() {
+    var uri = jarBase + "/inner40.zip";
+    var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
+    var stream = chan.open2();
+    do_check_true(chan.contentLength > 0);
+    do_check_eq(stream.available(), chan.contentLength);
+    stream.close();
+    stream.close(); // should still not throw
 
-      run_next_test();
-  });
+    run_next_test();
+});
 
 
-  /**
-   * Basic reading test for synchronously opened, nested jar channels
-   */
-  add_test(function testSyncNested() {
-      var uri = "jar:" + jarBase + "/inner40.zip!/foo";
-      var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-      var stream = chan.open2();
-      do_check_true(chan.contentLength > 0);
-      do_check_eq(stream.available(), chan.contentLength);
-      stream.close();
-      stream.close(); // should still not throw
+/**
+ * Basic reading test for synchronously opened, nested jar channels
+ */
+add_test(function testSyncNested() {
+    var uri = "jar:" + jarBase + "/inner40.zip!/foo";
+    var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
+    var stream = chan.open2();
+    do_check_true(chan.contentLength > 0);
+    do_check_eq(stream.available(), chan.contentLength);
+    stream.close();
+    stream.close(); // should still not throw
 
-      run_next_test();
-  });
+    run_next_test();
+});
 
-  /**
-   * Basic reading test for asynchronously opened, nested jar channels
-   */
-  add_test(function testAsyncNested(next) {
-      var uri = "jar:" + jarBase + "/inner40.zip!/foo";
-      var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-      chan.asyncOpen2(new Listener(function(l) {
-          do_check_true(chan.contentLength > 0);
-          do_check_true(l.gotStartRequest);
-          do_check_true(l.gotStopRequest);
-          do_check_eq(l.available, chan.contentLength);
-
-          run_next_test();
-      }));
-  });
+/**
+ * Basic reading test for asynchronously opened, nested jar channels
+ */
+add_test(function testAsyncNested(next) {
+    var uri = "jar:" + jarBase + "/inner40.zip!/foo";
+    var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
+    chan.asyncOpen2(new Listener(function(l) {
+        do_check_true(chan.contentLength > 0);
+        do_check_true(l.gotStartRequest);
+        do_check_true(l.gotStopRequest);
+        do_check_eq(l.available, chan.contentLength);
 
-  /**
-   * Verify that file locks are released when closing a synchronously
-   * opened jar channel stream
-   */
-  add_test(function testSyncCloseUnlocks() {
-      var copy = tmpDir.clone();
-      copy.append(fileBase);
-      file.copyTo(copy.parent, copy.leafName);
-      var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
-      var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-      var stream = chan.open2();
-      do_check_true(chan.contentLength > 0);
-      stream.close();
-
-      // Drop any jar caches
-      obs.notifyObservers(null, "chrome-flush-caches", null);
+        run_next_test();
+    }));
+});
 
-      try {
-          copy.remove(false);
-      }
-      catch (ex) {
-          do_throw(ex);
-      }
-
-      run_next_test();
-  });
+/**
+ * Verify that file locks are released when closing a synchronously
+ * opened jar channel stream
+ */
+add_test(function testSyncCloseUnlocks() {
+    var copy = tmpDir.clone();
+    copy.append(fileBase);
+    file.copyTo(copy.parent, copy.leafName);
+    var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
+    var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
+    var stream = chan.open2();
+    do_check_true(chan.contentLength > 0);
+    stream.close();
 
-  /**
-   * Verify that file locks are released when closing an asynchronously
-   * opened jar channel stream
-   */
-  add_test(function testAsyncCloseUnlocks() {
-      var copy = tmpDir.clone();
-      copy.append(fileBase);
-      file.copyTo(copy.parent, copy.leafName);
-
-      var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
-      var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-
-      chan.asyncOpen2(new Listener(function (l) {
-          do_check_true(chan.contentLength > 0);
+    // Drop any jar caches
+    obs.notifyObservers(null, "chrome-flush-caches", null);
 
-          // Drop any jar caches
-          obs.notifyObservers(null, "chrome-flush-caches", null);
+    try {
+        copy.remove(false);
+    }
+    catch (ex) {
+        do_throw(ex);
+    }
 
-          try {
-              copy.remove(false);
-          }
-          catch (ex) {
-              do_throw(ex);
-          }
+    run_next_test();
+});
 
-          run_next_test();
-      }));
-  });
-
-} // if !inChild
+/**
+ * Verify that file locks are released when closing an asynchronously
+ * opened jar channel stream
+ */
+add_test(function testAsyncCloseUnlocks() {
+    var copy = tmpDir.clone();
+    copy.append(fileBase);
+    file.copyTo(copy.parent, copy.leafName);
 
-if (inChild) {
-    /**
-     * Multiple simultaneous opening test for bug 1048615
-     */
-    add_test(function testSimultaneous() {
-        var uri = jarBase + "/inner1.zip";
+    var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
+    var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
 
-        // Drop any JAR caches
+    chan.asyncOpen2(new Listener(function (l) {
+        do_check_true(chan.contentLength > 0);
+
+        // Drop any jar caches
         obs.notifyObservers(null, "chrome-flush-caches", null);
 
-        // Open multiple channels
-        var num = 10;
-        var chan = [];
-        for (var i = 0; i < num; i++) {
-            chan[i] = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true})
-                             .QueryInterface(Ci.nsIJARChannel);
-            chan[i].asyncOpen2(new Listener(function(l) {}));
+        try {
+            copy.remove(false);
+        }
+        catch (ex) {
+            do_throw(ex);
         }
 
-        // Open the last channel
-        var chan_last = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true})
-                               .QueryInterface(Ci.nsIJARChannel);
-        chan_last.asyncOpen2(new Listener(function(l) { run_next_test(); }));
-    });
-} // if inChild
+        run_next_test();
+    }));
+});
+
 
 function run_test() {
   return run_next_test();
 }
deleted file mode 100644
--- a/modules/libjar/test/unit/test_jarchannel_e10s.js
+++ /dev/null
@@ -1,7 +0,0 @@
-//
-// Run test script in content process instead of chrome (xpcshell's default)
-//
-
-function run_test() {
-  run_test_in_child("../unit/test_jarchannel.js");
-}
--- a/modules/libjar/test/unit/xpcshell.ini
+++ b/modules/libjar/test/unit/xpcshell.ini
@@ -1,10 +1,10 @@
 [DEFAULT]
-head = head_ipc.js
+head =
 tail =
 skip-if = toolkit == 'android' || toolkit == 'gonk'
 support-files =
   data/empty
   data/test_bug333423.zip
   data/test_bug336691.zip
   data/test_bug370103.jar
   data/test_bug379841.zip
@@ -15,17 +15,16 @@ support-files =
   data/test_corrupt.zip
   data/test_corrupt2.zip
   data/test_corrupt3.zip
   data/test_crx_dummy.crx
   data/test_umlaute.zip
   data/uncompressed.zip
 
 [test_jarchannel.js]
-[test_jarchannel_e10s.js]
 skip-if = os == "mac"
 [test_bug278262.js]
 [test_bug333423.js]
 [test_bug336691.js]
 [test_bug370103.js]
 [test_bug379841.js]
 [test_bug407303.js]
 [test_bug453254.js]
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/net/HttpChannelChild.h"
 #include "mozilla/net/CookieServiceChild.h"
 #include "mozilla/net/WyciwygChannelChild.h"
 #include "mozilla/net/FTPChannelChild.h"
 #include "mozilla/net/WebSocketChannelChild.h"
 #include "mozilla/net/WebSocketEventListenerChild.h"
 #include "mozilla/net/DNSRequestChild.h"
-#include "mozilla/net/RemoteOpenFileChild.h"
 #include "mozilla/net/ChannelDiverterChild.h"
 #include "mozilla/net/IPCTransportProvider.h"
 #include "mozilla/dom/network/TCPSocketChild.h"
 #include "mozilla/dom/network/TCPServerSocketChild.h"
 #include "mozilla/dom/network/UDPSocketChild.h"
 #include "mozilla/net/AltDataOutputStreamChild.h"
 
 #ifdef NECKO_PROTOCOL_rtsp
@@ -311,35 +310,16 @@ NeckoChild::AllocPDNSRequestChild(const 
 bool
 NeckoChild::DeallocPDNSRequestChild(PDNSRequestChild* aChild)
 {
   DNSRequestChild *p = static_cast<DNSRequestChild*>(aChild);
   p->ReleaseIPDLReference();
   return true;
 }
 
-PRemoteOpenFileChild*
-NeckoChild::AllocPRemoteOpenFileChild(const SerializedLoadContext& aSerialized,
-                                      const URIParams&,
-                                      const OptionalURIParams&)
-{
-  // We don't allocate here: instead we always use IPDL constructor that takes
-  // an existing RemoteOpenFileChild
-  NS_NOTREACHED("AllocPRemoteOpenFileChild should not be called on child");
-  return nullptr;
-}
-
-bool
-NeckoChild::DeallocPRemoteOpenFileChild(PRemoteOpenFileChild* aChild)
-{
-  RemoteOpenFileChild *p = static_cast<RemoteOpenFileChild*>(aChild);
-  p->ReleaseIPDLReference();
-  return true;
-}
-
 PChannelDiverterChild*
 NeckoChild::AllocPChannelDiverterChild(const ChannelDiverterArgs& channel)
 {
   return new ChannelDiverterChild();;
 }
 
 bool
 NeckoChild::DeallocPChannelDiverterChild(PChannelDiverterChild* child)
--- a/netwerk/ipc/NeckoChild.h
+++ b/netwerk/ipc/NeckoChild.h
@@ -57,21 +57,16 @@ protected:
   virtual bool DeallocPTCPServerSocketChild(PTCPServerSocketChild*) override;
   virtual PUDPSocketChild* AllocPUDPSocketChild(const Principal& aPrincipal,
                                                 const nsCString& aFilter) override;
   virtual bool DeallocPUDPSocketChild(PUDPSocketChild*) override;
   virtual PDNSRequestChild* AllocPDNSRequestChild(const nsCString& aHost,
                                                   const uint32_t& aFlags,
                                                   const nsCString& aNetworkInterface) override;
   virtual bool DeallocPDNSRequestChild(PDNSRequestChild*) override;
-  virtual PRemoteOpenFileChild*
-    AllocPRemoteOpenFileChild(const SerializedLoadContext& aSerialized,
-                              const URIParams&,
-                              const OptionalURIParams&) override;
-  virtual bool DeallocPRemoteOpenFileChild(PRemoteOpenFileChild*) override;
   virtual PDataChannelChild* AllocPDataChannelChild(const uint32_t& channelId) override;
   virtual bool DeallocPDataChannelChild(PDataChannelChild* child) override;
   virtual PRtspControllerChild* AllocPRtspControllerChild() override;
   virtual bool DeallocPRtspControllerChild(PRtspControllerChild*) override;
   virtual PRtspChannelChild*
     AllocPRtspChannelChild(const RtspChannelConnectArgs& aArgs)
                            override;
   virtual bool DeallocPRtspChannelChild(PRtspChannelChild*) override;
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -17,33 +17,30 @@
 #include "mozilla/net/DataChannelParent.h"
 #include "mozilla/net/AltDataOutputStreamParent.h"
 #include "mozilla/Unused.h"
 #ifdef NECKO_PROTOCOL_rtsp
 #include "mozilla/net/RtspControllerParent.h"
 #include "mozilla/net/RtspChannelParent.h"
 #endif
 #include "mozilla/net/DNSRequestParent.h"
-#include "mozilla/net/RemoteOpenFileParent.h"
 #include "mozilla/net/ChannelDiverterParent.h"
 #include "mozilla/net/IPCTransportProvider.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/TabContext.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/dom/network/TCPSocketParent.h"
 #include "mozilla/dom/network/TCPServerSocketParent.h"
 #include "mozilla/dom/network/UDPSocketParent.h"
-#include "mozilla/ipc/URIUtils.h"
 #include "mozilla/LoadContext.h"
 #include "mozilla/AppProcessChecker.h"
 #include "nsPrintfCString.h"
 #include "nsHTMLDNSPrefetch.h"
 #include "nsIAppsService.h"
 #include "nsEscape.h"
-#include "RemoteOpenFileParent.h"
 #include "SerializedLoadContext.h"
 #include "nsAuthInformationHolder.h"
 #include "nsIAuthPromptCallback.h"
 #include "nsPrincipal.h"
 #include "nsINetworkPredictor.h"
 #include "nsINetworkPredictorVerifier.h"
 #include "nsISpeculativeConnect.h"
 
@@ -600,85 +597,16 @@ NeckoParent::RecvPDNSRequestConstructor(
 bool
 NeckoParent::DeallocPDNSRequestParent(PDNSRequestParent* aParent)
 {
   DNSRequestParent *p = static_cast<DNSRequestParent*>(aParent);
   p->Release();
   return true;
 }
 
-PRemoteOpenFileParent*
-NeckoParent::AllocPRemoteOpenFileParent(const SerializedLoadContext& aSerialized,
-                                        const URIParams& aURI,
-                                        const OptionalURIParams& aAppURI)
-{
-  nsCOMPtr<nsIURI> uri = DeserializeURI(aURI);
-  nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(uri);
-  if (!fileURL) {
-    return nullptr;
-  }
-
-  // security checks
-  if (UsingNeckoIPCSecurity()) {
-    nsCOMPtr<nsIAppsService> appsService =
-      do_GetService(APPS_SERVICE_CONTRACTID);
-    if (!appsService) {
-      return nullptr;
-    }
-    bool haveValidBrowser = false;
-    bool hasManage = false;
-    nsCOMPtr<mozIApplication> mozApp;
-    nsTArray<TabContext> contextArray =
-      static_cast<ContentParent*>(Manager())->GetManagedTabContext();
-    for (uint32_t i = 0; i < contextArray.Length(); i++) {
-      TabContext tabContext = contextArray[i];
-      uint32_t appId = tabContext.OwnOrContainingAppId();
-      // Note: this enforces that SerializedLoadContext.appID is one of the apps
-      // in the child process, but there's currently no way to verify the
-      // request is not from a different app in that process.
-      if (appId == aSerialized.mOriginAttributes.mAppId) {
-        nsresult rv = appsService->GetAppByLocalId(appId, getter_AddRefs(mozApp));
-        if (NS_FAILED(rv) || !mozApp) {
-          break;
-        }
-        rv = mozApp->HasPermission("webapps-manage", &hasManage);
-        if (NS_FAILED(rv)) {
-          break;
-        }
-        haveValidBrowser = true;
-        break;
-      }
-    }
-
-    if (!haveValidBrowser) {
-      return nullptr;
-    }
-  }
-
-  RemoteOpenFileParent* parent = new RemoteOpenFileParent(fileURL);
-  return parent;
-}
-
-bool
-NeckoParent::RecvPRemoteOpenFileConstructor(
-                PRemoteOpenFileParent* aActor,
-                const SerializedLoadContext& aSerialized,
-                const URIParams& aFileURI,
-                const OptionalURIParams& aAppURI)
-{
-  return static_cast<RemoteOpenFileParent*>(aActor)->OpenSendCloseDelete();
-}
-
-bool
-NeckoParent::DeallocPRemoteOpenFileParent(PRemoteOpenFileParent* actor)
-{
-  delete actor;
-  return true;
-}
-
 bool
 NeckoParent::RecvSpeculativeConnect(const URIParams& aURI, const bool& aAnonymous)
 {
   nsCOMPtr<nsISpeculativeConnect> speculator(gIOService);
   nsCOMPtr<nsIURI> uri = DeserializeURI(aURI);
   if (uri && speculator) {
     if (aAnonymous) {
       speculator->SpeculativeAnonymousConnect(uri, nullptr);
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -124,29 +124,16 @@ protected:
   virtual PWebSocketParent*
     AllocPWebSocketParent(const PBrowserOrId& browser,
                           const SerializedLoadContext& aSerialized,
                           const uint32_t& aSerial) override;
   virtual bool DeallocPWebSocketParent(PWebSocketParent*) override;
   virtual PTCPSocketParent* AllocPTCPSocketParent(const nsString& host,
                                                   const uint16_t& port) override;
 
-  virtual PRemoteOpenFileParent*
-    AllocPRemoteOpenFileParent(const SerializedLoadContext& aSerialized,
-                               const URIParams& aFileURI,
-                               const OptionalURIParams& aAppURI) override;
-  virtual bool
-    RecvPRemoteOpenFileConstructor(PRemoteOpenFileParent* aActor,
-                                   const SerializedLoadContext& aSerialized,
-                                   const URIParams& aFileURI,
-                                   const OptionalURIParams& aAppURI)
-                                   override;
-  virtual bool DeallocPRemoteOpenFileParent(PRemoteOpenFileParent* aActor)
-                                            override;
-
   virtual bool DeallocPTCPSocketParent(PTCPSocketParent*) override;
   virtual PTCPServerSocketParent*
     AllocPTCPServerSocketParent(const uint16_t& aLocalPort,
                                 const uint16_t& aBacklog,
                                 const bool& aUseArrayBuffers) override;
   virtual bool RecvPTCPServerSocketConstructor(PTCPServerSocketParent*,
                                                const uint16_t& aLocalPort,
                                                const uint16_t& aBacklog,
--- a/netwerk/ipc/PNecko.ipdl
+++ b/netwerk/ipc/PNecko.ipdl
@@ -11,17 +11,16 @@ include protocol PCookieService;
 include protocol PBrowser;
 include protocol PWyciwygChannel;
 include protocol PFTPChannel;
 include protocol PWebSocket;
 include protocol PWebSocketEventListener;
 include protocol PTCPSocket;
 include protocol PTCPServerSocket;
 include protocol PUDPSocket;
-include protocol PRemoteOpenFile;
 include protocol PDNSRequest;
 include protocol PChannelDiverter;
 include protocol PBlob; //FIXME: bug #792908
 include protocol PFileDescriptorSet;
 include protocol PDataChannel;
 include protocol PTransportProvider;
 include protocol PSendStream;
 
@@ -49,17 +48,16 @@ nested(upto inside_cpow) sync protocol P
   manages PWyciwygChannel;
   manages PFTPChannel;
   manages PWebSocket;
   manages PWebSocketEventListener;
   manages PTCPSocket;
   manages PTCPServerSocket;
   manages PUDPSocket;
   manages PDNSRequest;
-  manages PRemoteOpenFile;
   manages PDataChannel;
   manages PRtspController;
   manages PRtspChannel;
   manages PChannelDiverter;
   manages PTransportProvider;
   manages PAltDataOutputStream;
 
 parent:
@@ -85,20 +83,16 @@ parent:
   /* Predictor Methods */
   async PredPredict(OptionalURIParams targetURI, OptionalURIParams sourceURI,
                     uint32_t reason, SerializedLoadContext loadContext,
                     bool hasVerifier);
   async PredLearn(URIParams targetURI, OptionalURIParams sourceURI,
                   uint32_t reason, SerializedLoadContext loadContext);
   async PredReset();
 
-  async PRemoteOpenFile(SerializedLoadContext loadContext,
-                        URIParams fileuri,
-                        OptionalURIParams appuri);
-
   async SpeculativeConnect(URIParams uri, bool anonymous);
   async HTMLDNSPrefetch(nsString hostname, uint16_t flags);
   async CancelHTMLDNSPrefetch(nsString hostname, uint16_t flags, nsresult reason);
 
   /**
    * channelId is used to establish a connection between redirect channels in
    * the parent and the child when we're redirecting to a data: URI.
    */
deleted file mode 100644
--- a/netwerk/ipc/PRemoteOpenFile.ipdl
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PNecko;
-
-namespace mozilla {
-namespace net {
-
-/**
- * Protocol to support RemoteOpenFile, an nsIFile that opens it's file handle on
- * the parent instead of the child (since child lacks permission to do so).
- */
-protocol PRemoteOpenFile
-{
-  manager PNecko;
-
-child:
-  // Your file handle is ready, Sir...
-  async __delete__(FileDescriptor fd);
-};
-
-
-} // namespace net
-} // namespace mozilla
deleted file mode 100644
--- a/netwerk/ipc/RemoteOpenFileChild.cpp
+++ /dev/null
@@ -1,812 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "RemoteOpenFileChild.h"
-
-#include "mozilla/Unused.h"
-#include "mozilla/ipc/FileDescriptor.h"
-#include "mozilla/ipc/FileDescriptorUtils.h"
-#include "mozilla/ipc/URIUtils.h"
-#include "mozilla/net/NeckoChild.h"
-#include "nsThreadUtils.h"
-#include "nsJARProtocolHandler.h"
-#include "nsIRemoteOpenFileListener.h"
-#include "nsProxyRelease.h"
-#include "SerializedLoadContext.h"
-#include "nsNetUtil.h"
-#include "nsIFileURL.h"
-
-// needed to alloc/free NSPR file descriptors
-#include "private/pprio.h"
-
-#if !defined(XP_WIN) && !defined(MOZ_WIDGET_COCOA)
-#include <unistd.h>
-#endif
-
-using namespace mozilla::ipc;
-
-namespace mozilla {
-namespace net {
-
-//-----------------------------------------------------------------------------
-// Helper class to dispatch events async on windows/OSX
-//-----------------------------------------------------------------------------
-
-class CallsListenerInNewEvent : public Runnable
-{
-public:
-    CallsListenerInNewEvent(nsIRemoteOpenFileListener *aListener, nsresult aRv)
-      : mListener(aListener), mRV(aRv)
-    {
-        MOZ_ASSERT(NS_IsMainThread());
-        MOZ_ASSERT(aListener);
-    }
-
-    void Dispatch()
-    {
-        MOZ_ASSERT(NS_IsMainThread());
-
-        nsresult rv = NS_DispatchToCurrentThread(this);
-        NS_ENSURE_SUCCESS_VOID(rv);
-    }
-
-private:
-    NS_IMETHOD Run() override
-    {
-        MOZ_ASSERT(NS_IsMainThread());
-        MOZ_ASSERT(mListener);
-
-        mListener->OnRemoteFileOpenComplete(mRV);
-        return NS_OK;
-    }
-
-    nsCOMPtr<nsIRemoteOpenFileListener> mListener;
-    nsresult mRV;
-};
-
-//-----------------------------------------------------------------------------
-// RemoteOpenFileChild
-//-----------------------------------------------------------------------------
-
-NS_IMPL_ISUPPORTS(RemoteOpenFileChild,
-                  nsIFile,
-                  nsIHashable,
-                  nsICachedFileDescriptorListener)
-
-RemoteOpenFileChild::RemoteOpenFileChild(const RemoteOpenFileChild& other)
-  : mTabChild(other.mTabChild)
-  , mNSPRFileDesc(nullptr)
-  , mAsyncOpenCalled(other.mAsyncOpenCalled)
-{
-#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-  // Windows/OSX desktop builds skip remoting, so the file descriptor should
-  // be nullptr here.
-  MOZ_ASSERT(!other.mNSPRFileDesc);
-#else
-  if (other.mNSPRFileDesc) {
-    PROsfd osfd = dup(PR_FileDesc2NativeHandle(other.mNSPRFileDesc));
-    mNSPRFileDesc = PR_ImportFile(osfd);
-  }
-#endif
-
-  // Note: don't clone mListener or we'll have a refcount leak.
-  other.mURI->Clone(getter_AddRefs(mURI));
-  if (other.mAppURI) {
-    other.mAppURI->Clone(getter_AddRefs(mAppURI));
-  }
-  other.mFile->Clone(getter_AddRefs(mFile));
-}
-
-RemoteOpenFileChild::~RemoteOpenFileChild()
-{
-  if (NS_IsMainThread()) {
-    if (mListener) {
-      NotifyListener(NS_ERROR_UNEXPECTED);
-    }
-  } else {
-    NS_ReleaseOnMainThread(mURI.forget(), true);
-    NS_ReleaseOnMainThread(mAppURI.forget(), true);
-    NS_ReleaseOnMainThread(mListener.forget(), true);
-    NS_ReleaseOnMainThread(mTabChild.forget(), true);
-  }
-
-  if (mNSPRFileDesc) {
-    // PR_Close both closes the file and deallocates the PRFileDesc
-    PR_Close(mNSPRFileDesc);
-  }
-}
-
-nsresult
-RemoteOpenFileChild::Init(nsIURI* aRemoteOpenUri, nsIURI* aAppUri)
-{
-  if (!aRemoteOpenUri) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (aAppUri) {
-    aAppUri->Clone(getter_AddRefs(mAppURI));
-  }
-
-  nsAutoCString scheme;
-  nsresult rv = aRemoteOpenUri->GetScheme(scheme);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!scheme.EqualsLiteral("remoteopenfile")) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  // scheme of URI is not file:// so this is not a nsIFileURL.  Convert to one.
-  nsCOMPtr<nsIURI> clonedURI;
-  rv = aRemoteOpenUri->Clone(getter_AddRefs(clonedURI));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  clonedURI->SetScheme(NS_LITERAL_CSTRING("file"));
-  nsAutoCString spec;
-  rv = clonedURI->GetSpec(spec);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = NS_NewURI(getter_AddRefs(mURI), spec);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Get nsIFile
-  nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mURI);
-  if (!fileURL) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  rv = fileURL->GetFile(getter_AddRefs(mFile));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-nsresult
-RemoteOpenFileChild::AsyncRemoteFileOpen(int32_t aFlags,
-                                         nsIRemoteOpenFileListener* aListener,
-                                         nsITabChild* aTabChild,
-                                         nsILoadContext *aLoadContext)
-{
-  if (!mFile) {
-    return NS_ERROR_NOT_INITIALIZED;
-  }
-
-  if (!aListener) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (mAsyncOpenCalled) {
-    return NS_ERROR_ALREADY_OPENED;
-  }
-
-  if (aFlags != PR_RDONLY) {
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  mTabChild = static_cast<TabChild*>(aTabChild);
-
-#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-  // Windows/OSX desktop builds skip remoting, and just open file in child
-  // process when asked for NSPR handle
-  RefPtr<CallsListenerInNewEvent> runnable =
-    new CallsListenerInNewEvent(aListener, NS_OK);
-  runnable->Dispatch();
-
-  mAsyncOpenCalled = true;
-  return NS_OK;
-#else
-  nsString path;
-  if (NS_FAILED(mFile->GetPath(path))) {
-    MOZ_CRASH("Couldn't get path from file!");
-  }
-
-  mListener = aListener;
-
-  if (mTabChild) {
-    if (mTabChild->GetCachedFileDescriptor(path, this)) {
-      // The file descriptor was found in the cache and OnCachedFileDescriptor()
-      // will be called with it.
-      return NS_OK;
-    }
-  }
-
-  URIParams uri;
-  SerializeURI(mURI, uri);
-  OptionalURIParams appUri;
-  SerializeURI(mAppURI, appUri);
-
-  IPC::SerializedLoadContext loadContext(aLoadContext);
-  gNeckoChild->SendPRemoteOpenFileConstructor(this, loadContext, uri, appUri);
-
-  // The chrome process now has a logical ref to us until it calls Send__delete.
-  AddIPDLReference();
-
-  mAsyncOpenCalled = true;
-  return NS_OK;
-#endif
-}
-
-nsresult
-RemoteOpenFileChild::SetNSPRFileDesc(PRFileDesc* aNSPRFileDesc)
-{
-  MOZ_ASSERT(!mNSPRFileDesc);
-  if (mNSPRFileDesc) {
-    return NS_ERROR_ALREADY_OPENED;
-  }
-
-  mNSPRFileDesc = aNSPRFileDesc;
-  return NS_OK;
-}
-
-void
-RemoteOpenFileChild::OnCachedFileDescriptor(const nsAString& aPath,
-                                            const FileDescriptor& aFD)
-{
-#ifdef DEBUG
-  if (!aPath.IsEmpty()) {
-    MOZ_ASSERT(mFile);
-
-    nsString path;
-    MOZ_ASSERT(NS_SUCCEEDED(mFile->GetPath(path)));
-    MOZ_ASSERT(path == aPath, "Paths don't match!");
-  }
-#endif
-
-  HandleFileDescriptorAndNotifyListener(aFD, /* aFromRecvDelete */ false);
-}
-
-void
-RemoteOpenFileChild::HandleFileDescriptorAndNotifyListener(
-                                                      const FileDescriptor& aFD,
-                                                      bool aFromRecvDelete)
-{
-#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-  MOZ_CRASH("OS X and Windows shouldn't be doing IPDL here");
-#else
-  if (!mListener) {
-    // We already notified our listener (either in response to a cached file
-    // descriptor callback or through the normal messaging mechanism). Close the
-    // file descriptor if it is valid.
-    if (aFD.IsValid()) {
-      RefPtr<CloseFileRunnable> runnable = new CloseFileRunnable(aFD);
-      runnable->Dispatch();
-    }
-    return;
-  }
-
-  MOZ_ASSERT(!mNSPRFileDesc);
-
-  RefPtr<TabChild> tabChild;
-  mTabChild.swap(tabChild);
-
-  // If RemoteOpenFile reply (Recv__delete__) for app's application.zip comes
-  // back sooner than the parent-pushed fd (TabChild::RecvCacheFileDescriptor())
-  // have TabChild cancel running callbacks, since we'll call them in
-  // NotifyListener.
-  if (tabChild && aFromRecvDelete) {
-    nsString path;
-    if (NS_FAILED(mFile->GetPath(path))) {
-      MOZ_CRASH("Couldn't get path from file!");
-    }
-
-    tabChild->CancelCachedFileDescriptorCallback(path, this);
-  }
-
-  if (aFD.IsValid()) {
-    auto rawFD = aFD.ClonePlatformHandle();
-    mNSPRFileDesc = PR_ImportFile(rawFD.release());
-    if (!mNSPRFileDesc) {
-      NS_WARNING("Failed to import file handle!");
-    }
-  }
-
-  NotifyListener(mNSPRFileDesc ? NS_OK : NS_ERROR_FILE_NOT_FOUND);
-#endif
-}
-
-void
-RemoteOpenFileChild::NotifyListener(nsresult aResult)
-{
-  MOZ_ASSERT(mListener);
-  mListener->OnRemoteFileOpenComplete(aResult);
-  mListener = nullptr;     // release ref to listener
-
-  RefPtr<nsJARProtocolHandler> handler(gJarHandler);
-  NS_WARNING_ASSERTION(handler, "nsJARProtocolHandler is already gone!");
-
-  if (handler) {
-    handler->RemoteOpenFileComplete(this, aResult);
-  }
-}
-
-//-----------------------------------------------------------------------------
-// RemoteOpenFileChild::PRemoteOpenFileChild
-//-----------------------------------------------------------------------------
-
-bool
-RemoteOpenFileChild::Recv__delete__(const FileDescriptor& aFD)
-{
-#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-  NS_NOTREACHED("OS X and Windows shouldn't be doing IPDL here");
-#else
-  HandleFileDescriptorAndNotifyListener(aFD, /* aFromRecvDelete */ true);
-#endif
-
-  return true;
-}
-
-//-----------------------------------------------------------------------------
-// RemoteOpenFileChild::nsIFile functions that we override logic for
-//-----------------------------------------------------------------------------
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Clone(nsIFile **file)
-{
-  *file = new RemoteOpenFileChild(*this);
-  NS_ADDREF(*file);
-
-  return NS_OK;
-}
-
-/* The main event: get file descriptor from parent process
- */
-NS_IMETHODIMP
-RemoteOpenFileChild::OpenNSPRFileDesc(int32_t aFlags, int32_t aMode,
-                                      PRFileDesc **aRetval)
-{
-#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-  // Windows and OSX builds: just open nsIFile locally.
-  return mFile->OpenNSPRFileDesc(aFlags, aMode, aRetval);
-
-#else
-  if (aFlags != PR_RDONLY) {
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  if (!mNSPRFileDesc) {
-    // Client skipped AsyncRemoteFileOpen() or didn't wait for result.
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  PROsfd osfd = dup(PR_FileDesc2NativeHandle(mNSPRFileDesc));
-  *aRetval = PR_ImportFile(osfd);
-  if (!*aRetval) {
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  return NS_OK;
-#endif
-}
-
-
-//-----------------------------------------------------------------------------
-// RemoteOpenFileChild::nsIFile functions that we delegate to underlying nsIFile
-//-----------------------------------------------------------------------------
-
-nsresult
-RemoteOpenFileChild::GetLeafName(nsAString &aLeafName)
-{
-  return mFile->GetLeafName(aLeafName);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetNativeLeafName(nsACString &aLeafName)
-{
-  return mFile->GetNativeLeafName(aLeafName);
-}
-
-nsresult
-RemoteOpenFileChild::GetTarget(nsAString &_retval)
-{
-  return mFile->GetTarget(_retval);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetNativeTarget(nsACString &_retval)
-{
-  return mFile->GetNativeTarget(_retval);
-}
-
-nsresult
-RemoteOpenFileChild::GetPath(nsAString &_retval)
-{
-  return mFile->GetPath(_retval);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetNativePath(nsACString &_retval)
-{
-  return mFile->GetNativePath(_retval);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Equals(nsIFile *inFile, bool *_retval)
-{
-  return mFile->Equals(inFile, _retval);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Contains(nsIFile *inFile, bool *_retval)
-{
-  return mFile->Contains(inFile, _retval);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetParent(nsIFile **aParent)
-{
-  return mFile->GetParent(aParent);
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetFollowLinks(bool *aFollowLinks)
-{
-  return mFile->GetFollowLinks(aFollowLinks);
-}
-
-//-----------------------------------------------------------------------------
-// RemoteOpenFileChild::nsIFile functions that are not currently supported
-//-----------------------------------------------------------------------------
-
-nsresult
-RemoteOpenFileChild::Append(const nsAString &node)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::AppendNative(const nsACString &fragment)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Normalize()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Create(uint32_t type, uint32_t permissions)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
-RemoteOpenFileChild::SetLeafName(const nsAString &aLeafName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetNativeLeafName(const nsACString &aLeafName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
-RemoteOpenFileChild::InitWithPath(const nsAString &filePath)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::InitWithNativePath(const nsACString &filePath)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::InitWithFile(nsIFile *aFile)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetFollowLinks(bool aFollowLinks)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult  
-RemoteOpenFileChild::AppendRelativePath(const nsAString &node)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::AppendRelativeNativePath(const nsACString &fragment)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetPersistentDescriptor(nsACString &aPersistentDescriptor)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetPersistentDescriptor(const nsACString &aPersistentDescriptor)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetRelativeDescriptor(nsIFile *fromFile, nsACString& _retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetRelativeDescriptor(nsIFile *fromFile,
-                                   const nsACString& relativeDesc)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetRelativePath(nsIFile *fromFile, nsACString& _retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetRelativePath(nsIFile *fromFile,
-                                     const nsACString& relativePath)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
-RemoteOpenFileChild::CopyTo(nsIFile *newParentDir, const nsAString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::CopyToNative(nsIFile *newParent, const nsACString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
-RemoteOpenFileChild::CopyToFollowingLinks(nsIFile *newParentDir,
-                                  const nsAString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::CopyToFollowingLinksNative(nsIFile *newParent,
-                                        const nsACString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
-RemoteOpenFileChild::MoveTo(nsIFile *newParentDir, const nsAString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::MoveToNative(nsIFile *newParent, const nsACString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::RenameTo(nsIFile *newParentDir, const nsAString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::RenameToNative(nsIFile *newParentDir, const nsACString &newName)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Remove(bool recursive)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetPermissions(uint32_t *aPermissions)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetPermissions(uint32_t aPermissions)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetPermissionsOfLink(uint32_t *aPermissionsOfLink)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetPermissionsOfLink(uint32_t aPermissions)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetLastModifiedTime(PRTime *aLastModTime)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetLastModifiedTime(PRTime aLastModTime)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetLastModifiedTimeOfLink(PRTime *aLastModTimeOfLink)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetLastModifiedTimeOfLink(PRTime aLastModTimeOfLink)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetFileSize(int64_t *aFileSize)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::SetFileSize(int64_t aFileSize)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetFileSizeOfLink(int64_t *aFileSize)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Exists(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsWritable(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsReadable(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsExecutable(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsHidden(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsDirectory(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsFile(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsSymlink(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::IsSpecial(bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::CreateUnique(uint32_t type, uint32_t attributes)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetDirectoryEntries(nsISimpleEnumerator **entries)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::OpenANSIFileDesc(const char *mode, FILE **_retval)
-{
-  // TODO: can implement using fdopen()?
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Load(PRLibrary **_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetDiskSpaceAvailable(int64_t *aDiskSpaceAvailable)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Reveal()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Launch()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-//-----------------------------------------------------------------------------
-// RemoteOpenFileChild::nsIHashable functions that we delegate to underlying nsIFile
-//-----------------------------------------------------------------------------
-
-NS_IMETHODIMP
-RemoteOpenFileChild::Equals(nsIHashable* aOther, bool *aResult)
-{
-  nsCOMPtr<nsIHashable> hashable = do_QueryInterface(mFile);
-
-  MOZ_ASSERT(hashable);
-
-  if (hashable) {
-    return hashable->Equals(aOther, aResult);
-  }
-  return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-RemoteOpenFileChild::GetHashCode(uint32_t *aResult)
-{
-  nsCOMPtr<nsIHashable> hashable = do_QueryInterface(mFile);
-
-  MOZ_ASSERT(hashable);
-
-  if (hashable) {
-    return hashable->GetHashCode(aResult);
-  }
-  return NS_ERROR_UNEXPECTED;
-}
-
-} // namespace net
-} // namespace mozilla
deleted file mode 100644
--- a/netwerk/ipc/RemoteOpenFileChild.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef _RemoteOpenFileChild_h
-#define _RemoteOpenFileChild_h
-
-#include "mozilla/Attributes.h"
-#include "mozilla/dom/TabChild.h"
-#include "mozilla/net/PRemoteOpenFileChild.h"
-#include "nsICachedFileDescriptorListener.h"
-#include "nsILocalFile.h"
-#include "nsIRemoteOpenFileListener.h"
-
-class nsILoadContext;
-
-namespace mozilla {
-
-namespace ipc {
-class FileDescriptor;
-} // namespace ipc
-
-namespace net {
-
-/**
- * RemoteOpenFileChild: a thin wrapper around regular nsIFile classes that does
- * IPC to open a file handle on parent instead of child.  Used when we can't
- * open file handle on child (don't have permission), but we don't want the
- * overhead of shipping all I/O traffic across IPDL.  Example: JAR files.
- *
- * To open a file handle with this class, AsyncRemoteFileOpen() must be called
- * first.  After the listener's OnRemoteFileOpenComplete() is called, if the
- * result is NS_OK, nsIFile.OpenNSPRFileDesc() may be called to get a
- * duplicated file descriptor.
- *
- * Note that the file descriptor returned by NSPRFileDesc() is duplicated from
- * the original, which shares its file offset with the original.  If the file
- * offset is modified (ex: by lseek/read/write) on one of the shared
- * descriptors, the offset is also changed for the other.   It can be safely
- * used only with operations that take absolute offsets, such as
- * mmap/pread/pwrite.
- *
- * This class should only be instantiated in a child process.
- *
- */
-class RemoteOpenFileChild final
-  : public PRemoteOpenFileChild
-  , public nsIFile
-  , public nsIHashable
-  , public nsICachedFileDescriptorListener
-{
-  typedef mozilla::dom::TabChild TabChild;
-  typedef mozilla::ipc::FileDescriptor FileDescriptor;
-
-  virtual ~RemoteOpenFileChild();
-
-public:
-  RemoteOpenFileChild()
-    : mNSPRFileDesc(nullptr)
-    , mAsyncOpenCalled(false)
-    , mNSPROpenCalled(false)
-  {}
-
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSIFILE
-  NS_DECL_NSIHASHABLE
-
-  // aRemoteOpenUri must be scheme 'remoteopenfile://': otherwise looks like
-  // a file:// uri.
-  nsresult Init(nsIURI* aRemoteOpenUri, nsIURI* aAppUri);
-
-  // Send message to parent to tell it to open file handle for file.
-  // TabChild is required, for IPC security.
-  // Note: currently only PR_RDONLY is supported for 'flags'
-  nsresult AsyncRemoteFileOpen(int32_t aFlags,
-                               nsIRemoteOpenFileListener* aListener,
-                               nsITabChild* aTabChild,
-                               nsILoadContext *aLoadContext);
-
-  nsresult SetNSPRFileDesc(PRFileDesc* aNSPRFileDesc);
-
-  void ReleaseIPDLReference()
-  {
-    Release();
-  }
-
-private:
-  RemoteOpenFileChild(const RemoteOpenFileChild& other);
-
-protected:
-  void AddIPDLReference()
-  {
-    AddRef();
-  }
-
-  virtual bool Recv__delete__(const FileDescriptor&) override;
-
-  virtual void OnCachedFileDescriptor(const nsAString& aPath,
-                                      const FileDescriptor& aFD) override;
-
-  void HandleFileDescriptorAndNotifyListener(const FileDescriptor&,
-                                             bool aFromRecvDelete);
-
-  void NotifyListener(nsresult aResult);
-
-  // regular nsIFile object, that we forward most calls to.
-  nsCOMPtr<nsIFile> mFile;
-  nsCOMPtr<nsIURI> mURI;
-  nsCOMPtr<nsIURI> mAppURI;
-  nsCOMPtr<nsIRemoteOpenFileListener> mListener;
-  RefPtr<TabChild> mTabChild;
-  PRFileDesc* mNSPRFileDesc;
-  bool mAsyncOpenCalled;
-  bool mNSPROpenCalled;
-};
-
-} // namespace net
-} // namespace mozilla
-
-#endif // _RemoteOpenFileChild_h
deleted file mode 100644
--- a/netwerk/ipc/RemoteOpenFileParent.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/net/RemoteOpenFileParent.h"
-#include "mozilla/Unused.h"
-#include "nsEscape.h"
-
-#if !defined(XP_WIN) && !defined(MOZ_WIDGET_COCOA)
-#include <fcntl.h>
-#include <unistd.h>
-#endif
-
-namespace mozilla {
-namespace net {
-
-void
-RemoteOpenFileParent::ActorDestroy(ActorDestroyReason aWhy)
-{
-  // Nothing needed here. Called right before destructor since this is a
-  // non-refcounted class.
-}
-
-bool
-RemoteOpenFileParent::OpenSendCloseDelete()
-{
-#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
-  MOZ_CRASH("OS X and Windows shouldn't be doing IPDL here");
-#else
-
-  // TODO: make this async!
-
-  FileDescriptor fileDescriptor;
-
-  nsAutoCString path;
-  nsresult rv = mURI->GetFilePath(path);
-  NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "GetFilePath failed!");
-
-  NS_UnescapeURL(path);
-
-  if (NS_SUCCEEDED(rv)) {
-    int fd = open(path.get(), O_RDONLY);
-    if (fd == -1) {
-      printf_stderr("RemoteOpenFileParent: file '%s' was not found!\n",
-                    path.get());
-    } else {
-      fileDescriptor = FileDescriptor(fd);
-      // FileDescriptor does a dup() internally, so we need to close our fd
-      close(fd);
-    }
-  }
-
-  // Sending a potentially invalid file descriptor is just fine.
-  Unused << Send__delete__(this, fileDescriptor);
-
-  // Current process's file descriptor is closed by FileDescriptor destructor.
-#endif // OS_TYPE
-
-  return true;
-}
-
-} // namespace net
-} // namespace mozilla
deleted file mode 100644
--- a/netwerk/ipc/RemoteOpenFileParent.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et tw=80 : */
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_net_RemoteOpenFileParent_h
-#define mozilla_net_RemoteOpenFileParent_h
-
-#include "mozilla/net/PRemoteOpenFileParent.h"
-#include "mozilla/net/NeckoCommon.h"
-#include "nsIFileURL.h"
-
-namespace mozilla {
-namespace net {
-
-class RemoteOpenFileParent : public PRemoteOpenFileParent
-{
-public:
-  explicit RemoteOpenFileParent(nsIFileURL* aURI)
-  : mURI(aURI)
-  {}
-
-  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
-  bool OpenSendCloseDelete();
-
-private:
-  nsCOMPtr<nsIFileURL> mURI;
-};
-
-} // namespace net
-} // namespace mozilla
-
-#endif // mozilla_net_RemoteOpenFileParent_h
--- a/netwerk/ipc/moz.build
+++ b/netwerk/ipc/moz.build
@@ -1,45 +1,34 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-XPIDL_SOURCES += [
-    'nsIRemoteOpenFileListener.idl',
-]
-
-XPIDL_MODULE = 'necko_ipc'
-
 EXPORTS.mozilla.net += [
     'ChannelEventQueue.h',
     'NeckoChild.h',
     'NeckoCommon.h',
     'NeckoMessageUtils.h',
     'NeckoParent.h',
-    'RemoteOpenFileChild.h',
-    'RemoteOpenFileParent.h',
 ]
 
 UNIFIED_SOURCES += [
     'ChannelEventQueue.cpp',
     'NeckoChild.cpp',
     'NeckoCommon.cpp',
     'NeckoParent.cpp',
-    'RemoteOpenFileChild.cpp',
-    'RemoteOpenFileParent.cpp',
 ]
 
 IPDL_SOURCES = [
     'NeckoChannelParams.ipdlh',
     'PChannelDiverter.ipdl',
     'PDataChannel.ipdl',
     'PNecko.ipdl',
-    'PRemoteOpenFile.ipdl',
     'PRtspChannel.ipdl',
     'PRtspController.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
deleted file mode 100644
--- a/netwerk/ipc/nsIRemoteOpenFileListener.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set sw=4 ts=4 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/**
- * nsIRemoteOpenFileListener: passed to RemoteOpenFileChild::AsyncRemoteFileOpen.
- *
- * Interface for notifying when the file has been opened and is available in
- * child.
- */
-[uuid(5c89208c-fe2b-4e04-9783-93bcf5c3b783)]
-interface nsIRemoteOpenFileListener : nsISupports
-{
-    /**
-     * Called when result of opening RemoteOpenFileChild:AsyncRemoteFileOpen()
-     * is available in child.
-     *
-     * @param aOpenStatus: nsresult from opening file in parent.  If NS_OK,
-     * then a following call to RemoteOpenFileChild::OpenNSPRFileDesc that
-     * passes the same flags as were passed to
-     * RemoteOpenFileChild::AsyncRemoteFileOpen is guaranteed to succeed.  If
-     * !NS_OK or if different flags were passed, the call will fail.
-     */
-    void onRemoteFileOpenComplete(in nsresult aOpenStatus);
-};
-