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

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

Issue 384873002: This CL changes the lifespan of SSLConnectJobMessengers so that they are created only when needed, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@useloop
Patch Set: Removed FormatSessionCacheKey function. Created 6 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
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if (transport_pool_) 377 if (transport_pool_)
378 max_pool_timeout = transport_pool_->ConnectionTimeout(); 378 max_pool_timeout = transport_pool_->ConnectionTimeout();
379 if (ssl_pool_) 379 if (ssl_pool_)
380 max_pool_timeout = std::max(max_pool_timeout, 380 max_pool_timeout = std::max(max_pool_timeout,
381 ssl_pool_->ConnectionTimeout()); 381 ssl_pool_->ConnectionTimeout());
382 #endif 382 #endif
383 timeout_ = max_pool_timeout + 383 timeout_ = max_pool_timeout +
384 base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds); 384 base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds);
385 } 385 }
386 386
387
388 scoped_ptr<ConnectJob> 387 scoped_ptr<ConnectJob>
389 HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob( 388 HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob(
390 const std::string& group_name, 389 const std::string& group_name,
391 const PoolBase::Request& request, 390 const PoolBase::Request& request,
392 ConnectJob::Delegate* delegate) const { 391 ConnectJob::Delegate* delegate) {
393 return scoped_ptr<ConnectJob>(new HttpProxyConnectJob(group_name, 392 return scoped_ptr<ConnectJob>(new HttpProxyConnectJob(group_name,
394 request.priority(), 393 request.priority(),
395 request.params(), 394 request.params(),
396 ConnectionTimeout(), 395 ConnectionTimeout(),
397 transport_pool_, 396 transport_pool_,
398 ssl_pool_, 397 ssl_pool_,
399 host_resolver_, 398 host_resolver_,
400 delegate, 399 delegate,
401 net_log_)); 400 net_log_));
402 } 401 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 base_.RemoveHigherLayeredPool(higher_pool); 533 base_.RemoveHigherLayeredPool(higher_pool);
535 } 534 }
536 535
537 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { 536 bool HttpProxyClientSocketPool::CloseOneIdleConnection() {
538 if (base_.CloseOneIdleSocket()) 537 if (base_.CloseOneIdleSocket())
539 return true; 538 return true;
540 return base_.CloseOneIdleConnectionInHigherLayeredPool(); 539 return base_.CloseOneIdleConnectionInHigherLayeredPool();
541 } 540 }
542 541
543 } // namespace net 542 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698