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 "remoting/jingle_glue/ssl_socket_adapter.h" | 5 #include "remoting/jingle_glue/ssl_socket_adapter.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "jingle/glue/utils.h" | 10 #include "jingle/glue/utils.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 bool TransportSocket::WasEverUsed() const { | 263 bool TransportSocket::WasEverUsed() const { |
264 // We don't use this in ClientSocketPools, so this should never be used. | 264 // We don't use this in ClientSocketPools, so this should never be used. |
265 NOTREACHED(); | 265 NOTREACHED(); |
266 return was_used_to_convey_data_; | 266 return was_used_to_convey_data_; |
267 } | 267 } |
268 | 268 |
269 bool TransportSocket::UsingTCPFastOpen() const { | 269 bool TransportSocket::UsingTCPFastOpen() const { |
270 return false; | 270 return false; |
271 } | 271 } |
272 | 272 |
273 int64 TransportSocket::NumBytesRead() const { | |
274 NOTREACHED(); | |
275 return -1; | |
276 } | |
277 | |
278 base::TimeDelta TransportSocket::GetConnectTimeMicros() const { | |
279 NOTREACHED(); | |
280 return base::TimeDelta::FromMicroseconds(-1); | |
281 } | |
282 | |
283 int TransportSocket::Read(net::IOBuffer* buf, int buf_len, | 273 int TransportSocket::Read(net::IOBuffer* buf, int buf_len, |
284 net::CompletionCallback* callback) { | 274 net::CompletionCallback* callback) { |
285 DCHECK(buf); | 275 DCHECK(buf); |
286 DCHECK(!read_callback_); | 276 DCHECK(!read_callback_); |
287 DCHECK(!read_buffer_.get()); | 277 DCHECK(!read_buffer_.get()); |
288 int result = socket_->Recv(buf->data(), buf_len); | 278 int result = socket_->Recv(buf->data(), buf_len); |
289 if (result < 0) { | 279 if (result < 0) { |
290 result = net::MapSystemError(socket_->GetError()); | 280 result = net::MapSystemError(socket_->GetError()); |
291 if (result == net::ERR_IO_PENDING) { | 281 if (result == net::ERR_IO_PENDING) { |
292 read_callback_ = callback; | 282 read_callback_ = callback; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 write_buffer_len_ = buffer_len; | 364 write_buffer_len_ = buffer_len; |
375 return; | 365 return; |
376 } | 366 } |
377 } | 367 } |
378 was_used_to_convey_data_ = true; | 368 was_used_to_convey_data_ = true; |
379 callback->RunWithParams(Tuple1<int>(result)); | 369 callback->RunWithParams(Tuple1<int>(result)); |
380 } | 370 } |
381 } | 371 } |
382 | 372 |
383 } // namespace remoting | 373 } // namespace remoting |
OLD | NEW |