Chromium Code Reviews| 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..b34bb96c24f7ee1ecc14bb4f901c2c164b7cbc2e 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)->Deprecate(); |
| +#else |
| + (*it)->CloseSessionOnError(ERR_NETWORK_CHANGED, |
| + "Closing current sessions."); |
| + DCHECK(!*it); |
| +#endif // defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_IOS) |
| + DCHECK(!IsSessionAvailable(*it)); |
|
akalin
2014/01/27 22:20:03
this should probably go in the #if block, since fr
pauljensen
2014/01/28 19:34:45
That was my thought too, but I wanted to keep in l
akalin
2014/01/28 23:23:27
Nevermind I misread the code -- I thought it was a
|
| + } |
| http_server_properties_->ClearAllSpdySettings(); |
| } |