Bug 1199049 - Part 14: Cancel the original channel in case a CORS preflight fails using AsyncAbort(); r=jduell
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 04 Sep 2015 13:36:10 -0400
changeset 294833 29f4582c95e035e6ac9abb763087627f7ba62c77
parent 294832 03449091a3a3fdad9ed27fa36b4fa56236341604
child 294834 0a017caf03c4978b453e853f440a62755e9761ef
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)
reviewersjduell
bugs1199049
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 1199049 - Part 14: Cancel the original channel in case a CORS preflight fails using AsyncAbort(); r=jduell
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -7015,18 +7015,15 @@ nsHttpChannel::OnPreflightSucceeded()
 
 NS_IMETHODIMP
 nsHttpChannel::OnPreflightFailed(nsresult aError)
 {
     MOZ_ASSERT(mRequireCORSPreflight, "Why did a preflight happen?");
     mIsCorsPreflightDone = 1;
     mPreflightChannel = nullptr;
 
-    Cancel(aError);
-    mListener->OnStartRequest(this, mListenerContext);
-    mListener->OnStopRequest(this, mListenerContext, aError);
-
     CloseCacheEntry(true);
+    AsyncAbort(aError);
     return NS_OK;
 }
 
 } // namespace net
 } // namespace mozilla