| 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 "modules/fetch/Request.h" | 5 #include "modules/fetch/Request.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // "If |init|'s body member is present, run these substeps:" | 337 // "If |init|'s body member is present, run these substeps:" |
| 338 if (init.body) { | 338 if (init.body) { |
| 339 // Perform the following steps: | 339 // Perform the following steps: |
| 340 // - "Let |stream| and |Content-Type| be the result of extracting | 340 // - "Let |stream| and |Content-Type| be the result of extracting |
| 341 // |init|'s body member." | 341 // |init|'s body member." |
| 342 // - "Set |temporaryBody| to |stream|. | 342 // - "Set |temporaryBody| to |stream|. |
| 343 // - "If |Content-Type| is non-null and |r|'s request's header list | 343 // - "If |Content-Type| is non-null and |r|'s request's header list |
| 344 // contains no header named `Content-Type`, append | 344 // contains no header named `Content-Type`, append |
| 345 // `Content-Type`/|Content-Type| to |r|'s Headers object. Rethrow any | 345 // `Content-Type`/|Content-Type| to |r|'s Headers object. Rethrow any |
| 346 // exception." | 346 // exception." |
| 347 temporaryBody = new BodyStreamBuffer(scriptState, init.body.release()); | 347 temporaryBody = new BodyStreamBuffer(scriptState, std::move(init.body)); |
| 348 if (!init.contentType.isEmpty() && !r->getHeaders()->has(HTTPNames::Cont
ent_Type, exceptionState)) { | 348 if (!init.contentType.isEmpty() && !r->getHeaders()->has(HTTPNames::Cont
ent_Type, exceptionState)) { |
| 349 r->getHeaders()->append(HTTPNames::Content_Type, init.contentType, e
xceptionState); | 349 r->getHeaders()->append(HTTPNames::Content_Type, init.contentType, e
xceptionState); |
| 350 } | 350 } |
| 351 if (exceptionState.hadException()) | 351 if (exceptionState.hadException()) |
| 352 return nullptr; | 352 return nullptr; |
| 353 } | 353 } |
| 354 | 354 |
| 355 // "Set |r|'s request's body to |temporaryBody|. | 355 // "Set |r|'s request's body to |temporaryBody|. |
| 356 if (temporaryBody) | 356 if (temporaryBody) |
| 357 r->m_request->setBuffer(temporaryBody); | 357 r->m_request->setBuffer(temporaryBody); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 } | 667 } |
| 668 | 668 |
| 669 DEFINE_TRACE(Request) | 669 DEFINE_TRACE(Request) |
| 670 { | 670 { |
| 671 Body::trace(visitor); | 671 Body::trace(visitor); |
| 672 visitor->trace(m_request); | 672 visitor->trace(m_request); |
| 673 visitor->trace(m_headers); | 673 visitor->trace(m_headers); |
| 674 } | 674 } |
| 675 | 675 |
| 676 } // namespace blink | 676 } // namespace blink |
| OLD | NEW |