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

Unified Diff: third_party/WebKit/Source/modules/fetch/FetchResponseData.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
index bc6c3d76022fbd2f789fa3d382b13eaa6a4f534e..cf308c3e30369696f814870e379ac651159b7a99 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
@@ -82,11 +82,10 @@ FetchResponseData* FetchResponseData::CreateBasicFilteredResponse() const {
FetchResponseData* response =
new FetchResponseData(kBasicType, status_, status_message_);
response->SetURLList(url_list_);
- for (size_t i = 0; i < header_list_->size(); ++i) {
- const FetchHeaderList::Header* header = header_list_->List()[i].get();
- if (FetchUtils::IsForbiddenResponseHeaderName(header->first))
+ for (const auto& header : header_list_->List()) {
+ if (FetchUtils::IsForbiddenResponseHeaderName(header.first))
continue;
- response->header_list_->Append(header->first, header->second);
+ response->header_list_->Append(header.first, header.second);
}
response->buffer_ = buffer_;
response->mime_type_ = mime_type_;
@@ -118,16 +117,15 @@ FetchResponseData* FetchResponseData::CreateCORSFilteredResponse(
FetchResponseData* response =
new FetchResponseData(kCORSType, status_, status_message_);
response->SetURLList(url_list_);
- for (size_t i = 0; i < header_list_->size(); ++i) {
- const FetchHeaderList::Header* header = header_list_->List()[i].get();
- const String& name = header->first;
+ for (const auto& header : header_list_->List()) {
+ const String& name = header.first;
const bool explicitly_exposed = exposed_headers.Contains(name);
if (IsOnAccessControlResponseHeaderWhitelist(name) ||
(explicitly_exposed &&
!FetchUtils::IsForbiddenResponseHeaderName(name))) {
if (explicitly_exposed)
response->cors_exposed_header_names_.insert(name);
- response->header_list_->Append(name, header->second);
+ response->header_list_->Append(name, header.second);
}
}
response->buffer_ = buffer_;
@@ -272,9 +270,8 @@ void FetchResponseData::PopulateWebServiceWorkerResponse(
response.SetCacheStorageCacheName(CacheStorageCacheName());
response.SetCorsExposedHeaderNames(
HeaderSetToWebVector(cors_exposed_header_names_));
- for (size_t i = 0; i < HeaderList()->size(); ++i) {
- const FetchHeaderList::Header* header = HeaderList()->List()[i].get();
- response.AppendHeader(header->first, header->second);
+ for (const auto& header : HeaderList()->List()) {
+ response.AppendHeader(header.first, header.second);
}
}

Powered by Google App Engine
This is Rietveld 408576698