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 "jingle/notifier/base/fake_ssl_client_socket.h" | 5 #include "jingle/notifier/base/fake_ssl_client_socket.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return transport_socket_->Read(buf, buf_len, callback); | 105 return transport_socket_->Read(buf, buf_len, callback); |
106 } | 106 } |
107 int FakeSSLClientSocket::Read(net::IOBuffer* buf, int buf_len, | 107 int FakeSSLClientSocket::Read(net::IOBuffer* buf, int buf_len, |
108 const net::CompletionCallback& callback) { | 108 const net::CompletionCallback& callback) { |
109 DCHECK_EQ(next_handshake_state_, STATE_NONE); | 109 DCHECK_EQ(next_handshake_state_, STATE_NONE); |
110 DCHECK(handshake_completed_); | 110 DCHECK(handshake_completed_); |
111 return transport_socket_->Read(buf, buf_len, callback); | 111 return transport_socket_->Read(buf, buf_len, callback); |
112 } | 112 } |
113 | 113 |
114 int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, | 114 int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, |
115 net::OldCompletionCallback* callback) { | 115 net::OldCompletionCallback* callback) { |
116 DCHECK_EQ(next_handshake_state_, STATE_NONE); | 116 DCHECK_EQ(next_handshake_state_, STATE_NONE); |
117 DCHECK(handshake_completed_); | 117 DCHECK(handshake_completed_); |
118 return transport_socket_->Write(buf, buf_len, callback); | 118 return transport_socket_->Write(buf, buf_len, callback); |
| 119 } |
| 120 int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, |
| 121 const net::CompletionCallback& callback) { |
| 122 DCHECK_EQ(next_handshake_state_, STATE_NONE); |
| 123 DCHECK(handshake_completed_); |
| 124 return transport_socket_->Write(buf, buf_len, callback); |
119 } | 125 } |
120 | 126 |
121 bool FakeSSLClientSocket::SetReceiveBufferSize(int32 size) { | 127 bool FakeSSLClientSocket::SetReceiveBufferSize(int32 size) { |
122 return transport_socket_->SetReceiveBufferSize(size); | 128 return transport_socket_->SetReceiveBufferSize(size); |
123 } | 129 } |
124 | 130 |
125 bool FakeSSLClientSocket::SetSendBufferSize(int32 size) { | 131 bool FakeSSLClientSocket::SetSendBufferSize(int32 size) { |
126 return transport_socket_->SetSendBufferSize(size); | 132 return transport_socket_->SetSendBufferSize(size); |
127 } | 133 } |
128 | 134 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 375 |
370 int64 FakeSSLClientSocket::NumBytesRead() const { | 376 int64 FakeSSLClientSocket::NumBytesRead() const { |
371 return transport_socket_->NumBytesRead(); | 377 return transport_socket_->NumBytesRead(); |
372 } | 378 } |
373 | 379 |
374 base::TimeDelta FakeSSLClientSocket::GetConnectTimeMicros() const { | 380 base::TimeDelta FakeSSLClientSocket::GetConnectTimeMicros() const { |
375 return transport_socket_->GetConnectTimeMicros(); | 381 return transport_socket_->GetConnectTimeMicros(); |
376 } | 382 } |
377 | 383 |
378 } // namespace notifier | 384 } // namespace notifier |
OLD | NEW |