Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/tools/quic/quic_http_response_cache.h" | 5 #include "net/tools/quic/quic_http_response_cache.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 } | 331 } |
| 332 | 332 |
| 333 string QuicHttpResponseCache::GetKey(StringPiece host, StringPiece path) const { | 333 string QuicHttpResponseCache::GetKey(StringPiece host, StringPiece path) const { |
| 334 return host.as_string() + path.as_string(); | 334 return host.as_string() + path.as_string(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void QuicHttpResponseCache::MaybeAddServerPushResources( | 337 void QuicHttpResponseCache::MaybeAddServerPushResources( |
| 338 StringPiece request_host, | 338 StringPiece request_host, |
| 339 StringPiece request_path, | 339 StringPiece request_path, |
| 340 std::list<ServerPushInfo> push_resources) { | 340 std::list<ServerPushInfo> push_resources) { |
| 341 string request_url = GetKey(request_host, request_path); | 341 string request_url = QuicStrCat(request_host, request_path); |
|
Ryan Hamilton
2016/12/22 18:17:30
I think we should use GetKey here (and in the inte
| |
| 342 | 342 |
| 343 for (const auto& push_resource : push_resources) { | 343 for (const auto& push_resource : push_resources) { |
| 344 if (PushResourceExistsInCache(request_url, push_resource)) { | 344 if (PushResourceExistsInCache(request_url, push_resource)) { |
| 345 continue; | 345 continue; |
| 346 } | 346 } |
| 347 | 347 |
| 348 DVLOG(1) << "Add request-resource association: request url " << request_url | 348 DVLOG(1) << "Add request-resource association: request url " << request_url |
| 349 << " push url " << push_resource.request_url | 349 << " push url " << push_resource.request_url |
| 350 << " response headers " << push_resource.headers.DebugString(); | 350 << " response headers " << push_resource.headers.DebugString(); |
| 351 { | 351 { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 382 for (auto it = resource_range.first; it != resource_range.second; ++it) { | 382 for (auto it = resource_range.first; it != resource_range.second; ++it) { |
| 383 ServerPushInfo push_resource = it->second; | 383 ServerPushInfo push_resource = it->second; |
| 384 if (push_resource.request_url.spec() == resource.request_url.spec()) { | 384 if (push_resource.request_url.spec() == resource.request_url.spec()) { |
| 385 return true; | 385 return true; |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 return false; | 388 return false; |
| 389 } | 389 } |
| 390 | 390 |
| 391 } // namespace net | 391 } // namespace net |
| OLD | NEW |