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

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

Issue 1037533002: Make initialization of the QuicInMemoryCache explicit to avoid spooky action at a distance which co… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: net/tools/quic/quic_server.cc
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index 371c92b4995032ee184f57d2fff56abc6156f9ff..8bc0e81e38f15a4b77741c2d97a7eed8109b4f22 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -40,9 +40,13 @@
namespace net {
namespace tools {
-
namespace {
+// Specifies the directory used during QuicInMemoryCache
+// construction to seed the cache. Cache directory can be
+// generated using `wget -p --save-headers <url>`
+std::string FLAGS_quic_in_memory_cache_dir = "";
+
const PollBits kEpollFlags = PollBits(NET_POLLIN | NET_POLLOUT | NET_POLLET);
const char kSourceAddressTokenSecret[] = "secret";
@@ -95,8 +99,11 @@ void QuicServer::Initialize() {
}
epoll_server_.set_timeout_in_us(50 * 1000);
- // Initialize the in memory cache now.
- QuicInMemoryCache::GetInstance();
+
+ if (!FLAGS_quic_in_memory_cache_dir.empty()) {
+ QuicInMemoryCache::GetInstance()->InitializeFromDirectory(
+ FLAGS_quic_in_memory_cache_dir);
+ }
QuicEpollClock clock(&epoll_server_);

Powered by Google App Engine
This is Rietveld 408576698