OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 virtual int Write( | 59 virtual int Write( |
60 IOBuffer* /* buf */, int len, OldCompletionCallback* /* callback */) { | 60 IOBuffer* /* buf */, int len, OldCompletionCallback* /* callback */) { |
61 was_used_to_convey_data_ = true; | 61 was_used_to_convey_data_ = true; |
62 return len; | 62 return len; |
63 } | 63 } |
64 virtual bool SetReceiveBufferSize(int32 size) { return true; } | 64 virtual bool SetReceiveBufferSize(int32 size) { return true; } |
65 virtual bool SetSendBufferSize(int32 size) { return true; } | 65 virtual bool SetSendBufferSize(int32 size) { return true; } |
66 | 66 |
67 // StreamSocket methods: | 67 // StreamSocket implementation. |
68 | |
69 virtual int Connect(OldCompletionCallback* callback) { | 68 virtual int Connect(OldCompletionCallback* callback) { |
70 connected_ = true; | 69 connected_ = true; |
71 return OK; | 70 return OK; |
72 } | 71 } |
| 72 virtual int Connect(const net::CompletionCallback& callback) { |
| 73 connected_ = true; |
| 74 return OK; |
| 75 } |
73 | 76 |
74 virtual void Disconnect() { connected_ = false; } | 77 virtual void Disconnect() { connected_ = false; } |
75 virtual bool IsConnected() const { return connected_; } | 78 virtual bool IsConnected() const { return connected_; } |
76 virtual bool IsConnectedAndIdle() const { return connected_; } | 79 virtual bool IsConnectedAndIdle() const { return connected_; } |
77 | 80 |
78 virtual int GetPeerAddress(AddressList* /* address */) const { | 81 virtual int GetPeerAddress(AddressList* /* address */) const { |
79 return ERR_UNEXPECTED; | 82 return ERR_UNEXPECTED; |
80 } | 83 } |
81 | 84 |
82 virtual int GetLocalAddress(IPEndPoint* /* address */) const { | 85 virtual int GetLocalAddress(IPEndPoint* /* address */) const { |
(...skipping 3265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3348 // The hung connect job should still be there, but everything else should be | 3351 // The hung connect job should still be there, but everything else should be |
3349 // complete. | 3352 // complete. |
3350 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); | 3353 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); |
3351 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); | 3354 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); |
3352 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); | 3355 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); |
3353 } | 3356 } |
3354 | 3357 |
3355 } // namespace | 3358 } // namespace |
3356 | 3359 |
3357 } // namespace net | 3360 } // namespace net |
OLD | NEW |