Chromium Code Reviews| 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, responseTypeHistogram, | 200 EnumerationHistogram, responseTypeHistogram, |
| 201 new EnumerationHistogram("ServiceWorkerCache.Cache.AddResponseType", | 201 new EnumerationHistogram("ServiceWorkerCache.Cache.AddResponseType", |
| 202 static_cast<int>(ResponseType::EnumMax))); | 202 static_cast<int>(ResponseType::EnumMax))); |
| 203 responseTypeHistogram.count(static_cast<int>(type)); | 203 responseTypeHistogram.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 (equalIgnoringCase(header.first, "vary")) { |
|
haraken
2017/03/31 00:06:28
Should we probably use equalIgnoringASCIICase inst
Raphael Kubo da Costa (rakuco)
2017/03/31 10:22:21
Sure. I've done that in patch v3.
This actually r
| |
| 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) { |
| 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 } |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 WTF::makeUnique<CacheWithRequestsCallbacks>(resolver), webRequest, | 698 WTF::makeUnique<CacheWithRequestsCallbacks>(resolver), webRequest, |
| 700 toWebQueryParams(options)); | 699 toWebQueryParams(options)); |
| 701 return promise; | 700 return promise; |
| 702 } | 701 } |
| 703 | 702 |
| 704 WebServiceWorkerCache* Cache::webCache() const { | 703 WebServiceWorkerCache* Cache::webCache() const { |
| 705 return m_webCache.get(); | 704 return m_webCache.get(); |
| 706 } | 705 } |
| 707 | 706 |
| 708 } // namespace blink | 707 } // namespace blink |
| OLD | NEW |