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/loader/ThreadableLoader.h" | 10 #include "core/loader/ThreadableLoader.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 } | 693 } |
694 | 694 |
695 void Request::populateWebServiceWorkerRequest( | 695 void Request::populateWebServiceWorkerRequest( |
696 WebServiceWorkerRequest& webRequest) const { | 696 WebServiceWorkerRequest& webRequest) const { |
697 webRequest.setMethod(method()); | 697 webRequest.setMethod(method()); |
698 webRequest.setRequestContext(m_request->context()); | 698 webRequest.setRequestContext(m_request->context()); |
699 // This strips off the fragment part. | 699 // This strips off the fragment part. |
700 webRequest.setURL(url()); | 700 webRequest.setURL(url()); |
701 | 701 |
702 const FetchHeaderList* headerList = m_headers->headerList(); | 702 const FetchHeaderList* headerList = m_headers->headerList(); |
703 for (size_t i = 0, size = headerList->size(); i < size; ++i) { | 703 for (const auto& header : headerList->list()) { |
704 const FetchHeaderList::Header& header = headerList->entry(i); | |
705 webRequest.appendHeader(header.first, header.second); | 704 webRequest.appendHeader(header.first, header.second); |
706 } | 705 } |
707 | 706 |
708 webRequest.setReferrer( | 707 webRequest.setReferrer( |
709 m_request->referrerString(), | 708 m_request->referrerString(), |
710 static_cast<WebReferrerPolicy>(m_request->getReferrerPolicy())); | 709 static_cast<WebReferrerPolicy>(m_request->getReferrerPolicy())); |
711 // FIXME: How can we set isReload properly? What is the correct place to load | 710 // FIXME: How can we set isReload properly? What is the correct place to load |
712 // it in to the Request object? We should investigate the right way to plumb | 711 // it in to the Request object? We should investigate the right way to plumb |
713 // this information in to here. | 712 // this information in to here. |
714 } | 713 } |
(...skipping 18 matching lines...) Expand all Loading... |
733 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer); | 732 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer); |
734 } | 733 } |
735 | 734 |
736 DEFINE_TRACE(Request) { | 735 DEFINE_TRACE(Request) { |
737 Body::trace(visitor); | 736 Body::trace(visitor); |
738 visitor->trace(m_request); | 737 visitor->trace(m_request); |
739 visitor->trace(m_headers); | 738 visitor->trace(m_headers); |
740 } | 739 } |
741 | 740 |
742 } // namespace blink | 741 } // namespace blink |
OLD | NEW |