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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 r->headers()->append("Content-Type", init.contentType, exceptionStat
e); | 256 r->headers()->append("Content-Type", init.contentType, exceptionStat
e); |
257 } | 257 } |
258 if (exceptionState.hadException()) | 258 if (exceptionState.hadException()) |
259 return nullptr; | 259 return nullptr; |
260 } | 260 } |
261 | 261 |
262 // "33. Set |r|'s body to |temporaryBody|. | 262 // "33. Set |r|'s body to |temporaryBody|. |
263 if (temporaryBody) | 263 if (temporaryBody) |
264 r->m_request->setBuffer(temporaryBody); | 264 r->m_request->setBuffer(temporaryBody); |
265 | 265 |
| 266 // https://w3c.github.io/webappsec/specs/credentialmanagement/#monkey-patchi
ng-fetch-2 |
| 267 if (init.opaque || (inputRequest && inputRequest->opaque())) |
| 268 r->makeOpaque(); |
| 269 |
266 // "34. Set |r|'s MIME type to the result of extracting a MIME type from | 270 // "34. Set |r|'s MIME type to the result of extracting a MIME type from |
267 // |r|'s request's header list." | 271 // |r|'s request's header list." |
268 r->m_request->setMIMEType(r->m_request->headerList()->extractMIMEType()); | 272 r->m_request->setMIMEType(r->m_request->headerList()->extractMIMEType()); |
269 | 273 |
270 // "35. If |input| is a Request object and |input|'s body is non-null, run | 274 // "35. If |input| is a Request object and |input|'s body is non-null, run |
271 // these substeps:" | 275 // these substeps:" |
272 // We set bodyUsed even when the body is null in spite of the | 276 // We set bodyUsed even when the body is null in spite of the |
273 // spec. See https://github.com/whatwg/fetch/issues/61 for details. | 277 // spec. See https://github.com/whatwg/fetch/issues/61 for details. |
274 if (inputRequest) { | 278 if (inputRequest) { |
275 // "1. Set |input|'s body to null." | 279 // "1. Set |input|'s body to null." |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 554 } |
551 | 555 |
552 DEFINE_TRACE(Request) | 556 DEFINE_TRACE(Request) |
553 { | 557 { |
554 Body::trace(visitor); | 558 Body::trace(visitor); |
555 visitor->trace(m_request); | 559 visitor->trace(m_request); |
556 visitor->trace(m_headers); | 560 visitor->trace(m_headers); |
557 } | 561 } |
558 | 562 |
559 } // namespace blink | 563 } // namespace blink |
OLD | NEW |