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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 virtual int Read( | 51 virtual int Read( |
52 IOBuffer* /* buf */, int /* len */, CompletionCallback* /* callback */) { | 52 IOBuffer* /* buf */, int /* len */, CompletionCallback* /* callback */) { |
53 return ERR_UNEXPECTED; | 53 return ERR_UNEXPECTED; |
54 } | 54 } |
55 | 55 |
56 virtual int Write( | 56 virtual int Write( |
57 IOBuffer* /* buf */, int len, CompletionCallback* /* callback */) { | 57 IOBuffer* /* buf */, int len, CompletionCallback* /* callback */) { |
58 was_used_to_convey_data_ = true; | 58 was_used_to_convey_data_ = true; |
59 return len; | 59 return len; |
60 } | 60 } |
61 virtual int Write( | |
62 IOBuffer* /* buf */, int len, int sctp_stream_id, | |
63 CompletionCallback* /* callback */) { | |
Mike Belshe
2011/04/06 18:32:53
This looks obsolete.
| |
64 was_used_to_convey_data_ = true; | |
65 return len; | |
66 } | |
61 virtual bool SetReceiveBufferSize(int32 size) { return true; } | 67 virtual bool SetReceiveBufferSize(int32 size) { return true; } |
62 virtual bool SetSendBufferSize(int32 size) { return true; } | 68 virtual bool SetSendBufferSize(int32 size) { return true; } |
63 | 69 |
64 // ClientSocket methods: | 70 // ClientSocket methods: |
65 | 71 |
66 virtual int Connect(CompletionCallback* callback) { | 72 virtual int Connect(CompletionCallback* callback) { |
67 connected_ = true; | 73 connected_ = true; |
68 return OK; | 74 return OK; |
69 } | 75 } |
70 | 76 |
(...skipping 29 matching lines...) Expand all Loading... | |
100 MockClientSocketFactory() : allocation_count_(0) {} | 106 MockClientSocketFactory() : allocation_count_(0) {} |
101 | 107 |
102 virtual ClientSocket* CreateTCPClientSocket( | 108 virtual ClientSocket* CreateTCPClientSocket( |
103 const AddressList& addresses, | 109 const AddressList& addresses, |
104 NetLog* /* net_log */, | 110 NetLog* /* net_log */, |
105 const NetLog::Source& /*source*/) { | 111 const NetLog::Source& /*source*/) { |
106 allocation_count_++; | 112 allocation_count_++; |
107 return NULL; | 113 return NULL; |
108 } | 114 } |
109 | 115 |
116 virtual ClientSocket* CreateSCTPClientSocket( | |
117 const AddressList& addresses, | |
118 NetLog* /* net_log */, | |
119 const NetLog::Source& /*source*/) { | |
120 allocation_count_++; | |
121 return NULL; | |
122 } | |
123 | |
110 virtual SSLClientSocket* CreateSSLClientSocket( | 124 virtual SSLClientSocket* CreateSSLClientSocket( |
111 ClientSocketHandle* transport_socket, | 125 ClientSocketHandle* transport_socket, |
112 const HostPortPair& host_and_port, | 126 const HostPortPair& host_and_port, |
113 const SSLConfig& ssl_config, | 127 const SSLConfig& ssl_config, |
114 SSLHostInfo* ssl_host_info, | 128 SSLHostInfo* ssl_host_info, |
115 CertVerifier* cert_verifier, | 129 CertVerifier* cert_verifier, |
116 DnsCertProvenanceChecker* dns_cert_checker) { | 130 DnsCertProvenanceChecker* dns_cert_checker) { |
117 NOTIMPLEMENTED(); | 131 NOTIMPLEMENTED(); |
118 delete ssl_host_info; | 132 delete ssl_host_info; |
119 return NULL; | 133 return NULL; |
(...skipping 2993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3113 EXPECT_EQ(1, pool_->IdleSocketCountInGroup("a")); | 3127 EXPECT_EQ(1, pool_->IdleSocketCountInGroup("a")); |
3114 EXPECT_EQ(0, pool_->NumActiveSocketsInGroup("a")); | 3128 EXPECT_EQ(0, pool_->NumActiveSocketsInGroup("a")); |
3115 EXPECT_EQ(0, pool_->NumConnectJobsInGroup("b")); | 3129 EXPECT_EQ(0, pool_->NumConnectJobsInGroup("b")); |
3116 EXPECT_EQ(1, pool_->IdleSocketCountInGroup("b")); | 3130 EXPECT_EQ(1, pool_->IdleSocketCountInGroup("b")); |
3117 EXPECT_EQ(0, pool_->NumActiveSocketsInGroup("b")); | 3131 EXPECT_EQ(0, pool_->NumActiveSocketsInGroup("b")); |
3118 } | 3132 } |
3119 | 3133 |
3120 } // namespace | 3134 } // namespace |
3121 | 3135 |
3122 } // namespace net | 3136 } // namespace net |
OLD | NEW |