| 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 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ | 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ | 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 int StartRequestUsingPool(const scoped_refptr<PoolType>& socket_pool, | 509 int StartRequestUsingPool(const scoped_refptr<PoolType>& socket_pool, |
| 510 const std::string& group_name, | 510 const std::string& group_name, |
| 511 RequestPriority priority, | 511 RequestPriority priority, |
| 512 const SocketParams& socket_params) { | 512 const SocketParams& socket_params) { |
| 513 DCHECK(socket_pool.get()); | 513 DCHECK(socket_pool.get()); |
| 514 TestSocketRequest* request = new TestSocketRequest(&request_order_, | 514 TestSocketRequest* request = new TestSocketRequest(&request_order_, |
| 515 &completion_count_); | 515 &completion_count_); |
| 516 requests_.push_back(request); | 516 requests_.push_back(request); |
| 517 int rv = request->handle()->Init( | 517 int rv = request->handle()->Init( |
| 518 group_name, socket_params, priority, request, | 518 group_name, socket_params, priority, request, |
| 519 socket_pool, NULL); | 519 socket_pool, BoundNetLog()); |
| 520 if (rv != ERR_IO_PENDING) | 520 if (rv != ERR_IO_PENDING) |
| 521 request_order_.push_back(request); | 521 request_order_.push_back(request); |
| 522 return rv; | 522 return rv; |
| 523 } | 523 } |
| 524 | 524 |
| 525 // Provided there were n requests started, takes |index| in range 1..n | 525 // Provided there were n requests started, takes |index| in range 1..n |
| 526 // and returns order in which that request completed, in range 1..n, | 526 // and returns order in which that request completed, in range 1..n, |
| 527 // or kIndexOutOfBounds if |index| is out of bounds, or kRequestNotFound | 527 // or kIndexOutOfBounds if |index| is out of bounds, or kRequestNotFound |
| 528 // if that request did not complete (for example was canceled). | 528 // if that request did not complete (for example was canceled). |
| 529 int GetOrderOfRequest(size_t index); | 529 int GetOrderOfRequest(size_t index); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 549 | 549 |
| 550 extern const char kSOCKS5OkRequest[]; | 550 extern const char kSOCKS5OkRequest[]; |
| 551 extern const int kSOCKS5OkRequestLength; | 551 extern const int kSOCKS5OkRequestLength; |
| 552 | 552 |
| 553 extern const char kSOCKS5OkResponse[]; | 553 extern const char kSOCKS5OkResponse[]; |
| 554 extern const int kSOCKS5OkResponseLength; | 554 extern const int kSOCKS5OkResponseLength; |
| 555 | 555 |
| 556 } // namespace net | 556 } // namespace net |
| 557 | 557 |
| 558 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 558 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |