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

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

Issue 2518063007: Pass QuicInMemoryCache directly instead of using a singleton. (Closed)
Patch Set: Fix Cronet compile error Created 4 years, 1 month 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 | « net/tools/quic/quic_simple_server_stream.h ('k') | 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_simple_server_stream.cc
diff --git a/net/tools/quic/quic_simple_server_stream.cc b/net/tools/quic/quic_simple_server_stream.cc
index 9aa2786616bb8f939394dfe39a39f4eee8a6fb64..ccfd683561efdfb55c56c989e93507439d07ff37 100644
--- a/net/tools/quic/quic_simple_server_stream.cc
+++ b/net/tools/quic/quic_simple_server_stream.cc
@@ -26,9 +26,13 @@ using std::string;
namespace net {
-QuicSimpleServerStream::QuicSimpleServerStream(QuicStreamId id,
- QuicSpdySession* session)
- : QuicSpdyStream(id, session), content_length_(-1) {}
+QuicSimpleServerStream::QuicSimpleServerStream(
+ QuicStreamId id,
+ QuicSpdySession* session,
+ QuicInMemoryCache* in_memory_cache)
+ : QuicSpdyStream(id, session),
+ content_length_(-1),
+ in_memory_cache_(in_memory_cache) {}
QuicSimpleServerStream::~QuicSimpleServerStream() {}
@@ -130,8 +134,7 @@ void QuicSimpleServerStream::SendResponse() {
auto authority = request_headers_.find(":authority");
auto path = request_headers_.find(":path");
if (authority != request_headers_.end() && path != request_headers_.end()) {
- response = QuicInMemoryCache::GetInstance()->GetResponse(authority->second,
- path->second);
+ response = in_memory_cache_->GetResponse(authority->second, path->second);
}
if (response == nullptr) {
DVLOG(1) << "Response not found in cache.";
@@ -182,7 +185,7 @@ void QuicSimpleServerStream::SendResponse() {
}
}
std::list<QuicInMemoryCache::ServerPushInfo> resources =
- QuicInMemoryCache::GetInstance()->GetServerPushResources(request_url);
+ in_memory_cache_->GetServerPushResources(request_url);
DVLOG(1) << "Found " << resources.size() << " push resources for stream "
<< id();
« no previous file with comments | « net/tools/quic/quic_simple_server_stream.h ('k') | net/tools/quic/quic_simple_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698