| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 { | 600 { |
| 601 ASSERT(!bodyUsed()); | 601 ASSERT(!bodyUsed()); |
| 602 return m_request->pass(executionContext()); | 602 return m_request->pass(executionContext()); |
| 603 } | 603 } |
| 604 | 604 |
| 605 bool Request::hasBody() const | 605 bool Request::hasBody() const |
| 606 { | 606 { |
| 607 return bodyBuffer(); | 607 return bodyBuffer(); |
| 608 } | 608 } |
| 609 | 609 |
| 610 void Request::stop() |
| 611 { |
| 612 if (bodyBuffer()) |
| 613 bodyBuffer()->stop(); |
| 614 } |
| 615 |
| 610 void Request::populateWebServiceWorkerRequest(WebServiceWorkerRequest& webReques
t) const | 616 void Request::populateWebServiceWorkerRequest(WebServiceWorkerRequest& webReques
t) const |
| 611 { | 617 { |
| 612 webRequest.setMethod(method()); | 618 webRequest.setMethod(method()); |
| 613 webRequest.setRequestContext(m_request->context()); | 619 webRequest.setRequestContext(m_request->context()); |
| 614 // This strips off the fragment part. | 620 // This strips off the fragment part. |
| 615 webRequest.setURL(url()); | 621 webRequest.setURL(url()); |
| 616 | 622 |
| 617 const FetchHeaderList* headerList = m_headers->headerList(); | 623 const FetchHeaderList* headerList = m_headers->headerList(); |
| 618 for (size_t i = 0, size = headerList->size(); i < size; ++i) { | 624 for (size_t i = 0, size = headerList->size(); i < size; ++i) { |
| 619 const FetchHeaderList::Header& header = headerList->entry(i); | 625 const FetchHeaderList::Header& header = headerList->entry(i); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 631 } | 637 } |
| 632 | 638 |
| 633 DEFINE_TRACE(Request) | 639 DEFINE_TRACE(Request) |
| 634 { | 640 { |
| 635 Body::trace(visitor); | 641 Body::trace(visitor); |
| 636 visitor->trace(m_request); | 642 visitor->trace(m_request); |
| 637 visitor->trace(m_headers); | 643 visitor->trace(m_headers); |
| 638 } | 644 } |
| 639 | 645 |
| 640 } // namespace blink | 646 } // namespace blink |
| OLD | NEW |