 Chromium Code Reviews
 Chromium Code Reviews Issue 2787003002:
  Fetch API: Stop lowercasing header names.  (Closed)
    
  
    Issue 2787003002:
  Fetch API: Stop lowercasing header names.  (Closed) 
  | 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/cachestorage/Cache.h" | 5 #include "modules/cachestorage/Cache.h" | 
| 6 | 6 | 
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" | 
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" | 
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 } | 198 } | 
| 199 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 199 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 
| 200 EnumerationHistogram, response_type_histogram, | 200 EnumerationHistogram, response_type_histogram, | 
| 201 new EnumerationHistogram("ServiceWorkerCache.Cache.AddResponseType", | 201 new EnumerationHistogram("ServiceWorkerCache.Cache.AddResponseType", | 
| 202 static_cast<int>(ResponseType::kEnumMax))); | 202 static_cast<int>(ResponseType::kEnumMax))); | 
| 203 response_type_histogram.Count(static_cast<int>(type)); | 203 response_type_histogram.Count(static_cast<int>(type)); | 
| 204 }; | 204 }; | 
| 205 | 205 | 
| 206 bool VaryHeaderContainsAsterisk(const Response* response) { | 206 bool VaryHeaderContainsAsterisk(const Response* response) { | 
| 207 const FetchHeaderList* headers = response->headers()->HeaderList(); | 207 const FetchHeaderList* headers = response->headers()->HeaderList(); | 
| 208 for (size_t i = 0; i < headers->size(); ++i) { | 208 for (const auto& header : headers->List()) { | 
| 209 const FetchHeaderList::Header& header = headers->Entry(i); | 209 if (EqualIgnoringASCIICase(header.first, "vary")) { | 
| 210 if (header.first == "vary") { | |
| 211 Vector<String> fields; | 210 Vector<String> fields; | 
| 212 header.second.Split(',', fields); | 211 header.second.Split(',', fields); | 
| 213 for (size_t j = 0; j < fields.size(); ++j) { | 212 for (size_t j = 0; j < fields.size(); ++j) { | 
| 
nhiroki
2017/04/12 06:53:05
Can you replace this with range-based-for?
 | |
| 214 if (fields[j].StripWhiteSpace() == "*") | 213 if (fields[j].StripWhiteSpace() == "*") | 
| 215 return true; | 214 return true; | 
| 216 } | 215 } | 
| 217 } | 216 } | 
| 218 } | 217 } | 
| 219 return false; | 218 return false; | 
| 220 } | 219 } | 
| 221 | 220 | 
| 222 } // namespace | 221 } // namespace | 
| 223 | 222 | 
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 701 WTF::MakeUnique<CacheWithRequestsCallbacks>(resolver), web_request, | 700 WTF::MakeUnique<CacheWithRequestsCallbacks>(resolver), web_request, | 
| 702 ToWebQueryParams(options)); | 701 ToWebQueryParams(options)); | 
| 703 return promise; | 702 return promise; | 
| 704 } | 703 } | 
| 705 | 704 | 
| 706 WebServiceWorkerCache* Cache::WebCache() const { | 705 WebServiceWorkerCache* Cache::WebCache() const { | 
| 707 return web_cache_.get(); | 706 return web_cache_.get(); | 
| 708 } | 707 } | 
| 709 | 708 | 
| 710 } // namespace blink | 709 } // namespace blink | 
| OLD | NEW |