From 3f1ac1dbe1f430bb93219832e1cdc78c575367ca Mon Sep 17 00:00:00 2001 From: Jonas Sicking Date: Mon, 19 Oct 2015 18:24:36 -0700 Subject: [PATCH] Bug 1195167 part 4: Remove FetchDriver::BasicFetch since it is empty. r=bkelly --- dom/fetch/FetchDriver.cpp | 21 ++++----------------- dom/fetch/FetchDriver.h | 2 -- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 0e81a671ce72..c37a4696992f 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -117,8 +117,6 @@ FetchDriver::SetTaintingAndGetNextOp() requestURI, mPrincipal, mDocument, - // FIXME(nsm): Should MIME be extracted from - // Content-Type header? EmptyCString(), /* mime guess */ nullptr, /* extra */ &shouldLoad, @@ -145,7 +143,7 @@ FetchDriver::SetTaintingAndGetNextOp() (NS_IsAboutBlank(requestURI) || NS_SUCCEEDED(mPrincipal->CheckMayLoad(requestURI, false /* report */, true /*allowIfInheritsPrincipal*/)))) { - return MainFetchOp(BASIC_FETCH); + return MainFetchOp(HTTP_FETCH, false /* cors */, false /* preflight */); } // request's mode is "same-origin" @@ -156,7 +154,7 @@ FetchDriver::SetTaintingAndGetNextOp() // request's mode is "no-cors" if (mRequest->Mode() == RequestMode::No_cors) { mRequest->SetResponseTainting(InternalRequest::RESPONSETAINT_OPAQUE); - return MainFetchOp(BASIC_FETCH); + return MainFetchOp(HTTP_FETCH, false /* cors */, false /* preflight */); } // request's mode is "cors-with-forced-preflight" @@ -194,10 +192,6 @@ FetchDriver::ContinueFetch() return FailWithNetworkError(); } - if (nextOp.mType == BASIC_FETCH) { - return BasicFetch(); - } - if (nextOp.mType == HTTP_FETCH) { return HttpFetch(nextOp.mCORSFlag, nextOp.mCORSPreflightFlag); } @@ -206,12 +200,6 @@ FetchDriver::ContinueFetch() return FailWithNetworkError(); } -nsresult -FetchDriver::BasicFetch() -{ - return HttpFetch(); -} - // This function implements the "HTTP Fetch" algorithm from the Fetch spec. // Functionality is often split between here, the CORS listener proxy and the // Necko HTTP implementation. @@ -890,10 +878,9 @@ FetchDriver::AsyncOnChannelRedirect(nsIChannel* aOldChannel, } // Otherwise, we rely on necko and the CORS proxy to do the right thing - // as the redirect is followed. In general this means basic or http + // as the redirect is followed. In general this means http // fetch. If we've ever been CORS, we need to stay CORS. - MOZ_ASSERT(nextOp.mType == BASIC_FETCH || nextOp.mType == HTTP_FETCH); - MOZ_ASSERT_IF(mCORSFlagEverSet, nextOp.mType == HTTP_FETCH); + MOZ_ASSERT(nextOp.mType == HTTP_FETCH); MOZ_ASSERT_IF(mCORSFlagEverSet, nextOp.mCORSFlag); // Examine and possibly set the LOAD_ANONYMOUS flag on the channel. diff --git a/dom/fetch/FetchDriver.h b/dom/fetch/FetchDriver.h index b075b05daf6b..17f5b7eb347f 100644 --- a/dom/fetch/FetchDriver.h +++ b/dom/fetch/FetchDriver.h @@ -95,7 +95,6 @@ private: enum MainFetchOpType { NETWORK_ERROR, - BASIC_FETCH, HTTP_FETCH, NUM_MAIN_FETCH_OPS }; @@ -116,7 +115,6 @@ private: nsresult Fetch(); MainFetchOp SetTaintingAndGetNextOp(); nsresult ContinueFetch(); - nsresult BasicFetch(); nsresult HttpFetch(bool aCORSFlag = false, bool aCORSPreflightFlag = false, bool aAuthenticationFlag = false); nsresult ContinueHttpFetchAfterNetworkFetch(); // Returns the filtered response sent to the observer.