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

Unified Diff: third_party/WebKit/Source/modules/fetch/Request.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/Request.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp
index 6cc792b88301ee34dc12b0111f299471192655fa..02ca1a5ec6ce121e0d78c4d800ba71e7dd0b08d7 100644
--- a/third_party/WebKit/Source/modules/fetch/Request.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Request.cpp
@@ -162,9 +162,14 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
}
- // "17. Let |mode| be |init|'s mode member if it is present, and
+ // "16. Let |mode| be |init|'s mode member if it is present, and
// |fallbackMode| otherwise."
+ // "17.If mode is "navigate", throw a TypeError.
// "18. If |mode| is non-null, set |request|'s mode to |mode|."
+ if (init.mode == "navigate") {
+ exceptionState.throwTypeError("Cannot construct a Request with a Request mode as navigate.");
+ return nullptr;
+ }
if (init.mode == "same-origin") {
request->setMode(WebURLRequest::FetchRequestModeSameOrigin);
} else if (init.mode == "no-cors") {
@@ -497,6 +502,8 @@ String Request::mode() const
case WebURLRequest::FetchRequestModeCORS:
case WebURLRequest::FetchRequestModeCORSWithForcedPreflight:
return "cors";
+ case WebURLRequest::FetchRequestModeNavigate:
+ return "navigate";
}
ASSERT_NOT_REACHED();
return "";

Powered by Google App Engine
This is Rietveld 408576698