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

Side by Side Diff: net/tools/quic/quic_in_memory_cache.cc

Issue 1541263002: Landing Recent QUIC changes until 12/18/2015 13:57 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace -1 with 0xff for InvalidPathId Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_packet_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 STLDeleteValues(&responses_); 195 STLDeleteValues(&responses_);
196 } 196 }
197 197
198 void QuicInMemoryCache::AddResponseImpl( 198 void QuicInMemoryCache::AddResponseImpl(
199 StringPiece host, 199 StringPiece host,
200 StringPiece path, 200 StringPiece path,
201 SpecialResponseType response_type, 201 SpecialResponseType response_type,
202 const SpdyHeaderBlock& response_headers, 202 const SpdyHeaderBlock& response_headers,
203 StringPiece response_body, 203 StringPiece response_body,
204 const SpdyHeaderBlock& response_trailers) { 204 const SpdyHeaderBlock& response_trailers) {
205 DCHECK(!host.empty()) << "Host must be populated, e.g. \"www.google.com\"";
205 string key = GetKey(host, path); 206 string key = GetKey(host, path);
206 if (ContainsKey(responses_, key)) { 207 if (ContainsKey(responses_, key)) {
207 LOG(DFATAL) << "Response for '" << key << "' already exists!"; 208 LOG(DFATAL) << "Response for '" << key << "' already exists!";
208 return; 209 return;
209 } 210 }
210 Response* new_response = new Response(); 211 Response* new_response = new Response();
211 new_response->set_response_type(response_type); 212 new_response->set_response_type(response_type);
212 new_response->set_headers(response_headers); 213 new_response->set_headers(response_headers);
213 new_response->set_body(response_body); 214 new_response->set_body(response_body);
214 new_response->set_trailers(response_trailers); 215 new_response->set_trailers(response_trailers);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 ServerPushInfo push_resource = it->second; 252 ServerPushInfo push_resource = it->second;
252 if (push_resource.request_url.spec() == resource.request_url.spec()) { 253 if (push_resource.request_url.spec() == resource.request_url.spec()) {
253 return true; 254 return true;
254 } 255 }
255 } 256 }
256 return false; 257 return false;
257 } 258 }
258 259
259 } // namespace tools 260 } // namespace tools
260 } // namespace net 261 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_packet_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698