| 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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 web_request.SetRequestContext(request_->Context()); | 694 web_request.SetRequestContext(request_->Context()); |
| 695 | 695 |
| 696 // Strip off the fragment part of URL. So far, all users of | 696 // Strip off the fragment part of URL. So far, all users of |
| 697 // WebServiceWorkerRequest expect the fragment to be excluded. | 697 // WebServiceWorkerRequest expect the fragment to be excluded. |
| 698 KURL url(request_->Url()); | 698 KURL url(request_->Url()); |
| 699 if (request_->Url().HasFragmentIdentifier()) | 699 if (request_->Url().HasFragmentIdentifier()) |
| 700 url.RemoveFragmentIdentifier(); | 700 url.RemoveFragmentIdentifier(); |
| 701 web_request.SetURL(url); | 701 web_request.SetURL(url); |
| 702 | 702 |
| 703 const FetchHeaderList* header_list = headers_->HeaderList(); | 703 const FetchHeaderList* header_list = headers_->HeaderList(); |
| 704 for (size_t i = 0, size = header_list->size(); i < size; ++i) { | 704 for (const auto& header : header_list->List()) { |
| 705 const FetchHeaderList::Header& header = header_list->Entry(i); | |
| 706 web_request.AppendHeader(header.first, header.second); | 705 web_request.AppendHeader(header.first, header.second); |
| 707 } | 706 } |
| 708 | 707 |
| 709 web_request.SetReferrer( | 708 web_request.SetReferrer( |
| 710 request_->ReferrerString(), | 709 request_->ReferrerString(), |
| 711 static_cast<WebReferrerPolicy>(request_->GetReferrerPolicy())); | 710 static_cast<WebReferrerPolicy>(request_->GetReferrerPolicy())); |
| 712 // FIXME: How can we set isReload properly? What is the correct place to load | 711 // FIXME: How can we set isReload properly? What is the correct place to load |
| 713 // it in to the Request object? We should investigate the right way to plumb | 712 // it in to the Request object? We should investigate the right way to plumb |
| 714 // this information in to here. | 713 // this information in to here. |
| 715 } | 714 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 733 .Set(request.As<v8::Object>(), body_buffer); | 732 .Set(request.As<v8::Object>(), body_buffer); |
| 734 } | 733 } |
| 735 | 734 |
| 736 DEFINE_TRACE(Request) { | 735 DEFINE_TRACE(Request) { |
| 737 Body::Trace(visitor); | 736 Body::Trace(visitor); |
| 738 visitor->Trace(request_); | 737 visitor->Trace(request_); |
| 739 visitor->Trace(headers_); | 738 visitor->Trace(headers_); |
| 740 } | 739 } |
| 741 | 740 |
| 742 } // namespace blink | 741 } // namespace blink |
| OLD | NEW |