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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 const SpdySessionKey& SpdySessionPool::NormalizeListKey( | 316 const SpdySessionKey& SpdySessionPool::NormalizeListKey( |
317 const SpdySessionKey& key) const { | 317 const SpdySessionKey& key) const { |
318 if (!force_single_domain_) | 318 if (!force_single_domain_) |
319 return key; | 319 return key; |
320 | 320 |
321 static SpdySessionKey* single_domain_key = NULL; | 321 static SpdySessionKey* single_domain_key = NULL; |
322 if (!single_domain_key) { | 322 if (!single_domain_key) { |
323 HostPortPair single_domain = HostPortPair("singledomain.com", 80); | 323 HostPortPair single_domain = HostPortPair("singledomain.com", 80); |
324 single_domain_key = new SpdySessionKey(single_domain, | 324 single_domain_key = new SpdySessionKey(single_domain, |
325 ProxyServer::Direct(), | 325 ProxyServer::Direct(), |
326 kPrivacyModeDisabled); | 326 PRIVACY_MODE_DISABLED); |
327 } | 327 } |
328 return *single_domain_key; | 328 return *single_domain_key; |
329 } | 329 } |
330 | 330 |
331 void SpdySessionPool::MapKeyToAvailableSession( | 331 void SpdySessionPool::MapKeyToAvailableSession( |
332 const SpdySessionKey& key, | 332 const SpdySessionKey& key, |
333 const base::WeakPtr<SpdySession>& session) { | 333 const base::WeakPtr<SpdySession>& session) { |
334 DCHECK(ContainsKey(sessions_, session.get())); | 334 DCHECK(ContainsKey(sessions_, session.get())); |
335 const SpdySessionKey& normalized_key = NormalizeListKey(key); | 335 const SpdySessionKey& normalized_key = NormalizeListKey(key); |
336 std::pair<AvailableSessionMap::iterator, bool> result = | 336 std::pair<AvailableSessionMap::iterator, bool> result = |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 if (idle_only && (*it)->is_active()) | 387 if (idle_only && (*it)->is_active()) |
388 continue; | 388 continue; |
389 | 389 |
390 (*it)->CloseSessionOnError(error, description); | 390 (*it)->CloseSessionOnError(error, description); |
391 DCHECK(!IsSessionAvailable(*it)); | 391 DCHECK(!IsSessionAvailable(*it)); |
392 DCHECK(!*it); | 392 DCHECK(!*it); |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
396 } // namespace net | 396 } // namespace net |
OLD | NEW |