| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/socket_test_util.h" | 5 #include "net/socket/socket_test_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 | 10 |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 ClientSocketHandle* transport_socket, | 982 ClientSocketHandle* transport_socket, |
| 983 const std::string& hostname, | 983 const std::string& hostname, |
| 984 const SSLConfig& ssl_config) { | 984 const SSLConfig& ssl_config) { |
| 985 MockSSLClientSocket* socket = | 985 MockSSLClientSocket* socket = |
| 986 new MockSSLClientSocket(transport_socket, hostname, ssl_config, | 986 new MockSSLClientSocket(transport_socket, hostname, ssl_config, |
| 987 mock_ssl_data_.GetNext()); | 987 mock_ssl_data_.GetNext()); |
| 988 ssl_client_sockets_.push_back(socket); | 988 ssl_client_sockets_.push_back(socket); |
| 989 return socket; | 989 return socket; |
| 990 } | 990 } |
| 991 | 991 |
| 992 TestSocketRequest::TestSocketRequest( |
| 993 std::vector<TestSocketRequest*>* request_order, |
| 994 size_t* completion_count) |
| 995 : request_order_(request_order), |
| 996 completion_count_(completion_count) { |
| 997 DCHECK(request_order); |
| 998 DCHECK(completion_count); |
| 999 } |
| 1000 |
| 1001 TestSocketRequest::~TestSocketRequest() { |
| 1002 } |
| 1003 |
| 992 int TestSocketRequest::WaitForResult() { | 1004 int TestSocketRequest::WaitForResult() { |
| 993 return callback_.WaitForResult(); | 1005 return callback_.WaitForResult(); |
| 994 } | 1006 } |
| 995 | 1007 |
| 996 void TestSocketRequest::RunWithParams(const Tuple1<int>& params) { | 1008 void TestSocketRequest::RunWithParams(const Tuple1<int>& params) { |
| 997 callback_.RunWithParams(params); | 1009 callback_.RunWithParams(params); |
| 998 (*completion_count_)++; | 1010 (*completion_count_)++; |
| 999 request_order_->push_back(this); | 1011 request_order_->push_back(this); |
| 1000 } | 1012 } |
| 1001 | 1013 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 | 1302 |
| 1291 handle_ = NULL; | 1303 handle_ = NULL; |
| 1292 | 1304 |
| 1293 if (user_callback_) { | 1305 if (user_callback_) { |
| 1294 CompletionCallback* callback = user_callback_; | 1306 CompletionCallback* callback = user_callback_; |
| 1295 user_callback_ = NULL; | 1307 user_callback_ = NULL; |
| 1296 callback->Run(rv); | 1308 callback->Run(rv); |
| 1297 } | 1309 } |
| 1298 } | 1310 } |
| 1299 } // namespace net | 1311 } // namespace net |
| OLD | NEW |