OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/fetch/Request.h" | 6 #include "modules/fetch/Request.h" |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } else if (init.credentials == "include") { | 149 } else if (init.credentials == "include") { |
150 request->setCredentials(WebURLRequest::FetchCredentialsModeInclude); | 150 request->setCredentials(WebURLRequest::FetchCredentialsModeInclude); |
151 } else { | 151 } else { |
152 if (!inputRequest) | 152 if (!inputRequest) |
153 request->setCredentials(WebURLRequest::FetchCredentialsModeOmit); | 153 request->setCredentials(WebURLRequest::FetchCredentialsModeOmit); |
154 } | 154 } |
155 | 155 |
156 // TODO(yhirano): "21. If |init|'s cache member is present, set |request|'s | 156 // TODO(yhirano): "21. If |init|'s cache member is present, set |request|'s |
157 // cache mode to it." | 157 // cache mode to it." |
158 | 158 |
159 // TODO(horo): "22. If |init|'s redirect member is present, set |request|'s | 159 // "22. If |init|'s redirect member is present, set |request|'s redirect |
160 // redirect mode to it." | 160 // mode to it." |
| 161 if (init.redirect == "follow") { |
| 162 request->setRedirect(WebURLRequest::FetchRedirectModeFollow); |
| 163 } else if (init.redirect == "error") { |
| 164 request->setRedirect(WebURLRequest::FetchRedirectModeError); |
| 165 } else if (init.redirect == "manual") { |
| 166 request->setRedirect(WebURLRequest::FetchRedirectModeManual); |
| 167 } |
161 | 168 |
162 // TODO(jww): "23. If |init|'s integrity member is present, set |request|'s | 169 // TODO(jww): "23. If |init|'s integrity member is present, set |request|'s |
163 // integrity metadata to it." | 170 // integrity metadata to it." |
164 | 171 |
165 // "24. If |init|'s method member is present, let |method| be it and run | 172 // "24. If |init|'s method member is present, let |method| be it and run |
166 // these substeps:" | 173 // these substeps:" |
167 if (!init.method.isNull()) { | 174 if (!init.method.isNull()) { |
168 // "1. If |method| is not a method or method is a forbidden method, | 175 // "1. If |method| is not a method or method is a forbidden method, |
169 // throw a TypeError." | 176 // throw a TypeError." |
170 if (!isValidHTTPToken(init.method)) { | 177 if (!isValidHTTPToken(init.method)) { |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 } | 536 } |
530 | 537 |
531 DEFINE_TRACE(Request) | 538 DEFINE_TRACE(Request) |
532 { | 539 { |
533 Body::trace(visitor); | 540 Body::trace(visitor); |
534 visitor->trace(m_request); | 541 visitor->trace(m_request); |
535 visitor->trace(m_headers); | 542 visitor->trace(m_headers); |
536 } | 543 } |
537 | 544 |
538 } // namespace blink | 545 } // namespace blink |
OLD | NEW |