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

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

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix invalid memory access + blocked writers Created 6 years, 6 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
« net/quic/quic_server_test.cc ('K') | « net/quic/quic_server_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server_bin.cc
diff --git a/net/tools/quic/quic_server_bin.cc b/net/tools/quic/quic_server_bin.cc
index 2d349ac4792112764edcafb1c17976d6485f8d0b..8d5f7b324c5fdd1ab5182ca3d4af243665d2ab1f 100644
--- a/net/tools/quic/quic_server_bin.cc
+++ b/net/tools/quic/quic_server_bin.cc
@@ -11,13 +11,15 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "net/base/ip_endpoint.h"
-#include "net/tools/quic/quic_in_memory_cache.h"
-#include "net/tools/quic/quic_server.h"
+#include "net/quic/quic_in_memory_cache.h"
+#include "net/quic/quic_server.h"
-// The port the quic server will listen on.
+const uint32 kServerInitialFlowControlWindow = 100 * net::kMaxPacketSize;
wtc 2014/06/18 02:04:47 This is a very non-obvious constant. Can we get th
dmziegler 2014/06/18 20:13:42 It used to live in quic_server.cc with no explanat
+// The port the quic server will listen on.
int32 FLAGS_port = 6121;
int main(int argc, char *argv[]) {
@@ -42,8 +44,8 @@ int main(int argc, char *argv[]) {
}
if (line->HasSwitch("quic_in_memory_cache_dir")) {
- net::tools::FLAGS_quic_in_memory_cache_dir =
- line->GetSwitchValueASCII("quic_in_memory_cache_dir");
+ net::g_quic_in_memory_cache_dir = base::FilePath::FromUTF8Unsafe(
wtc 2014/06/18 02:04:47 It may be better to provide a setter function. See
dmziegler 2014/06/18 20:13:42 Do you want me to make this better now, or should
+ line->GetSwitchValueASCII("quic_in_memory_cache_dir"));
}
if (line->HasSwitch("port")) {
@@ -55,18 +57,28 @@ int main(int argc, char *argv[]) {
base::AtExitManager exit_manager;
+ base::MessageLoopForIO messageLoop;
wtc 2014/06/18 02:04:47 This variable should be named "message_loop". But
dmziegler 2014/06/18 20:13:42 Yes, it initializes the message loop on the thread
+
net::IPAddressNumber ip;
CHECK(net::ParseIPLiteralToNumber("::", &ip));
- net::tools::QuicServer server;
+ net::QuicConfig config;
+ config.SetDefaults();
+
+ net::QuicVersionVector versions;
+ versions.push_back(net::QUIC_VERSION_19);
+ versions.push_back(net::QUIC_VERSION_18);
+ versions.push_back(net::QUIC_VERSION_17);
+ versions.push_back(net::QUIC_VERSION_16);
+ versions.push_back(net::QUIC_VERSION_15);
wtc 2014/06/18 02:04:48 There should be a function that returns all the su
dmziegler 2014/06/18 20:13:42 Yes, replaced.
+
+ net::QuicServer server(config, versions, kServerInitialFlowControlWindow);
if (!server.Listen(net::IPEndPoint(ip, FLAGS_port))) {
return 1;
}
- while (1) {
- server.WaitForEvents();
- }
+ base::RunLoop().Run();
return 0;
}
« net/quic/quic_server_test.cc ('K') | « net/quic/quic_server_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698