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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 IOBuffer* /* buf */, int len, const CompletionCallback& /* callback */) { | 59 IOBuffer* /* buf */, int len, const CompletionCallback& /* callback */) { |
60 num_bytes_read_ += len; | 60 num_bytes_read_ += len; |
61 return len; | 61 return len; |
62 } | 62 } |
63 | 63 |
64 virtual int Write( | 64 virtual int Write( |
65 IOBuffer* /* buf */, int len, OldCompletionCallback* /* callback */) { | 65 IOBuffer* /* buf */, int len, OldCompletionCallback* /* callback */) { |
66 was_used_to_convey_data_ = true; | 66 was_used_to_convey_data_ = true; |
67 return len; | 67 return len; |
68 } | 68 } |
| 69 virtual int Write( |
| 70 IOBuffer* /* buf */, int len, const CompletionCallback& /* callback */) { |
| 71 was_used_to_convey_data_ = true; |
| 72 return len; |
| 73 } |
69 virtual bool SetReceiveBufferSize(int32 size) { return true; } | 74 virtual bool SetReceiveBufferSize(int32 size) { return true; } |
70 virtual bool SetSendBufferSize(int32 size) { return true; } | 75 virtual bool SetSendBufferSize(int32 size) { return true; } |
71 | 76 |
72 // StreamSocket implementation. | 77 // StreamSocket implementation. |
73 virtual int Connect(OldCompletionCallback* callback) { | 78 virtual int Connect(OldCompletionCallback* callback) { |
74 connected_ = true; | 79 connected_ = true; |
75 return OK; | 80 return OK; |
76 } | 81 } |
77 virtual int Connect(const net::CompletionCallback& callback) { | 82 virtual int Connect(const net::CompletionCallback& callback) { |
78 connected_ = true; | 83 connected_ = true; |
(...skipping 3276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3355 // The hung connect job should still be there, but everything else should be | 3360 // The hung connect job should still be there, but everything else should be |
3356 // complete. | 3361 // complete. |
3357 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); | 3362 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); |
3358 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); | 3363 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); |
3359 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); | 3364 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); |
3360 } | 3365 } |
3361 | 3366 |
3362 } // namespace | 3367 } // namespace |
3363 | 3368 |
3364 } // namespace net | 3369 } // namespace net |
OLD | NEW |