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

Unified Diff: Source/modules/fetch/Request.cpp

Issue 1280733002: [3/3 blink] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Redirect1
Patch Set: add comment Created 5 years, 4 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
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.cpp ('k') | Source/modules/fetch/Request.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/Request.cpp
diff --git a/Source/modules/fetch/Request.cpp b/Source/modules/fetch/Request.cpp
index 97ce6fd3deec319ced9f9a1293ae92fbadbf2881..7d4223c09ba2756cbfd23e77ac3d5f9bae849501 100644
--- a/Source/modules/fetch/Request.cpp
+++ b/Source/modules/fetch/Request.cpp
@@ -156,8 +156,15 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
// TODO(yhirano): "21. If |init|'s cache member is present, set |request|'s
// cache mode to it."
- // TODO(horo): "22. If |init|'s redirect member is present, set |request|'s
- // redirect mode to it."
+ // "22. If |init|'s redirect member is present, set |request|'s redirect
+ // mode to it."
+ if (init.redirect == "follow") {
+ request->setRedirect(WebURLRequest::FetchRedirectModeFollow);
+ } else if (init.redirect == "error") {
+ request->setRedirect(WebURLRequest::FetchRedirectModeError);
+ } else if (init.redirect == "manual") {
+ request->setRedirect(WebURLRequest::FetchRedirectModeManual);
+ }
// TODO(jww): "23. If |init|'s integrity member is present, set |request|'s
// integrity metadata to it."
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.cpp ('k') | Source/modules/fetch/Request.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698