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

Unified Diff: net/http/http_network_session.cc

Issue 2600973002: Implement HTTP/2 settings field trial parameters. (Closed)
Patch Set: Re: #7. Created 4 years 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/http/http_network_session.h ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_session.cc
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 3b2ca28d9fe3fb33557f429cd546c39354303c1d..f40831745a33a90c7f50f776b5fbec2a4a560cde 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -72,6 +72,32 @@ const int32_t kSpdyStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
// and does not consume "too much" memory.
const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB
+namespace {
+
+// Keep all HTTP2 parameters in |http2_settings|, even the ones that are not
+// implemented, to be sent to the server.
+// Set default values for settings that |http2_settings| does not specify.
+SettingsMap AddDefaultHttp2Settings(SettingsMap http2_settings) {
+ // Set default values only if |http2_settings| does not have
+ // a value set for given setting.
+ SettingsMap::iterator it = http2_settings.find(SETTINGS_HEADER_TABLE_SIZE);
+ if (it == http2_settings.end())
+ http2_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize;
+
+ it = http2_settings.find(SETTINGS_MAX_CONCURRENT_STREAMS);
+ if (it == http2_settings.end())
+ http2_settings[SETTINGS_MAX_CONCURRENT_STREAMS] =
+ kSpdyMaxConcurrentPushedStreams;
+
+ it = http2_settings.find(SETTINGS_INITIAL_WINDOW_SIZE);
+ if (it == http2_settings.end())
+ http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = kSpdyStreamMaxRecvWindowSize;
+
+ return http2_settings;
+}
+
+} // unnamed namespace
+
HttpNetworkSession::Params::Params()
: client_socket_factory(NULL),
host_resolver(NULL),
@@ -93,7 +119,6 @@ HttpNetworkSession::Params::Params()
enable_spdy_ping_based_connection_checking(true),
enable_http2(true),
spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize),
- spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize),
time_func(&base::TimeTicks::Now),
enable_http2_alternative_service_with_different_host(false),
enable_quic_alternative_service_with_different_host(true),
@@ -197,7 +222,7 @@ HttpNetworkSession::HttpNetworkSession(const Params& params)
params.transport_security_state,
params.enable_spdy_ping_based_connection_checking,
params.spdy_session_max_recv_window_size,
- params.spdy_stream_max_recv_window_size,
+ AddDefaultHttp2Settings(params.http2_settings),
params.time_func,
params.proxy_delegate),
http_stream_factory_(new HttpStreamFactoryImpl(this, false)),
« no previous file with comments | « net/http/http_network_session.h ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698