| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 int64 TransportSocket::NumBytesRead() const { | 271 int64 TransportSocket::NumBytesRead() const { |
| 272 NOTREACHED(); | 272 NOTREACHED(); |
| 273 return -1; | 273 return -1; |
| 274 } | 274 } |
| 275 | 275 |
| 276 base::TimeDelta TransportSocket::GetConnectTimeMicros() const { | 276 base::TimeDelta TransportSocket::GetConnectTimeMicros() const { |
| 277 NOTREACHED(); | 277 NOTREACHED(); |
| 278 return base::TimeDelta::FromMicroseconds(-1); | 278 return base::TimeDelta::FromMicroseconds(-1); |
| 279 } | 279 } |
| 280 | 280 |
| 281 net::NextProto TransportSocket::GetNegotiatedProtocol() const { |
| 282 NOTREACHED(); |
| 283 return net::kProtoUnknown; |
| 284 } |
| 285 |
| 281 int TransportSocket::Read(net::IOBuffer* buf, int buf_len, | 286 int TransportSocket::Read(net::IOBuffer* buf, int buf_len, |
| 282 const net::CompletionCallback& callback) { | 287 const net::CompletionCallback& callback) { |
| 283 DCHECK(buf); | 288 DCHECK(buf); |
| 284 DCHECK(read_callback_.is_null()); | 289 DCHECK(read_callback_.is_null()); |
| 285 DCHECK(!read_buffer_.get()); | 290 DCHECK(!read_buffer_.get()); |
| 286 int result = socket_->Recv(buf->data(), buf_len); | 291 int result = socket_->Recv(buf->data(), buf_len); |
| 287 if (result < 0) { | 292 if (result < 0) { |
| 288 result = net::MapSystemError(socket_->GetError()); | 293 result = net::MapSystemError(socket_->GetError()); |
| 289 if (result == net::ERR_IO_PENDING) { | 294 if (result == net::ERR_IO_PENDING) { |
| 290 read_callback_ = callback; | 295 read_callback_ = callback; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 write_buffer_len_ = buffer_len; | 377 write_buffer_len_ = buffer_len; |
| 373 return; | 378 return; |
| 374 } | 379 } |
| 375 } | 380 } |
| 376 was_used_to_convey_data_ = true; | 381 was_used_to_convey_data_ = true; |
| 377 callback.Run(result); | 382 callback.Run(result); |
| 378 } | 383 } |
| 379 } | 384 } |
| 380 | 385 |
| 381 } // namespace remoting | 386 } // namespace remoting |
| OLD | NEW |