Merge mozilla-central to autoland. a=merge CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Tue, 26 Feb 2019 00:09:40 +0200
changeset 518873 fb2dc1645fcce3142932eb78daa7cee634c9d3b2
parent 518872 58727c80f9c7e73da8e49d8e3915bede97196588 (current diff)
parent 518769 49b2a4c8be018f92d050512f9646cb3004ec1bec (diff)
child 518874 987a62667969a5f88f8c3f4693299e097db60daf
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone67.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
Merge mozilla-central to autoland. a=merge CLOSED TREE
browser/components/sessionstore/SessionStore.jsm
dom/base/Element.cpp
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
uriloader/exthandler/ExternalHelperAppParent.cpp
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3835,17 +3835,17 @@ var SessionStoreInternal = {
    */
   prepareConnectionToHost(tab, url) {
     if (!url.startsWith("about:")) {
       let principal = Services.scriptSecurityManager.createNullPrincipal({
         userContextId: tab.userContextId,
       });
       let sc = Services.io.QueryInterface(Ci.nsISpeculativeConnect);
       let uri = Services.io.newURI(url);
-      sc.speculativeConnect2(uri, principal, null);
+      sc.speculativeConnect(uri, principal, null);
       return true;
     }
     return false;
   },
 
   /**
    * Make a connection to a host when users hover mouse on a tab.
    * This will also set a flag in the tab to prevent us from speculatively
--- a/browser/components/urlbar/UrlbarUtils.jsm
+++ b/browser/components/urlbar/UrlbarUtils.jsm
@@ -315,17 +315,17 @@ var UrlbarUtils = {
 
     if (urlOrEngine instanceof URL) {
       urlOrEngine = urlOrEngine.href;
     }
 
     try {
       let uri = urlOrEngine instanceof Ci.nsIURI ? urlOrEngine
                                                   : Services.io.newURI(urlOrEngine);
-      Services.io.speculativeConnect2(uri, window.gBrowser.contentPrincipal, null);
+      Services.io.speculativeConnect(uri, window.gBrowser.contentPrincipal, null);
     } catch (ex) {
       // Can't setup speculative connection for this url, just ignore it.
     }
   },
 
   /**
    * Used to filter out the javascript protocol from URIs, since we don't
    * support LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL for those.
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -8407,19 +8407,19 @@ void Document::MaybePreconnect(nsIURI* a
 
   nsCOMPtr<nsISpeculativeConnect> speculator(
       do_QueryInterface(nsContentUtils::GetIOService()));
   if (!speculator) {
     return;
   }
 
   if (aCORSMode == CORS_ANONYMOUS) {
-    speculator->SpeculativeAnonymousConnect2(uri, NodePrincipal(), nullptr);
+    speculator->SpeculativeAnonymousConnect(uri, NodePrincipal(), nullptr);
   } else {
-    speculator->SpeculativeConnect2(uri, NodePrincipal(), nullptr);
+    speculator->SpeculativeConnect(uri, NodePrincipal(), nullptr);
   }
 }
 
 void Document::ForgetImagePreload(nsIURI* aURI) {
   // Checking count is faster than hashing the URI in the common
   // case of empty table.
   if (mPreloadingImages.Count() != 0) {
     nsCOMPtr<imgIRequest> req;
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -3099,17 +3099,17 @@ nsresult Element::PostHandleEventForLink
           EventStateManager::SetActiveManager(
               aVisitor.mPresContext->EventStateManager(), this);
 
           // OK, we're pretty sure we're going to load, so warm up a speculative
           // connection to be sure we have one ready when we open the channel.
           nsCOMPtr<nsISpeculativeConnect> sc =
               do_QueryInterface(nsContentUtils::GetIOService());
           nsCOMPtr<nsIInterfaceRequestor> ir = do_QueryInterface(handler);
-          sc->SpeculativeConnect2(absURI, NodePrincipal(), ir);
+          sc->SpeculativeConnect(absURI, NodePrincipal(), ir);
         }
       }
     } break;
 
     case eMouseClick: {
       WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
       if (mouseEvent->IsLeftClickEvent()) {
         if (mouseEvent->IsControl() || mouseEvent->IsMeta() ||
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3618,31 +3618,42 @@ PExternalHelperAppParent* ContentParent:
     const OptionalURIParams& uri,
     const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
     const nsCString& aMimeContentType, const nsCString& aContentDisposition,
     const uint32_t& aContentDispositionHint,
     const nsString& aContentDispositionFilename, const bool& aForceSave,
     const int64_t& aContentLength, const bool& aWasFileChannel,
     const OptionalURIParams& aReferrer, PBrowserParent* aBrowser) {
   ExternalHelperAppParent* parent = new ExternalHelperAppParent(
-      uri, aLoadInfoArgs, aContentLength, aWasFileChannel, aContentDisposition,
+      uri, aContentLength, aWasFileChannel, aContentDisposition,
       aContentDispositionHint, aContentDispositionFilename);
   parent->AddRef();
-  parent->Init(this, aMimeContentType, aForceSave, aReferrer, aBrowser);
   return parent;
 }
 
 bool ContentParent::DeallocPExternalHelperAppParent(
     PExternalHelperAppParent* aService) {
   ExternalHelperAppParent* parent =
       static_cast<ExternalHelperAppParent*>(aService);
   parent->Release();
   return true;
 }
 
+mozilla::ipc::IPCResult ContentParent::RecvPExternalHelperAppConstructor(
+    PExternalHelperAppParent* actor, const OptionalURIParams& uri,
+    const OptionalLoadInfoArgs& loadInfoArgs, const nsCString& aMimeContentType,
+    const nsCString& aContentDisposition, const uint32_t& aContentDispositionHint,
+    const nsString& aContentDispositionFilename, const bool& aForceSave,
+    const int64_t& aContentLength, const bool& aWasFileChannel,
+    const OptionalURIParams& aReferrer, PBrowserParent* aBrowser) {
+  static_cast<ExternalHelperAppParent*>(actor)->Init(
+      loadInfoArgs, aMimeContentType, aForceSave, aReferrer, aBrowser);
+  return IPC_OK();
+}
+
 PHandlerServiceParent* ContentParent::AllocPHandlerServiceParent() {
   HandlerServiceParent* actor = new HandlerServiceParent();
   actor->AddRef();
   return actor;
 }
 
 bool ContentParent::DeallocPHandlerServiceParent(
     PHandlerServiceParent* aHandlerServiceParent) {
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -880,16 +880,24 @@ class ContentParent final : public PCont
       const nsCString& aMimeContentType, const nsCString& aContentDisposition,
       const uint32_t& aContentDispositionHint,
       const nsString& aContentDispositionFilename, const bool& aForceSave,
       const int64_t& aContentLength, const bool& aWasFileChannel,
       const OptionalURIParams& aReferrer, PBrowserParent* aBrowser);
 
   bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService);
 
+  mozilla::ipc::IPCResult RecvPExternalHelperAppConstructor(
+      PExternalHelperAppParent* actor, const OptionalURIParams& uri,
+      const OptionalLoadInfoArgs& loadInfoArgs, const nsCString& aMimeContentType,
+      const nsCString& aContentDisposition, const uint32_t& aContentDispositionHint,
+      const nsString& aContentDispositionFilename, const bool& aForceSave,
+      const int64_t& aContentLength, const bool& aWasFileChannel,
+      const OptionalURIParams& aReferrer, PBrowserParent* aBrowser) override;
+
   PHandlerServiceParent* AllocPHandlerServiceParent();
 
   bool DeallocPHandlerServiceParent(PHandlerServiceParent*);
 
   PMediaParent* AllocPMediaParent();
 
   bool DeallocPMediaParent(PMediaParent* aActor);
 
--- a/gfx/wr/wrench/reftests/blend/reftest.list
+++ b/gfx/wr/wrench/reftests/blend/reftest.list
@@ -18,9 +18,9 @@ fuzzy(1,10000) == difference-transparent
 == large.yaml large-ref.yaml
 
 # fuzzy because dithering is different for gradients
 # drawn in different render targets
 fuzzy(1,2502) == transparent-composite-1.yaml transparent-composite-1-ref.yaml
 fuzzy(1,2502) == transparent-composite-2.yaml transparent-composite-2-ref.yaml
 
 == multi-mix-blend-mode.yaml multi-mix-blend-mode-ref.yaml
-fuzzy(50,5) == transform-source.yaml transform-source-ref.yaml
+fuzzy(50,8) == transform-source.yaml transform-source-ref.yaml
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4990,19 +4990,19 @@ var BrowserEventHandler = {
     this._inCluster = aEvent.hitCluster;
     if (this._inCluster) {
       return;  // No highlight for a cluster of links
     }
 
     let uri = this._getLinkURI(target);
     if (uri) {
       try {
-        Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect2(uri,
-                                                                                 target.ownerDocument.nodePrincipal,
-                                                                                 null);
+        Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect(uri,
+                                                                                target.ownerDocument.nodePrincipal,
+                                                                                null);
       } catch (e) {}
     }
     this._doTapHighlight(target);
   },
 
   _getLinkURI: function(aElement) {
     if (aElement.nodeType == aElement.ELEMENT_NODE &&
         ((ChromeUtils.getClassName(aElement) === "HTMLAnchorElement" && aElement.href) ||
@@ -6781,17 +6781,17 @@ var Tabs = {
     switch (event) {
       case "Session:Prefetch":
         if (!data.url) {
           break;
         }
         try {
           let uri = Services.io.newURI(data.url);
           if (uri && !this._domains.has(uri.host)) {
-            Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect2(
+            Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect(
                 uri, BrowserApp.selectedBrowser.contentDocument.nodePrincipal, null);
             this._domains.add(uri.host);
           }
         } catch (e) {}
         break;
     }
   },
 
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -845,17 +845,17 @@ void Predictor::PredictForLink(nsIURI *t
       PREDICTOR_LOG(("    Not predicting for link hover - on an SSL page"));
       return;
     }
   }
 
   nsCOMPtr<nsIPrincipal> principal =
       BasePrincipal::CreateCodebasePrincipal(targetURI, originAttributes);
 
-  mSpeculativeService->SpeculativeConnect2(targetURI, principal, nullptr);
+  mSpeculativeService->SpeculativeConnect(targetURI, principal, nullptr);
   if (verifier) {
     PREDICTOR_LOG(("    sending verification"));
     verifier->OnPredictPreconnect(targetURI);
   }
 }
 
 // This is the driver for prediction based on a new pageload.
 static const uint8_t MAX_PAGELOAD_DEPTH = 10;
@@ -1329,17 +1329,17 @@ bool Predictor::RunPredictions(nsIURI *r
   len = preconnects.Length();
   for (i = 0; i < len; ++i) {
     PREDICTOR_LOG(("    doing preconnect"));
     nsCOMPtr<nsIURI> uri = preconnects[i];
     ++totalPredictions;
     ++totalPreconnects;
     nsCOMPtr<nsIPrincipal> principal =
         BasePrincipal::CreateCodebasePrincipal(uri, originAttributes);
-    mSpeculativeService->SpeculativeConnect2(uri, principal, this);
+    mSpeculativeService->SpeculativeConnect(uri, principal, this);
     predicted = true;
     if (verifier) {
       PREDICTOR_LOG(("    sending preconnect verification"));
       verifier->OnPredictPreconnect(uri);
     }
   }
 
   len = preresolves.Length();
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -1720,20 +1720,19 @@ IOServiceProxyCallback::OnProxyAvailable
   if (!speculativeHandler) return NS_OK;
 
   nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
   nsCOMPtr<nsIPrincipal> principal = loadInfo->LoadingPrincipal();
 
   nsLoadFlags loadFlags = 0;
   channel->GetLoadFlags(&loadFlags);
   if (loadFlags & nsIRequest::LOAD_ANONYMOUS) {
-    speculativeHandler->SpeculativeAnonymousConnect2(uri, principal,
-                                                     mCallbacks);
+    speculativeHandler->SpeculativeAnonymousConnect(uri, principal, mCallbacks);
   } else {
-    speculativeHandler->SpeculativeConnect2(uri, principal, mCallbacks);
+    speculativeHandler->SpeculativeConnect(uri, principal, mCallbacks);
   }
 
   return NS_OK;
 }
 
 nsresult nsIOService::SpeculativeConnectInternal(
     nsIURI *aURI, nsIPrincipal *aPrincipal, nsIInterfaceRequestor *aCallbacks,
     bool aAnonymous) {
@@ -1797,25 +1796,24 @@ nsresult nsIOService::SpeculativeConnect
     return pps2->AsyncResolve2(channel, 0, callback, nullptr,
                                getter_AddRefs(cancelable));
   }
   return pps->AsyncResolve(channel, 0, callback, nullptr,
                            getter_AddRefs(cancelable));
 }
 
 NS_IMETHODIMP
-nsIOService::SpeculativeConnect2(nsIURI *aURI, nsIPrincipal *aPrincipal,
-                                 nsIInterfaceRequestor *aCallbacks) {
+nsIOService::SpeculativeConnect(nsIURI *aURI, nsIPrincipal *aPrincipal,
+                                nsIInterfaceRequestor *aCallbacks) {
   return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, false);
 }
 
 NS_IMETHODIMP
-nsIOService::SpeculativeAnonymousConnect2(nsIURI *aURI,
-                                          nsIPrincipal *aPrincipal,
-                                          nsIInterfaceRequestor *aCallbacks) {
+nsIOService::SpeculativeAnonymousConnect(nsIURI *aURI, nsIPrincipal *aPrincipal,
+                                         nsIInterfaceRequestor *aCallbacks) {
   return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, true);
 }
 
 /*static*/ bool nsIOService::IsDataURIUniqueOpaqueOrigin() {
   return sIsDataURIUniqueOpaqueOrigin;
 }
 
 /*static*/ bool nsIOService::BlockToplevelDataUriNavigations() {
--- a/netwerk/base/nsISpeculativeConnect.idl
+++ b/netwerk/base/nsISpeculativeConnect.idl
@@ -23,23 +23,23 @@ interface nsISpeculativeConnect : nsISup
      *
      * @param aURI the URI of the hinted transaction
      * @param aPrincipal the principal that will be used for opening the
      *        channel of the hinted transaction.
      * @param aCallbacks any security callbacks for use with SSL for interfaces
      *        such as nsIBadCertListener. May be null.
      *
      */
-    void speculativeConnect2(in nsIURI aURI,
-                             in nsIPrincipal aPrincipal,
-                             in nsIInterfaceRequestor aCallbacks);
+    void speculativeConnect(in nsIURI aURI,
+                            in nsIPrincipal aPrincipal,
+                            in nsIInterfaceRequestor aCallbacks);
 
-    void speculativeAnonymousConnect2(in nsIURI aURI,
-                                      in nsIPrincipal aPrincipal,
-                                      in nsIInterfaceRequestor aCallbacks);
+    void speculativeAnonymousConnect(in nsIURI aURI,
+                                     in nsIPrincipal aPrincipal,
+                                     in nsIInterfaceRequestor aCallbacks);
 };
 
 /**
  * This is used to override the default values for various values (documented
  * inline) to determine whether or not to actually make a speculative
  * connection.
  */
 [builtinclass, uuid(1040ebe3-6ed1-45a6-8587-995e082518d7)]
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -627,19 +627,19 @@ bool NeckoParent::DeallocPDNSRequestPare
 mozilla::ipc::IPCResult NeckoParent::RecvSpeculativeConnect(
     const URIParams& aURI, const Principal& aPrincipal,
     const bool& aAnonymous) {
   nsCOMPtr<nsISpeculativeConnect> speculator(gIOService);
   nsCOMPtr<nsIURI> uri = DeserializeURI(aURI);
   nsCOMPtr<nsIPrincipal> principal(aPrincipal);
   if (uri && speculator) {
     if (aAnonymous) {
-      speculator->SpeculativeAnonymousConnect2(uri, principal, nullptr);
+      speculator->SpeculativeAnonymousConnect(uri, principal, nullptr);
     } else {
-      speculator->SpeculativeConnect2(uri, principal, nullptr);
+      speculator->SpeculativeConnect(uri, principal, nullptr);
     }
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult NeckoParent::RecvHTMLDNSPrefetch(
     const nsString& hostname, const bool& isHttps,
     const OriginAttributes& aOriginAttributes, const uint16_t& flags) {
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -2467,25 +2467,25 @@ nsresult nsHttpHandler::SpeculativeConne
   auto *ci = new nsHttpConnectionInfo(host, port, EmptyCString(), username,
                                       nullptr, originAttributes, usingSSL);
   ci->SetAnonymous(anonymous);
 
   return SpeculativeConnect(ci, aCallbacks);
 }
 
 NS_IMETHODIMP
-nsHttpHandler::SpeculativeConnect2(nsIURI *aURI, nsIPrincipal *aPrincipal,
-                                   nsIInterfaceRequestor *aCallbacks) {
+nsHttpHandler::SpeculativeConnect(nsIURI *aURI, nsIPrincipal *aPrincipal,
+                                  nsIInterfaceRequestor *aCallbacks) {
   return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, false);
 }
 
 NS_IMETHODIMP
-nsHttpHandler::SpeculativeAnonymousConnect2(nsIURI *aURI,
-                                            nsIPrincipal *aPrincipal,
-                                            nsIInterfaceRequestor *aCallbacks) {
+nsHttpHandler::SpeculativeAnonymousConnect(nsIURI *aURI,
+                                           nsIPrincipal *aPrincipal,
+                                           nsIInterfaceRequestor *aCallbacks) {
   return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, true);
 }
 
 void nsHttpHandler::TickleWifi(nsIInterfaceRequestor *cb) {
   if (!cb || !mWifiTickler) return;
 
   // If B2G requires a similar mechanism nsINetworkManager, currently only avail
   // on B2G, contains the necessary information on wifi and gateway
--- a/netwerk/test/unit/test_speculative_connect.js
+++ b/netwerk/test/unit/test_speculative_connect.js
@@ -144,17 +144,17 @@ TestFailedStreamCallback.prototype = {
 function test_speculative_connect() {
     serv = new TestServer();
     var ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
                 .getService(Ci.nsIScriptSecurityManager);
     var URI = ios.newURI("http://localhost:" + serv.listener.port + "/just/a/test");
     var principal = ssm.createCodebasePrincipal(URI, {});
 
     ios.QueryInterface(Ci.nsISpeculativeConnect)
-       .speculativeConnect2(URI, principal, null);
+       .speculativeConnect(URI, principal, null);
 }
 
 /* Speculative connections should not be allowed for hosts with local IP
  * addresses (Bug 853423). That list includes:
  *  -- IPv4 RFC1918 and Link Local Addresses.
  *  -- IPv6 Unique and Link Local Addresses.
  *
  * Two tests are required:
--- a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_speculative.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_speculative.js
@@ -26,13 +26,13 @@ add_task(async function test_speculative
 
   Services.prefs.setBoolPref("network.http.debug-observations", true);
 
   await handlingExt.startup();
 
   let notificationPromise = ExtensionUtils.promiseObserved("speculative-connect-request");
 
   let uri = Services.io.newURI(`http://${proxy.identity.primaryHost}:${proxy.identity.primaryPort}`);
-  Services.io.speculativeConnect2(uri, Services.scriptSecurityManager.getSystemPrincipal(), null);
+  Services.io.speculativeConnect(uri, Services.scriptSecurityManager.getSystemPrincipal(), null);
   await notificationPromise;
 
   await handlingExt.unload();
 });
--- a/toolkit/components/remotebrowserutils/RemoteWebNavigation.jsm
+++ b/toolkit/components/remotebrowserutils/RemoteWebNavigation.jsm
@@ -77,17 +77,17 @@ RemoteWebNavigation.prototype = {
         // inferred from the current context.
         if (!principal || principal.isSystemPrincipal) {
           let attrs = {
             userContextId: this._browser.getAttribute("usercontextid") || 0,
             privateBrowsingId: PrivateBrowsingUtils.isBrowserPrivate(this._browser) ? 1 : 0,
           };
           principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, attrs);
         }
-        Services.io.speculativeConnect2(uri, principal, null);
+        Services.io.speculativeConnect(uri, principal, null);
       } catch (ex) {
         // Can't setup speculative connection for this uri string for some
         // reason (such as failing to parse the URI), just ignore it.
       }
     }
 
     this._sendMessage("WebNavigation:LoadURI", {
       uri: aURI,
--- a/toolkit/components/search/SearchService.jsm
+++ b/toolkit/components/search/SearchService.jsm
@@ -2499,22 +2499,22 @@ Engine.prototype = {
 
     if (!attrs) {
       attrs = options.window.docShell.getOriginAttributes();
     }
 
     let principal = Services.scriptSecurityManager
                             .createCodebasePrincipal(searchURI, attrs);
 
-    connector.speculativeConnect2(searchURI, principal, callbacks);
+    connector.speculativeConnect(searchURI, principal, callbacks);
 
     if (this.supportsResponseType(URLTYPE_SUGGEST_JSON)) {
       let suggestURI = this.getSubmission("dummy", URLTYPE_SUGGEST_JSON).uri;
       if (suggestURI.prePath != searchURI.prePath)
-        connector.speculativeConnect2(suggestURI, principal, callbacks);
+        connector.speculativeConnect(suggestURI, principal, callbacks);
     }
   },
 };
 
 // nsISearchSubmission
 function Submission(aURI, aPostData = null) {
   this._uri = aURI;
   this._postData = aPostData;
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4627,20 +4627,24 @@ nsresult XREMain::XRE_mainRun() {
     g_unsetenv("DESKTOP_STARTUP_ID");
 #endif
 
 #ifdef XP_MACOSX
     // we re-initialize the command-line service and do appleevents munging
     // after we are sure that we're not restarting
     cmdLine = new nsCommandLine();
 
-    CommandLineServiceMac::SetupMacCommandLine(gArgc, gArgv, false);
-
-    rv = cmdLine->Init(gArgc, gArgv, workingDir,
+    char** tempArgv = static_cast<char**>(malloc(gArgc * sizeof(char*)));
+    for (int i = 0; i < gArgc; i++) {
+      tempArgv[i] = strdup(gArgv[i]);
+    }
+    CommandLineServiceMac::SetupMacCommandLine(gArgc, tempArgv, false);
+    rv = cmdLine->Init(gArgc, tempArgv, workingDir,
                        nsICommandLine::STATE_INITIAL_LAUNCH);
+    free(tempArgv);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 #endif
 
     nsCOMPtr<nsIObserverService> obsService =
         mozilla::services::GetObserverService();
     if (obsService)
       obsService->NotifyObservers(nullptr, "final-ui-startup", nullptr);
 
--- a/toolkit/xre/nsCommandLineServiceMac.mm
+++ b/toolkit/xre/nsCommandLineServiceMac.mm
@@ -30,16 +30,18 @@ void AddToCommandLine(const char* inArgT
   if (!temp2) return;
 
   sArgs[sArgsUsed++] = temp2;
   sArgs[sArgsUsed] = nullptr;
 
   return;
 }
 
+// Caller has ownership of argv and is responsible for freeing the allocated
+// memory.
 void SetupMacCommandLine(int& argc, char**& argv, bool forRestart) {
   sArgs = static_cast<char**>(malloc(kArgsGrowSize * sizeof(char*)));
   if (!sArgs) return;
   sArgsAllocated = kArgsGrowSize;
   sArgs[0] = nullptr;
   sArgsUsed = 0;
 
   sBuildingCommandLine = true;
@@ -66,16 +68,17 @@ void SetupMacCommandLine(int& argc, char
     NSRunningApplication* frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication];
     if ([frontApp isEqual:[NSRunningApplication currentApplication]]) {
       AddToCommandLine("-foreground");
     }
   }
 
   sBuildingCommandLine = false;
 
+  free(argv);
   argc = sArgsUsed;
   argv = sArgs;
 }
 
 bool AddURLToCurrentCommandLine(const char* aURL) {
   if (!sBuildingCommandLine) {
     return false;
   }
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -561,17 +561,17 @@ static void ApplyUpdate(nsIFile *greDir,
 
   int argc = 5;
   if (restart) {
     argc = appArgc + 6;
     if (gRestartedByOS) {
       argc += 1;
     }
   }
-  char **argv = new char *[argc + 1];
+  char** argv = static_cast<char**>(malloc((argc + 1) * sizeof(char*)));
   if (!argv) {
     return;
   }
   argv[0] = (char *)updaterPath.get();
   argv[1] = (char *)updateDirPath.get();
   argv[2] = (char *)installDirPath.get();
   argv[3] = (char *)applyToDirPath.get();
   argv[4] = (char *)pid.get();
@@ -597,48 +597,52 @@ static void ApplyUpdate(nsIFile *greDir,
 
 #if defined(XP_UNIX) && !defined(XP_MACOSX)
   // We use execv to spawn the updater process on all UNIX systems except Mac
   // OSX since it is known to cause problems on the Mac.  Windows has execv, but
   // it is a faked implementation that doesn't really replace the current
   // process. Instead it spawns a new process, so we gain nothing from using
   // execv on Windows.
   if (restart) {
-    exit(execv(updaterPath.get(), argv));
+    int execResult = execv(updaterPath.get(), argv);
+    free(argv);
+    exit(execResult);
   }
   *outpid = fork();
   if (*outpid == -1) {
-    delete[] argv;
+    free(argv);
     return;
   } else if (*outpid == 0) {
-    exit(execv(updaterPath.get(), argv));
+    int execResult = execv(updaterPath.get(), argv);
+    free(argv);
+    exit(execResult);
   }
-  delete[] argv;
 #elif defined(XP_WIN)
   if (isStaged) {
     // Launch the updater to replace the installation with the staged updated.
     if (!WinLaunchChild(updaterPathW.get(), argc, argv)) {
-      delete[] argv;
+      free(argv);
       return;
     }
   } else {
     // Launch the updater to either stage or apply an update.
     if (!WinLaunchChild(updaterPathW.get(), argc, argv, nullptr, outpid)) {
-      delete[] argv;
+      free(argv);
       return;
     }
   }
-  delete[] argv;
 #elif defined(XP_MACOSX)
 UpdateDriverSetupMacCommandLine(argc, argv, restart);
 // We need to detect whether elevation is required for this update. This can
 // occur when an admin user installs the application, but another admin
 // user attempts to update (see bug 394984).
 if (restart && !IsRecursivelyWritable(installDirPath.get())) {
-  if (!LaunchElevatedUpdate(argc, argv, outpid)) {
+  bool hasLaunched = LaunchElevatedUpdate(argc, argv, outpid);
+  free(argv);
+  if (!hasLaunched) {
     LOG(("Failed to launch elevated update!"));
     exit(1);
   }
   exit(0);
 }
 
 if (isStaged) {
   // Launch the updater to replace the installation with the staged updated.
@@ -651,16 +655,17 @@ if (isStaged) {
 if (isStaged) {
   // Launch the updater to replace the installation with the staged updated.
   PR_CreateProcessDetached(updaterPath.get(), argv, nullptr, nullptr);
 } else {
   // Launch the updater to either stage or apply an update.
   *outpid = PR_CreateProcess(updaterPath.get(), argv, nullptr, nullptr);
 }
 #endif
+  free(argv);
   if (restart) {
     exit(0);
   }
 }
 
 /**
  * Wait briefly to see if a process terminates, then return true if it has.
  */
--- a/uriloader/exthandler/ExternalHelperAppParent.cpp
+++ b/uriloader/exthandler/ExternalHelperAppParent.cpp
@@ -29,17 +29,16 @@ namespace dom {
 
 NS_IMPL_ISUPPORTS_INHERITED(ExternalHelperAppParent, nsHashPropertyBag,
                             nsIRequest, nsIChannel, nsIMultiPartChannel,
                             nsIPrivateBrowsingChannel, nsIResumableChannel,
                             nsIStreamListener, nsIExternalHelperAppParent)
 
 ExternalHelperAppParent::ExternalHelperAppParent(
     const OptionalURIParams& uri,
-    const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
     const int64_t& aContentLength, const bool& aWasFileChannel,
     const nsCString& aContentDispositionHeader,
     const uint32_t& aContentDispositionHint,
     const nsString& aContentDispositionFilename)
     : mURI(DeserializeURI(uri)),
       mPending(false)
 #ifdef DEBUG
       ,
@@ -56,18 +55,16 @@ ExternalHelperAppParent::ExternalHelperA
     NS_GetFilenameFromDisposition(mContentDispositionFilename,
                                   mContentDispositionHeader, mURI);
     mContentDisposition =
         NS_GetContentDispositionFromHeader(mContentDispositionHeader, this);
   } else {
     mContentDisposition = aContentDispositionHint;
     mContentDispositionFilename = aContentDispositionFilename;
   }
-  mozilla::ipc::LoadInfoArgsToLoadInfo(aLoadInfoArgs,
-                                       getter_AddRefs(mLoadInfo));
 }
 
 already_AddRefed<nsIInterfaceRequestor> GetWindowFromTabParent(
     PBrowserParent* aBrowser) {
   if (!aBrowser) {
     return nullptr;
   }
 
@@ -83,21 +80,24 @@ already_AddRefed<nsIInterfaceRequestor> 
 
 void UpdateContentContext(nsIStreamListener* aListener,
                           PBrowserParent* aBrowser) {
   MOZ_ASSERT(aListener);
   nsCOMPtr<nsIInterfaceRequestor> window = GetWindowFromTabParent(aBrowser);
   static_cast<nsExternalAppHandler*>(aListener)->SetContentContext(window);
 }
 
-void ExternalHelperAppParent::Init(ContentParent* parent,
+void ExternalHelperAppParent::Init(const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
                                    const nsCString& aMimeContentType,
                                    const bool& aForceSave,
                                    const OptionalURIParams& aReferrer,
                                    PBrowserParent* aBrowser) {
+  mozilla::ipc::LoadInfoArgsToLoadInfo(aLoadInfoArgs,
+                                       getter_AddRefs(mLoadInfo));
+
   nsCOMPtr<nsIExternalHelperAppService> helperAppService =
       do_GetService(NS_EXTERNALHELPERAPPSERVICE_CONTRACTID);
   NS_ASSERTION(helperAppService, "No Helper App Service!");
 
   nsCOMPtr<nsIURI> referrer = DeserializeURI(aReferrer);
   if (referrer)
     SetPropertyAsInterface(NS_LITERAL_STRING("docshell.internalReferrer"),
                            referrer);
--- a/uriloader/exthandler/ExternalHelperAppParent.h
+++ b/uriloader/exthandler/ExternalHelperAppParent.h
@@ -81,24 +81,23 @@ class ExternalHelperAppParent
 
   mozilla::ipc::IPCResult RecvDivertToParentUsing(
       PChannelDiverterParent* diverter, PBrowserParent* aBrowser) override;
 
   bool WasFileChannel() override { return mWasFileChannel; }
 
   ExternalHelperAppParent(
       const OptionalURIParams& uri,
-      const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
       const int64_t& contentLength, const bool& wasFileChannel,
       const nsCString& aContentDispositionHeader,
       const uint32_t& aContentDispositionHint,
       const nsString& aContentDispositionFilename);
-  void Init(ContentParent* parent, const nsCString& aMimeContentType,
-            const bool& aForceSave, const OptionalURIParams& aReferrer,
-            PBrowserParent* aBrowser);
+  void Init(const mozilla::net::OptionalLoadInfoArgs& aLoadInfoArgs,
+            const nsCString& aMimeContentType, const bool& aForceSave,
+            const OptionalURIParams& aReferrer, PBrowserParent* aBrowser);
 
  protected:
   virtual ~ExternalHelperAppParent();
 
   virtual void ActorDestroy(ActorDestroyReason why) override;
   void Delete();
 
  private:
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -135,17 +135,17 @@ class GeckoThreadSupport final
     nsCOMPtr<nsIURI> uri = nsAppShell::ResolveURI(aUriStr->ToCString());
     if (!uri) {
       return;
     }
 
     OriginAttributes attrs;
     nsCOMPtr<nsIPrincipal> principal =
         BasePrincipal::CreateCodebasePrincipal(uri, attrs);
-    specConn->SpeculativeConnect2(uri, principal, nullptr);
+    specConn->SpeculativeConnect(uri, principal, nullptr);
   }
 
   static bool WaitOnGecko(int64_t timeoutMillis) {
     struct NoOpRunnable : Runnable {
       NoOpRunnable() : Runnable("NoOpRunnable") {}
       NS_IMETHOD Run() override { return NS_OK; }
     };