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

Unified Diff: net/spdy/spdy_session.cc

Issue 2678353003: Close idle H2 sockets when SpdySession is initialized. (Closed)
Patch Set: Address comments to hook directly to ClientSocketHandle Created 3 years, 10 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/socket/websocket_transport_client_socket_pool.cc ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 431022624477c12cdb079655abc77cb9b7723f39..0173abd32538e3be1a3209c7b7f3f031590eed39 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/feature_list.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
@@ -74,6 +75,10 @@ const uint32_t kDefaultInitialEnablePush = 1;
const uint32_t kDefaultInitialInitialWindowSize = 65535;
const uint32_t kDefaultInitialMaxFrameSize = 16384;
+// Experiment to close idle H2 sockets when SpdySession is initialized.
+const base::Feature kCloseIdleH2SocketsEarlyExperiment{
+ "CloseIdleH2SocketsEarly", base::FEATURE_DISABLED_BY_DEFAULT};
+
bool IsSpdySettingAtDefaultInitialValue(SpdySettingsIds setting_id,
uint32_t value) {
switch (setting_id) {
@@ -900,6 +905,12 @@ void SpdySession::InitializeWithSocket(
SendInitialData();
pool_ = pool;
+ if (base::FeatureList::IsEnabled(kCloseIdleH2SocketsEarlyExperiment)) {
+ // Close idle sockets in this group, since subsequent requests will go over
+ // this HTTP/2 connection.
+ connection_->CloseIdleSocketsInGroup();
+ }
+
// Bootstrap the read loop.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
« no previous file with comments | « net/socket/websocket_transport_client_socket_pool.cc ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698