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

Unified Diff: net/tools/quic/quic_in_memory_cache.cc

Issue 1544563002: Adds a DCHECK that the host argument to QuicInMemoryCache::AddResponse is not empty. An empty host … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110267778
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/tools/quic/quic_simple_server_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_in_memory_cache.cc
diff --git a/net/tools/quic/quic_in_memory_cache.cc b/net/tools/quic/quic_in_memory_cache.cc
index fd77050b49e91ccb6f6c680e4cef27e71a287a27..21efe0a709cc900b8d48da586685dc691803e35a 100644
--- a/net/tools/quic/quic_in_memory_cache.cc
+++ b/net/tools/quic/quic_in_memory_cache.cc
@@ -204,6 +204,7 @@ void QuicInMemoryCache::AddResponseImpl(
const SpdyHeaderBlock& response_headers,
StringPiece response_body,
const SpdyHeaderBlock& response_trailers) {
+ DCHECK(!host.empty()) << "Host must be populated, e.g. \"www.google.com\"";
string key = GetKey(host, path);
if (ContainsKey(responses_, key)) {
LOG(DFATAL) << "Response for '" << key << "' already exists!";
« no previous file with comments | « no previous file | net/tools/quic/quic_simple_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698