| 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/socket/client_socket_pool_base.h" | 5 #include "net/socket/client_socket_pool_base.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 DatagramSocket::BindType bind_type, | 208 DatagramSocket::BindType bind_type, |
| 209 const RandIntCallback& rand_int_cb, | 209 const RandIntCallback& rand_int_cb, |
| 210 NetLog* net_log, | 210 NetLog* net_log, |
| 211 const NetLog::Source& source) override { | 211 const NetLog::Source& source) override { |
| 212 NOTREACHED(); | 212 NOTREACHED(); |
| 213 return scoped_ptr<DatagramClientSocket>(); | 213 return scoped_ptr<DatagramClientSocket>(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 scoped_ptr<StreamSocket> CreateTransportClientSocket( | 216 scoped_ptr<StreamSocket> CreateTransportClientSocket( |
| 217 const AddressList& addresses, | 217 const AddressList& addresses, |
| 218 SocketPerformanceWatcherFactory* /* socket_performance_watcher_factory */, |
| 218 NetLog* /* net_log */, | 219 NetLog* /* net_log */, |
| 219 const NetLog::Source& /*source*/) override { | 220 const NetLog::Source& /*source*/) override { |
| 220 allocation_count_++; | 221 allocation_count_++; |
| 221 return scoped_ptr<StreamSocket>(); | 222 return scoped_ptr<StreamSocket>(); |
| 222 } | 223 } |
| 223 | 224 |
| 224 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 225 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
| 225 scoped_ptr<ClientSocketHandle> transport_socket, | 226 scoped_ptr<ClientSocketHandle> transport_socket, |
| 226 const HostPortPair& host_and_port, | 227 const HostPortPair& host_and_port, |
| 227 const SSLConfig& ssl_config, | 228 const SSLConfig& ssl_config, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 info.headers = new HttpResponseHeaders(std::string()); | 304 info.headers = new HttpResponseHeaders(std::string()); |
| 304 handle->set_ssl_error_response_info(info); | 305 handle->set_ssl_error_response_info(info); |
| 305 } | 306 } |
| 306 } | 307 } |
| 307 | 308 |
| 308 private: | 309 private: |
| 309 // From ConnectJob: | 310 // From ConnectJob: |
| 310 | 311 |
| 311 int ConnectInternal() override { | 312 int ConnectInternal() override { |
| 312 AddressList ignored; | 313 AddressList ignored; |
| 313 client_socket_factory_->CreateTransportClientSocket(ignored, NULL, | 314 client_socket_factory_->CreateTransportClientSocket(ignored, NULL, NULL, |
| 314 NetLog::Source()); | 315 NetLog::Source()); |
| 315 SetSocket( | 316 SetSocket( |
| 316 scoped_ptr<StreamSocket>(new MockClientSocket(net_log().net_log()))); | 317 scoped_ptr<StreamSocket>(new MockClientSocket(net_log().net_log()))); |
| 317 switch (job_type_) { | 318 switch (job_type_) { |
| 318 case kMockJob: | 319 case kMockJob: |
| 319 return DoConnect(true /* successful */, false /* sync */, | 320 return DoConnect(true /* successful */, false /* sync */, |
| 320 false /* recoverable */); | 321 false /* recoverable */); |
| 321 case kMockFailingJob: | 322 case kMockFailingJob: |
| 322 return DoConnect(false /* error */, false /* sync */, | 323 return DoConnect(false /* error */, false /* sync */, |
| 323 false /* recoverable */); | 324 false /* recoverable */); |
| (...skipping 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3839 request(1)->handle()->Reset(); | 3840 request(1)->handle()->Reset(); |
| 3840 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a")); | 3841 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a")); |
| 3841 | 3842 |
| 3842 EXPECT_EQ(OK, request(2)->WaitForResult()); | 3843 EXPECT_EQ(OK, request(2)->WaitForResult()); |
| 3843 EXPECT_FALSE(request(1)->have_result()); | 3844 EXPECT_FALSE(request(1)->have_result()); |
| 3844 } | 3845 } |
| 3845 | 3846 |
| 3846 } // namespace | 3847 } // namespace |
| 3847 | 3848 |
| 3848 } // namespace net | 3849 } // namespace net |
| OLD | NEW |