зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1195167 part 4: Remove FetchDriver::BasicFetch since it is empty. r=bkelly
This commit is contained in:
Родитель
c21e611fda
Коммит
3f1ac1dbe1
|
@ -117,8 +117,6 @@ FetchDriver::SetTaintingAndGetNextOp()
|
||||||
requestURI,
|
requestURI,
|
||||||
mPrincipal,
|
mPrincipal,
|
||||||
mDocument,
|
mDocument,
|
||||||
// FIXME(nsm): Should MIME be extracted from
|
|
||||||
// Content-Type header?
|
|
||||||
EmptyCString(), /* mime guess */
|
EmptyCString(), /* mime guess */
|
||||||
nullptr, /* extra */
|
nullptr, /* extra */
|
||||||
&shouldLoad,
|
&shouldLoad,
|
||||||
|
@ -145,7 +143,7 @@ FetchDriver::SetTaintingAndGetNextOp()
|
||||||
(NS_IsAboutBlank(requestURI) ||
|
(NS_IsAboutBlank(requestURI) ||
|
||||||
NS_SUCCEEDED(mPrincipal->CheckMayLoad(requestURI, false /* report */,
|
NS_SUCCEEDED(mPrincipal->CheckMayLoad(requestURI, false /* report */,
|
||||||
true /*allowIfInheritsPrincipal*/)))) {
|
true /*allowIfInheritsPrincipal*/)))) {
|
||||||
return MainFetchOp(BASIC_FETCH);
|
return MainFetchOp(HTTP_FETCH, false /* cors */, false /* preflight */);
|
||||||
}
|
}
|
||||||
|
|
||||||
// request's mode is "same-origin"
|
// request's mode is "same-origin"
|
||||||
|
@ -156,7 +154,7 @@ FetchDriver::SetTaintingAndGetNextOp()
|
||||||
// request's mode is "no-cors"
|
// request's mode is "no-cors"
|
||||||
if (mRequest->Mode() == RequestMode::No_cors) {
|
if (mRequest->Mode() == RequestMode::No_cors) {
|
||||||
mRequest->SetResponseTainting(InternalRequest::RESPONSETAINT_OPAQUE);
|
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"
|
// request's mode is "cors-with-forced-preflight"
|
||||||
|
@ -194,10 +192,6 @@ FetchDriver::ContinueFetch()
|
||||||
return FailWithNetworkError();
|
return FailWithNetworkError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextOp.mType == BASIC_FETCH) {
|
|
||||||
return BasicFetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextOp.mType == HTTP_FETCH) {
|
if (nextOp.mType == HTTP_FETCH) {
|
||||||
return HttpFetch(nextOp.mCORSFlag, nextOp.mCORSPreflightFlag);
|
return HttpFetch(nextOp.mCORSFlag, nextOp.mCORSPreflightFlag);
|
||||||
}
|
}
|
||||||
|
@ -206,12 +200,6 @@ FetchDriver::ContinueFetch()
|
||||||
return FailWithNetworkError();
|
return FailWithNetworkError();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
|
||||||
FetchDriver::BasicFetch()
|
|
||||||
{
|
|
||||||
return HttpFetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function implements the "HTTP Fetch" algorithm from the Fetch spec.
|
// This function implements the "HTTP Fetch" algorithm from the Fetch spec.
|
||||||
// Functionality is often split between here, the CORS listener proxy and the
|
// Functionality is often split between here, the CORS listener proxy and the
|
||||||
// Necko HTTP implementation.
|
// 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
|
// 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.
|
// fetch. If we've ever been CORS, we need to stay CORS.
|
||||||
MOZ_ASSERT(nextOp.mType == BASIC_FETCH || nextOp.mType == HTTP_FETCH);
|
MOZ_ASSERT(nextOp.mType == HTTP_FETCH);
|
||||||
MOZ_ASSERT_IF(mCORSFlagEverSet, nextOp.mType == HTTP_FETCH);
|
|
||||||
MOZ_ASSERT_IF(mCORSFlagEverSet, nextOp.mCORSFlag);
|
MOZ_ASSERT_IF(mCORSFlagEverSet, nextOp.mCORSFlag);
|
||||||
|
|
||||||
// Examine and possibly set the LOAD_ANONYMOUS flag on the channel.
|
// Examine and possibly set the LOAD_ANONYMOUS flag on the channel.
|
||||||
|
|
|
@ -95,7 +95,6 @@ private:
|
||||||
enum MainFetchOpType
|
enum MainFetchOpType
|
||||||
{
|
{
|
||||||
NETWORK_ERROR,
|
NETWORK_ERROR,
|
||||||
BASIC_FETCH,
|
|
||||||
HTTP_FETCH,
|
HTTP_FETCH,
|
||||||
NUM_MAIN_FETCH_OPS
|
NUM_MAIN_FETCH_OPS
|
||||||
};
|
};
|
||||||
|
@ -116,7 +115,6 @@ private:
|
||||||
nsresult Fetch();
|
nsresult Fetch();
|
||||||
MainFetchOp SetTaintingAndGetNextOp();
|
MainFetchOp SetTaintingAndGetNextOp();
|
||||||
nsresult ContinueFetch();
|
nsresult ContinueFetch();
|
||||||
nsresult BasicFetch();
|
|
||||||
nsresult HttpFetch(bool aCORSFlag = false, bool aCORSPreflightFlag = false, bool aAuthenticationFlag = false);
|
nsresult HttpFetch(bool aCORSFlag = false, bool aCORSPreflightFlag = false, bool aAuthenticationFlag = false);
|
||||||
nsresult ContinueHttpFetchAfterNetworkFetch();
|
nsresult ContinueHttpFetchAfterNetworkFetch();
|
||||||
// Returns the filtered response sent to the observer.
|
// Returns the filtered response sent to the observer.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче