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

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

Issue 999353005: Land Recent QUIC Changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wrap 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
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server.cc
diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc
index ef3ae4f96112a10b99126a5959efc1345d9f19ed..8bc0e81e38f15a4b77741c2d97a7eed8109b4f22 100644
--- a/net/tools/quic/quic_server.cc
+++ b/net/tools/quic/quic_server.cc
@@ -21,6 +21,8 @@
#include "net/quic/quic_data_reader.h"
#include "net/quic/quic_protocol.h"
#include "net/tools/quic/quic_dispatcher.h"
+#include "net/tools/quic/quic_epoll_clock.h"
+#include "net/tools/quic/quic_epoll_connection_helper.h"
#include "net/tools/quic/quic_in_memory_cache.h"
#include "net/tools/quic/quic_packet_reader.h"
#include "net/tools/quic/quic_socket_utils.h"
@@ -38,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";
@@ -93,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_);
@@ -185,7 +194,7 @@ QuicDispatcher* QuicServer::CreateQuicDispatcher() {
crypto_config_,
supported_versions_,
new QuicDispatcher::DefaultPacketWriterFactory(),
- &epoll_server_);
+ new QuicEpollConnectionHelper(&epoll_server_));
}
void QuicServer::WaitForEvents() {
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698