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

Unified Diff: net/http/http_network_session.cc

Issue 2600973002: Implement HTTP/2 settings field trial parameters. (Closed)
Patch Set: 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
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..d1a87daeec448e8bea0ffc309f06bb4aa17617e4 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -93,7 +93,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 +196,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)),
@@ -459,4 +458,24 @@ void HttpNetworkSession::OnMemoryStateChange(base::MemoryState state) {
}
}
+SettingsMap HttpNetworkSession::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;
+}
Ryan Hamilton 2016/12/27 22:32:43 nit: I think this method can be a free function in
Bence 2016/12/28 00:53:24 Done.
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698