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/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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 RequestPriority priority, | 80 RequestPriority priority, |
81 const scoped_refptr<HttpProxySocketParams>& params, | 81 const scoped_refptr<HttpProxySocketParams>& params, |
82 const base::TimeDelta& timeout_duration, | 82 const base::TimeDelta& timeout_duration, |
83 TransportClientSocketPool* transport_pool, | 83 TransportClientSocketPool* transport_pool, |
84 SSLClientSocketPool* ssl_pool, | 84 SSLClientSocketPool* ssl_pool, |
85 HostResolver* host_resolver, | 85 HostResolver* host_resolver, |
86 Delegate* delegate, | 86 Delegate* delegate, |
87 NetLog* net_log) | 87 NetLog* net_log) |
88 : ConnectJob(group_name, timeout_duration, priority, delegate, | 88 : ConnectJob(group_name, timeout_duration, priority, delegate, |
89 BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)), | 89 BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)), |
90 weak_ptr_factory_(this), | |
91 params_(params), | 90 params_(params), |
92 transport_pool_(transport_pool), | 91 transport_pool_(transport_pool), |
93 ssl_pool_(ssl_pool), | 92 ssl_pool_(ssl_pool), |
94 resolver_(host_resolver), | 93 resolver_(host_resolver), |
95 callback_(base::Bind(&HttpProxyConnectJob::OnIOComplete, | |
96 weak_ptr_factory_.GetWeakPtr())), | |
97 using_spdy_(false), | 94 using_spdy_(false), |
98 protocol_negotiated_(kProtoUnknown) { | 95 protocol_negotiated_(kProtoUnknown), |
| 96 weak_ptr_factory_(this) { |
| 97 callback_= base::Bind(&HttpProxyConnectJob::OnIOComplete, |
| 98 weak_ptr_factory_.GetWeakPtr()); |
99 } | 99 } |
100 | 100 |
101 HttpProxyConnectJob::~HttpProxyConnectJob() {} | 101 HttpProxyConnectJob::~HttpProxyConnectJob() {} |
102 | 102 |
103 LoadState HttpProxyConnectJob::GetLoadState() const { | 103 LoadState HttpProxyConnectJob::GetLoadState() const { |
104 switch (next_state_) { | 104 switch (next_state_) { |
105 case STATE_TCP_CONNECT: | 105 case STATE_TCP_CONNECT: |
106 case STATE_TCP_CONNECT_COMPLETE: | 106 case STATE_TCP_CONNECT_COMPLETE: |
107 case STATE_SSL_CONNECT: | 107 case STATE_SSL_CONNECT: |
108 case STATE_SSL_CONNECT_COMPLETE: | 108 case STATE_SSL_CONNECT_COMPLETE: |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 base_.RemoveHigherLayeredPool(higher_pool); | 541 base_.RemoveHigherLayeredPool(higher_pool); |
542 } | 542 } |
543 | 543 |
544 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 544 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
545 if (base_.CloseOneIdleSocket()) | 545 if (base_.CloseOneIdleSocket()) |
546 return true; | 546 return true; |
547 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 547 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
548 } | 548 } |
549 | 549 |
550 } // namespace net | 550 } // namespace net |
OLD | NEW |