Bug 1199491 - Use channel->ascynOpen2 in netwerk/base (r=sicking)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Fri, 11 Sep 2015 18:52:08 -0700
changeset 294697 274e1235193ebd16a8f82c035ccb038ad7ec6ea6
parent 294696 1d016a97a99d41f35f1168c76ed8cf17896e7ccc
child 294698 13082cd9855755a47677a031502bba1f074fa2b5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1199491
milestone43.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 1199491 - Use channel->ascynOpen2 in netwerk/base (r=sicking)
netwerk/base/nsIncrementalDownload.cpp
netwerk/base/nsPACMan.cpp
--- a/netwerk/base/nsIncrementalDownload.cpp
+++ b/netwerk/base/nsIncrementalDownload.cpp
@@ -263,17 +263,17 @@ nsIncrementalDownload::ProcessTimeout()
   }
 
   // Fetch next chunk
   
   nsCOMPtr<nsIChannel> channel;
   nsresult rv = NS_NewChannel(getter_AddRefs(channel),
                               mFinalURI,
                               nsContentUtils::GetSystemPrincipal(),
-                              nsILoadInfo::SEC_NORMAL,
+                              nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                               nsIContentPolicy::TYPE_OTHER,
                               nullptr,   // loadGroup
                               this,      // aCallbacks
                               mLoadFlags);
 
   if (NS_FAILED(rv))
     return rv;
 
@@ -305,17 +305,17 @@ nsIncrementalDownload::ProcessTimeout()
     if (mCacheBust) {
       http->SetRequestHeader(NS_LITERAL_CSTRING("Cache-Control"),
                              NS_LITERAL_CSTRING("no-cache"), false);
       http->SetRequestHeader(NS_LITERAL_CSTRING("Pragma"),
                              NS_LITERAL_CSTRING("no-cache"), false);
     }
   }
 
-  rv = channel->AsyncOpen(this, nullptr);
+  rv = channel->AsyncOpen2(this);
   if (NS_FAILED(rv))
     return rv;
 
   // Wait to assign mChannel when we know we are going to succeed.  This is
   // important because we don't want to introduce a reference cycle between
   // mChannel and this until we know for a fact that AsyncOpen has succeeded,
   // thus ensuring that our stream listener methods will be invoked.
   mChannel = channel;
--- a/netwerk/base/nsPACMan.cpp
+++ b/netwerk/base/nsPACMan.cpp
@@ -448,32 +448,32 @@ nsPACMan::StartLoading()
       NS_NewURI(getter_AddRefs(pacURI), mPACURISpec);
 
       // NOTE: This results in GetProxyForURI being called
       if (pacURI) {
         pacURI->GetSpec(mNormalPACURISpec);
         NS_NewChannel(getter_AddRefs(channel),
                       pacURI,
                       nsContentUtils::GetSystemPrincipal(),
-                      nsILoadInfo::SEC_NORMAL,
+                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                       nsIContentPolicy::TYPE_OTHER,
                       nullptr, // aLoadGroup
                       nullptr, // aCallbacks
                       nsIRequest::LOAD_NORMAL,
                       ios);
       }
       else {
         LOG(("nsPACMan::StartLoading Failed pacspec uri conversion %s\n",
              mPACURISpec.get()));
       }
 
       if (channel) {
         channel->SetLoadFlags(nsIRequest::LOAD_BYPASS_CACHE);
         channel->SetNotificationCallbacks(this);
-        if (NS_SUCCEEDED(channel->AsyncOpen(mLoader, nullptr)))
+        if (NS_SUCCEEDED(channel->AsyncOpen2(mLoader)))
           return;
       }
     }
   }
 
   CancelExistingLoad();
   PostCancelPendingQ(NS_ERROR_UNEXPECTED);
 }