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, |