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_); |