| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "net/base/ssl_info.h" | 10 #include "net/base/ssl_info.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 330 } |
| 331 | 331 |
| 332 int ClientSocketPoolTest::StartRequestUsingPool(ClientSocketPool* socket_pool, | 332 int ClientSocketPoolTest::StartRequestUsingPool(ClientSocketPool* socket_pool, |
| 333 const std::string& group_name, | 333 const std::string& group_name, |
| 334 int priority) { | 334 int priority) { |
| 335 DCHECK(socket_pool); | 335 DCHECK(socket_pool); |
| 336 TestSocketRequest* request = new TestSocketRequest(socket_pool, | 336 TestSocketRequest* request = new TestSocketRequest(socket_pool, |
| 337 &request_order_, | 337 &request_order_, |
| 338 &completion_count_); | 338 &completion_count_); |
| 339 requests_.push_back(request); | 339 requests_.push_back(request); |
| 340 int rv = request->handle()->Init(group_name, ignored_request_info_, priority, | 340 int rv = request->handle()->Init(NULL, group_name, ignored_request_info_, |
| 341 request); | 341 priority, request); |
| 342 if (rv != ERR_IO_PENDING) | 342 if (rv != ERR_IO_PENDING) |
| 343 request_order_.push_back(request); | 343 request_order_.push_back(request); |
| 344 return rv; | 344 return rv; |
| 345 } | 345 } |
| 346 | 346 |
| 347 int ClientSocketPoolTest::GetOrderOfRequest(size_t index) { | 347 int ClientSocketPoolTest::GetOrderOfRequest(size_t index) { |
| 348 index--; | 348 index--; |
| 349 if (index < 0 || index >= requests_.size()) | 349 if (index < 0 || index >= requests_.size()) |
| 350 return kIndexOutOfBounds; | 350 return kIndexOutOfBounds; |
| 351 | 351 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 371 } | 371 } |
| 372 | 372 |
| 373 void ClientSocketPoolTest::ReleaseAllConnections(KeepAlive keep_alive) { | 373 void ClientSocketPoolTest::ReleaseAllConnections(KeepAlive keep_alive) { |
| 374 bool released_one; | 374 bool released_one; |
| 375 do { | 375 do { |
| 376 released_one = ReleaseOneConnection(keep_alive); | 376 released_one = ReleaseOneConnection(keep_alive); |
| 377 } while (released_one); | 377 } while (released_one); |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace net | 380 } // namespace net |
| OLD | NEW |