Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: third_party/WebKit/Source/modules/fetch/FetchManager.cpp

Issue 1391583002: Introduce "navigate" mode in Requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/fetch/FetchManager.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
index 9f61e5eca5799afac76dbdea89ae6320f6355cbc..a8cb2e3696c559f8e60cc9c7cb8a0f67a4307e94 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -219,6 +219,9 @@ void FetchManager::Loader::didReceiveResponse(unsigned long, const ResourceRespo
case WebURLRequest::FetchRequestModeCORSWithForcedPreflight:
m_request->setResponseTainting(FetchRequestData::CORSTainting);
break;
+ case WebURLRequest::FetchRequestModeNavigate:
+ ASSERT_NOT_REACHED();
+ break;
}
}
@@ -381,6 +384,13 @@ void FetchManager::Loader::start()
return;
}
+ // "- |request|'s mode is |navigate|"
+ if (m_request->mode() == WebURLRequest::FetchRequestModeNavigate) {
+ // "The result of performing a basic fetch using |request|."
+ performBasicFetch();
+ return;
+ }
+
// "- |request|'s mode is |same-origin|"
if (m_request->mode() == WebURLRequest::FetchRequestModeSameOrigin) {
// "A network error."
@@ -545,6 +555,9 @@ void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFla
case WebURLRequest::FetchRequestModeCORSWithForcedPreflight:
threadableLoaderOptions.crossOriginRequestPolicy = UseAccessControl;
break;
+ case WebURLRequest::FetchRequestModeNavigate:
+ threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginRequests;
+ break;
}
InspectorInstrumentation::willStartFetch(executionContext(), this);
m_loader = ThreadableLoader::create(*executionContext(), this, request, threadableLoaderOptions, resourceLoaderOptions);

Powered by Google App Engine
This is Rietveld 408576698