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

Side by Side Diff: net/http/http_proxy_client_socket_pool.cc

Issue 18546008: [SPDY] Use WeakPtr<SpdySession> everywhere but SpdySessionPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test, other minor formatting/comment changes Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_factory_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/http/http_proxy_client_socket_pool.h" 5 #include "net/http/http_proxy_client_socket_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return result; 295 return result;
296 } 296 }
297 297
298 int HttpProxyConnectJob::DoSpdyProxyCreateStream() { 298 int HttpProxyConnectJob::DoSpdyProxyCreateStream() {
299 DCHECK(using_spdy_); 299 DCHECK(using_spdy_);
300 DCHECK(params_->tunnel()); 300 DCHECK(params_->tunnel());
301 SpdySessionKey key(params_->destination().host_port_pair(), 301 SpdySessionKey key(params_->destination().host_port_pair(),
302 ProxyServer::Direct(), 302 ProxyServer::Direct(),
303 kPrivacyModeDisabled); 303 kPrivacyModeDisabled);
304 SpdySessionPool* spdy_pool = params_->spdy_session_pool(); 304 SpdySessionPool* spdy_pool = params_->spdy_session_pool();
305 scoped_refptr<SpdySession> spdy_session = 305 base::WeakPtr<SpdySession> spdy_session =
306 spdy_pool->FindAvailableSession(key, net_log()); 306 spdy_pool->FindAvailableSession(key, net_log());
307 // It's possible that a session to the proxy has recently been created 307 // It's possible that a session to the proxy has recently been created
308 if (spdy_session) { 308 if (spdy_session) {
309 if (transport_socket_handle_.get()) { 309 if (transport_socket_handle_.get()) {
310 if (transport_socket_handle_->socket()) 310 if (transport_socket_handle_->socket())
311 transport_socket_handle_->socket()->Disconnect(); 311 transport_socket_handle_->socket()->Disconnect();
312 transport_socket_handle_->Reset(); 312 transport_socket_handle_->Reset();
313 } 313 }
314 } else { 314 } else {
315 // Create a session direct to the proxy itself 315 // Create a session direct to the proxy itself
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 return base_.histograms(); 532 return base_.histograms();
533 } 533 }
534 534
535 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { 535 bool HttpProxyClientSocketPool::CloseOneIdleConnection() {
536 if (base_.CloseOneIdleSocket()) 536 if (base_.CloseOneIdleSocket())
537 return true; 537 return true;
538 return base_.CloseOneIdleConnectionInLayeredPool(); 538 return base_.CloseOneIdleConnectionInLayeredPool();
539 } 539 }
540 540
541 } // namespace net 541 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698