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/proxy_resolving_client_socket.h" | 5 #include "jingle/notifier/base/proxy_resolving_client_socket.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 Disconnect(); | 66 Disconnect(); |
67 } | 67 } |
68 | 68 |
69 int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len, | 69 int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len, |
70 net::OldCompletionCallback* callback) { | 70 net::OldCompletionCallback* callback) { |
71 if (transport_.get() && transport_->socket()) | 71 if (transport_.get() && transport_->socket()) |
72 return transport_->socket()->Read(buf, buf_len, callback); | 72 return transport_->socket()->Read(buf, buf_len, callback); |
73 NOTREACHED(); | 73 NOTREACHED(); |
74 return net::ERR_SOCKET_NOT_CONNECTED; | 74 return net::ERR_SOCKET_NOT_CONNECTED; |
75 } | 75 } |
| 76 int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len, |
| 77 const net::CompletionCallback& callback) { |
| 78 if (transport_.get() && transport_->socket()) |
| 79 return transport_->socket()->Read(buf, buf_len, callback); |
| 80 NOTREACHED(); |
| 81 return net::ERR_SOCKET_NOT_CONNECTED; |
| 82 } |
76 | 83 |
77 int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, | 84 int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, |
78 net::OldCompletionCallback* callback) { | 85 net::OldCompletionCallback* callback) { |
79 if (transport_.get() && transport_->socket()) | 86 if (transport_.get() && transport_->socket()) |
80 return transport_->socket()->Write(buf, buf_len, callback); | 87 return transport_->socket()->Write(buf, buf_len, callback); |
81 NOTREACHED(); | 88 NOTREACHED(); |
82 return net::ERR_SOCKET_NOT_CONNECTED; | 89 return net::ERR_SOCKET_NOT_CONNECTED; |
83 } | 90 } |
84 | 91 |
85 bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { | 92 bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 return base::TimeDelta::FromMicroseconds(-1); | 410 return base::TimeDelta::FromMicroseconds(-1); |
404 } | 411 } |
405 | 412 |
406 void ProxyResolvingClientSocket::CloseTransportSocket() { | 413 void ProxyResolvingClientSocket::CloseTransportSocket() { |
407 if (transport_.get() && transport_->socket()) | 414 if (transport_.get() && transport_->socket()) |
408 transport_->socket()->Disconnect(); | 415 transport_->socket()->Disconnect(); |
409 transport_.reset(); | 416 transport_.reset(); |
410 } | 417 } |
411 | 418 |
412 } // namespace notifier | 419 } // namespace notifier |
OLD | NEW |