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

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 edfd1021abdd8e3092f832246100ad115a3cf2cd..ba4eb25de732bf9414daed7e62f7fdd44ee67643 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -209,6 +209,9 @@ void FetchManager::Loader::didReceiveResponse(unsigned long, const ResourceRespo
// origin.
if (!SecurityOrigin::create(response.url())->isSameSchemeHostPort(m_request->origin().get())) {
switch (m_request->mode()) {
+ case WebURLRequest::FetchRequestModeNavigate:
+ m_request->setResponseTainting(FetchRequestData::OpaqueTainting);
horo 2015/10/14 10:05:31 I think this should be "ASSERT_NOT_REACHED();". T
shiva.jm 2015/10/14 10:59:06 Done, had same opinion in patchset2, but miss read
hiroshige 2015/10/15 06:37:03 horo@, What poses this limitation? The current Fet
horo 2015/10/15 11:43:05 "navigate" request is created only while "Navigati
+ break;
case WebURLRequest::FetchRequestModeSameOrigin:
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."
@@ -535,6 +545,9 @@ void FetchManager::Loader::performHTTPFetch(bool corsFlag, bool corsPreflightFla
if (corsPreflightFlag)
threadableLoaderOptions.preflightPolicy = ForcePreflight;
switch (m_request->mode()) {
+ case WebURLRequest::FetchRequestModeNavigate:
+ threadableLoaderOptions.crossOriginRequestPolicy = AllowCrossOriginRequests;
horo 2015/10/14 10:05:31 We don't need to allow cross origin requests. This
shiva.jm 2015/10/14 10:59:06 Done, had same opinion in patchset2, but miss read
hiroshige 2015/10/15 06:37:03 horo@, I want to clarify why this should be DenyCr
horo 2015/10/15 11:43:05 "navigate" request is only available in ServiceWor
yhirano 2015/10/16 18:15:53 (to: horo@) I feel it confusing. How about - usin
horo 2015/10/19 04:08:13 Yes, we should have comments. But I think we shoul
+ break;
case WebURLRequest::FetchRequestModeSameOrigin:
threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginRequests;
break;

Powered by Google App Engine
This is Rietveld 408576698