OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/spdy/spdy_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 } | 215 } |
216 | 216 |
217 Value* SpdySessionPool::SpdySessionPoolInfoToValue() const { | 217 Value* SpdySessionPool::SpdySessionPoolInfoToValue() const { |
218 ListValue* list = new ListValue(); | 218 ListValue* list = new ListValue(); |
219 | 219 |
220 for (SpdySessionsMap::const_iterator it = sessions_.begin(); | 220 for (SpdySessionsMap::const_iterator it = sessions_.begin(); |
221 it != sessions_.end(); ++it) { | 221 it != sessions_.end(); ++it) { |
222 SpdySessionList* sessions = it->second; | 222 SpdySessionList* sessions = it->second; |
223 for (SpdySessionList::const_iterator session = sessions->begin(); | 223 for (SpdySessionList::const_iterator session = sessions->begin(); |
224 session != sessions->end(); ++session) { | 224 session != sessions->end(); ++session) { |
225 list->Append(session->get()->GetInfoAsValue()); | 225 // Only add the session if the key in the map matches the main |
226 // host_port_proxy_pair (not an alias). | |
227 HostPortProxyPair key = it->first; | |
eroman
2012/03/13 20:08:42
Please use |const HostPortProxyPair&| to avoid mak
Ryan Hamilton
2012/03/13 21:55:37
Done.
| |
228 HostPortProxyPair pair = session->get()->host_port_proxy_pair(); | |
eroman
2012/03/13 20:08:42
ditto to above.
Ryan Hamilton
2012/03/13 21:55:37
Done.
| |
229 if (key.first.Equals(pair.first) && key.second == pair.second) | |
230 list->Append(session->get()->GetInfoAsValue()); | |
226 } | 231 } |
227 } | 232 } |
228 return list; | 233 return list; |
229 } | 234 } |
230 | 235 |
231 void SpdySessionPool::OnIPAddressChanged() { | 236 void SpdySessionPool::OnIPAddressChanged() { |
232 CloseCurrentSessions(); | 237 CloseCurrentSessions(); |
233 http_server_properties_->ClearSpdySettings(); | 238 http_server_properties_->ClearSpdySettings(); |
234 } | 239 } |
235 | 240 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
449 const scoped_refptr<SpdySession>& session = *session_it; | 454 const scoped_refptr<SpdySession>& session = *session_it; |
450 CHECK(session); | 455 CHECK(session); |
451 if (!session->is_active()) { | 456 if (!session->is_active()) { |
452 session->CloseSessionOnError( | 457 session->CloseSessionOnError( |
453 net::ERR_ABORTED, true, "Closing idle sessions."); | 458 net::ERR_ABORTED, true, "Closing idle sessions."); |
454 } | 459 } |
455 } | 460 } |
456 } | 461 } |
457 | 462 |
458 } // namespace net | 463 } // namespace net |
OLD | NEW |