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

Unified Diff: net/spdy/spdy_session_pool.cc

Issue 129873010: Deprecate instead of close SPDY sessions upon network change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r249187) Created 6 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/spdy/spdy_session.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_pool.cc
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc
index 72beec465db4a1e2e110f2e34d98423375a10d0c..10bd52ff566a2c9506efbbe8a8ea674f21b114b8 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -278,7 +278,24 @@ base::Value* SpdySessionPool::SpdySessionPoolInfoToValue() const {
}
void SpdySessionPool::OnIPAddressChanged() {
- CloseCurrentSessions(ERR_NETWORK_CHANGED);
+ WeakSessionList current_sessions = GetCurrentSessions();
+ for (WeakSessionList::const_iterator it = current_sessions.begin();
+ it != current_sessions.end(); ++it) {
+ if (!*it)
+ continue;
+
+ // For OSs that terminate TCP connections upon relevant network changes
+ // there is no need to explicitly close SpdySessions, instead simply mark
+ // the sessions as deprecated so they aren't reused.
+#if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS)
+ (*it)->MakeUnavailable();
+#else
+ (*it)->CloseSessionOnError(ERR_NETWORK_CHANGED,
+ "Closing current sessions.");
+ DCHECK(!*it);
+#endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS)
+ DCHECK(!IsSessionAvailable(*it));
+ }
http_server_properties_->ClearAllSpdySettings();
}
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698