Bug 966573 - Use speculative connections for URLs coming into BrowserCLH.js r=wesj
authorMark Finkle <mfinkle@mozilla.com>
Wed, 12 Feb 2014 11:27:25 -0500
changeset 168351 c95d496bb2702c3786c8b9b900e62ea42382bf96
parent 168350 03bf10b236ea5cf06e224ebd9e3268e67b9af9f4
child 168352 725892611403129a46597d4f197b77704994cff1
push id5026
push usermfinkle@mozilla.com
push dateWed, 12 Feb 2014 16:28:01 +0000
treeherderfx-team@c95d496bb270 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs966573
milestone30.0a1
Bug 966573 - Use speculative connections for URLs coming into BrowserCLH.js r=wesj
mobile/android/components/BrowserCLH.js
--- a/mobile/android/components/BrowserCLH.js
+++ b/mobile/android/components/BrowserCLH.js
@@ -83,16 +83,19 @@ BrowserCLH.prototype = {
       height = aCmdLine.handleFlagWithParam("height", false);
     } catch (e) { /* Optional */ }
 
     try {
       let uri = resolveURIInternal(aCmdLine, openURL);
       if (!uri)
         return;
 
+      // Let's get a head start on opening the network connection to the URI we are about to load
+      Services.io.QueryInterface(Ci.nsISpeculativeConnect).speculativeConnect(uri, null);
+
       let browserWin = Services.wm.getMostRecentWindow("navigator:browser");
       if (browserWin) {
         if (!pinned) {
           browserWin.browserDOMWindow.openURI(uri, null, Ci.nsIBrowserDOMWindow.OPEN_NEWTAB, Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
         }
       } else {
         let args = {
           url: openURL,