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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // StreamSocket implementation. | 86 // StreamSocket implementation. |
87 virtual int Connect(const CompletionCallback& callback) OVERRIDE { | 87 virtual int Connect(const CompletionCallback& callback) OVERRIDE { |
88 connected_ = true; | 88 connected_ = true; |
89 return OK; | 89 return OK; |
90 } | 90 } |
91 | 91 |
92 virtual void Disconnect() { connected_ = false; } | 92 virtual void Disconnect() { connected_ = false; } |
93 virtual bool IsConnected() const { return connected_; } | 93 virtual bool IsConnected() const { return connected_; } |
94 virtual bool IsConnectedAndIdle() const { return connected_; } | 94 virtual bool IsConnectedAndIdle() const { return connected_; } |
95 | 95 |
96 virtual int GetPeerAddress(AddressList* /* address */) const { | 96 virtual int GetPeerAddress(IPEndPoint* /* address */) const { |
97 return ERR_UNEXPECTED; | 97 return ERR_UNEXPECTED; |
98 } | 98 } |
99 | 99 |
100 virtual int GetLocalAddress(IPEndPoint* /* address */) const { | 100 virtual int GetLocalAddress(IPEndPoint* /* address */) const { |
101 return ERR_UNEXPECTED; | 101 return ERR_UNEXPECTED; |
102 } | 102 } |
103 | 103 |
104 virtual const BoundNetLog& NetLog() const { | 104 virtual const BoundNetLog& NetLog() const { |
105 return net_log_; | 105 return net_log_; |
106 } | 106 } |
(...skipping 3372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3479 // The hung connect job should still be there, but everything else should be | 3479 // The hung connect job should still be there, but everything else should be |
3480 // complete. | 3480 // complete. |
3481 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); | 3481 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); |
3482 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); | 3482 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); |
3483 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); | 3483 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); |
3484 } | 3484 } |
3485 | 3485 |
3486 } // namespace | 3486 } // namespace |
3487 | 3487 |
3488 } // namespace net | 3488 } // namespace net |
OLD | NEW |