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 "bindings/core/v8/V8PrivateProperty.h" | 8 #include "bindings/core/v8/V8PrivateProperty.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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 web_request.SetRequestContext(request_->Context()); | 725 web_request.SetRequestContext(request_->Context()); |
726 | 726 |
727 // Strip off the fragment part of URL. So far, all users of | 727 // Strip off the fragment part of URL. So far, all users of |
728 // WebServiceWorkerRequest expect the fragment to be excluded. | 728 // WebServiceWorkerRequest expect the fragment to be excluded. |
729 KURL url(request_->Url()); | 729 KURL url(request_->Url()); |
730 if (request_->Url().HasFragmentIdentifier()) | 730 if (request_->Url().HasFragmentIdentifier()) |
731 url.RemoveFragmentIdentifier(); | 731 url.RemoveFragmentIdentifier(); |
732 web_request.SetURL(url); | 732 web_request.SetURL(url); |
733 | 733 |
734 const FetchHeaderList* header_list = headers_->HeaderList(); | 734 const FetchHeaderList* header_list = headers_->HeaderList(); |
735 for (size_t i = 0, size = header_list->size(); i < size; ++i) { | 735 for (const auto& header : header_list->List()) { |
736 const FetchHeaderList::Header& header = header_list->Entry(i); | |
737 web_request.AppendHeader(header.first, header.second); | 736 web_request.AppendHeader(header.first, header.second); |
738 } | 737 } |
739 | 738 |
740 web_request.SetReferrer( | 739 web_request.SetReferrer( |
741 request_->ReferrerString(), | 740 request_->ReferrerString(), |
742 static_cast<WebReferrerPolicy>(request_->GetReferrerPolicy())); | 741 static_cast<WebReferrerPolicy>(request_->GetReferrerPolicy())); |
743 // FIXME: How can we set isReload properly? What is the correct place to load | 742 // FIXME: How can we set isReload properly? What is the correct place to load |
744 // it in to the Request object? We should investigate the right way to plumb | 743 // it in to the Request object? We should investigate the right way to plumb |
745 // this information in to here. | 744 // this information in to here. |
746 } | 745 } |
(...skipping 17 matching lines...) Expand all Loading... |
764 .Set(request.As<v8::Object>(), body_buffer); | 763 .Set(request.As<v8::Object>(), body_buffer); |
765 } | 764 } |
766 | 765 |
767 DEFINE_TRACE(Request) { | 766 DEFINE_TRACE(Request) { |
768 Body::Trace(visitor); | 767 Body::Trace(visitor); |
769 visitor->Trace(request_); | 768 visitor->Trace(request_); |
770 visitor->Trace(headers_); | 769 visitor->Trace(headers_); |
771 } | 770 } |
772 | 771 |
773 } // namespace blink | 772 } // namespace blink |
OLD | NEW |