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 "Request.h" | 6 #include "Request.h" |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
10 #include "core/fetch/FetchUtils.h" | 10 #include "core/fetch/FetchUtils.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace blink { | 21 namespace blink { |
22 | 22 |
23 Request* Request::createRequestWithRequestData(ExecutionContext* context, FetchR
equestData* request, const RequestInit& init, WebURLRequest::FetchRequestMode mo
de, WebURLRequest::FetchCredentialsMode credentials, ExceptionState& exceptionSt
ate) | 23 Request* Request::createRequestWithRequestData(ExecutionContext* context, FetchR
equestData* request, const RequestInit& init, WebURLRequest::FetchRequestMode mo
de, WebURLRequest::FetchCredentialsMode credentials, ExceptionState& exceptionSt
ate) |
24 { | 24 { |
25 // "7. Let |mode| be |init|'s mode member if it is present, and | 25 // "7. Let |mode| be |init|'s mode member if it is present, and |
26 // |fallbackMode| otherwise." | 26 // |fallbackMode| otherwise." |
27 // "8. If |mode| is non-null, set |request|'s mode to |mode|." | 27 // "8. If |mode| is non-null, set |request|'s mode to |mode|." |
28 if (init.mode == "same-origin") { | 28 if (init.mode == "same-origin") { |
29 request->setMode(WebURLRequest::FetchRequestModeSameOrigin); | 29 request->setMode(WebURLRequest::FetchRequestModeSameOrigin); |
30 } else if (init.mode == "no-cors") { | 30 } else if (init.mode == "no-cors") { |
31 request->setMode(mode = WebURLRequest::FetchRequestModeNoCORS); | 31 request->setMode(WebURLRequest::FetchRequestModeNoCORS); |
32 } else if (init.mode == "cors") { | 32 } else if (init.mode == "cors") { |
33 request->setMode(WebURLRequest::FetchRequestModeCORS); | 33 request->setMode(WebURLRequest::FetchRequestModeCORS); |
34 } else { | 34 } else { |
35 // Instead of using null as a special fallback value, we pass the | 35 // Instead of using null as a special fallback value, we pass the |
36 // current mode in Request::create(). So we just set here. | 36 // current mode in Request::create(). So we just set here. |
37 request->setMode(mode); | 37 request->setMode(mode); |
38 } | 38 } |
39 | 39 |
40 // "9. Let |credentials| be |init|'s credentials member if it is present, | 40 // "9. Let |credentials| be |init|'s credentials member if it is present, |
41 // and |fallbackCredentials| otherwise." | 41 // and |fallbackCredentials| otherwise." |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 | 331 |
332 void Request::trace(Visitor* visitor) | 332 void Request::trace(Visitor* visitor) |
333 { | 333 { |
334 Body::trace(visitor); | 334 Body::trace(visitor); |
335 visitor->trace(m_request); | 335 visitor->trace(m_request); |
336 visitor->trace(m_headers); | 336 visitor->trace(m_headers); |
337 } | 337 } |
338 | 338 |
339 } // namespace blink | 339 } // namespace blink |
OLD | NEW |