Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Request.cpp

Issue 2787003002: Fetch API: Stop lowercasing header names. (Closed)
Patch Set: Rebase after The Big Blink Rename Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 web_request.SetRequestContext(request_->Context()); 697 web_request.SetRequestContext(request_->Context());
698 698
699 // Strip off the fragment part of URL. So far, all users of 699 // Strip off the fragment part of URL. So far, all users of
700 // WebServiceWorkerRequest expect the fragment to be excluded. 700 // WebServiceWorkerRequest expect the fragment to be excluded.
701 KURL url(request_->Url()); 701 KURL url(request_->Url());
702 if (request_->Url().HasFragmentIdentifier()) 702 if (request_->Url().HasFragmentIdentifier())
703 url.RemoveFragmentIdentifier(); 703 url.RemoveFragmentIdentifier();
704 web_request.SetURL(url); 704 web_request.SetURL(url);
705 705
706 const FetchHeaderList* header_list = headers_->HeaderList(); 706 const FetchHeaderList* header_list = headers_->HeaderList();
707 for (size_t i = 0, size = header_list->size(); i < size; ++i) { 707 for (const auto& header : header_list->List()) {
708 const FetchHeaderList::Header& header = header_list->Entry(i);
709 web_request.AppendHeader(header.first, header.second); 708 web_request.AppendHeader(header.first, header.second);
710 } 709 }
711 710
712 web_request.SetReferrer( 711 web_request.SetReferrer(
713 request_->ReferrerString(), 712 request_->ReferrerString(),
714 static_cast<WebReferrerPolicy>(request_->GetReferrerPolicy())); 713 static_cast<WebReferrerPolicy>(request_->GetReferrerPolicy()));
715 // FIXME: How can we set isReload properly? What is the correct place to load 714 // FIXME: How can we set isReload properly? What is the correct place to load
716 // it in to the Request object? We should investigate the right way to plumb 715 // it in to the Request object? We should investigate the right way to plumb
717 // this information in to here. 716 // this information in to here.
718 } 717 }
(...skipping 17 matching lines...) Expand all
736 .Set(request.As<v8::Object>(), body_buffer); 735 .Set(request.As<v8::Object>(), body_buffer);
737 } 736 }
738 737
739 DEFINE_TRACE(Request) { 738 DEFINE_TRACE(Request) {
740 Body::Trace(visitor); 739 Body::Trace(visitor);
741 visitor->Trace(request_); 740 visitor->Trace(request_);
742 visitor->Trace(headers_); 741 visitor->Trace(headers_);
743 } 742 }
744 743
745 } // namespace blink 744 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698