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_in_memory_cache.h" | 5 #include "net/tools/quic/quic_in_memory_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 http_headers_->EnumerateHeader(&iter, x_push_url, push_url.get())) { | 62 http_headers_->EnumerateHeader(&iter, x_push_url, push_url.get())) { |
63 push_urls_.push_back(StringPiece(*push_url)); | 63 push_urls_.push_back(StringPiece(*push_url)); |
64 push_url_values_.push_back(std::move(push_url)); | 64 push_url_values_.push_back(std::move(push_url)); |
65 push_url.reset(new string()); | 65 push_url.reset(new string()); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 body_ = StringPiece(file_contents_.data() + headers_end, | 69 body_ = StringPiece(file_contents_.data() + headers_end, |
70 file_contents_.size() - headers_end); | 70 file_contents_.size() - headers_end); |
71 | 71 |
72 CreateSpdyHeadersFromHttpResponse(*http_headers_, HTTP2, &spdy_headers_); | 72 CreateSpdyHeadersFromHttpResponse(*http_headers_, &spdy_headers_); |
73 } | 73 } |
74 | 74 |
75 private: | 75 private: |
76 scoped_refptr<HttpResponseHeaders> http_headers_; | 76 scoped_refptr<HttpResponseHeaders> http_headers_; |
77 string url_; | 77 string url_; |
78 list<std::unique_ptr<string>> push_url_values_; | 78 list<std::unique_ptr<string>> push_url_values_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(ResourceFileImpl); | 80 DISALLOW_COPY_AND_ASSIGN(ResourceFileImpl); |
81 }; | 81 }; |
82 | 82 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 for (auto it = resource_range.first; it != resource_range.second; ++it) { | 344 for (auto it = resource_range.first; it != resource_range.second; ++it) { |
345 ServerPushInfo push_resource = it->second; | 345 ServerPushInfo push_resource = it->second; |
346 if (push_resource.request_url.spec() == resource.request_url.spec()) { | 346 if (push_resource.request_url.spec() == resource.request_url.spec()) { |
347 return true; | 347 return true; |
348 } | 348 } |
349 } | 349 } |
350 return false; | 350 return false; |
351 } | 351 } |
352 | 352 |
353 } // namespace net | 353 } // namespace net |
OLD | NEW |