| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return net::ERR_SOCKET_NOT_CONNECTED; | 81 return net::ERR_SOCKET_NOT_CONNECTED; |
| 82 } | 82 } |
| 83 | 83 |
| 84 int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, | 84 int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, |
| 85 net::OldCompletionCallback* callback) { | 85 net::OldCompletionCallback* callback) { |
| 86 if (transport_.get() && transport_->socket()) | 86 if (transport_.get() && transport_->socket()) |
| 87 return transport_->socket()->Write(buf, buf_len, callback); | 87 return transport_->socket()->Write(buf, buf_len, callback); |
| 88 NOTREACHED(); | 88 NOTREACHED(); |
| 89 return net::ERR_SOCKET_NOT_CONNECTED; | 89 return net::ERR_SOCKET_NOT_CONNECTED; |
| 90 } | 90 } |
| 91 int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, |
| 92 const net::CompletionCallback& callback) { |
| 93 if (transport_.get() && transport_->socket()) |
| 94 return transport_->socket()->Write(buf, buf_len, callback); |
| 95 NOTREACHED(); |
| 96 return net::ERR_SOCKET_NOT_CONNECTED; |
| 97 } |
| 91 | 98 |
| 92 bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { | 99 bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { |
| 93 if (transport_.get() && transport_->socket()) | 100 if (transport_.get() && transport_->socket()) |
| 94 return transport_->socket()->SetReceiveBufferSize(size); | 101 return transport_->socket()->SetReceiveBufferSize(size); |
| 95 NOTREACHED(); | 102 NOTREACHED(); |
| 96 return false; | 103 return false; |
| 97 } | 104 } |
| 98 | 105 |
| 99 bool ProxyResolvingClientSocket::SetSendBufferSize(int32 size) { | 106 bool ProxyResolvingClientSocket::SetSendBufferSize(int32 size) { |
| 100 if (transport_.get() && transport_->socket()) | 107 if (transport_.get() && transport_->socket()) |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 return base::TimeDelta::FromMicroseconds(-1); | 417 return base::TimeDelta::FromMicroseconds(-1); |
| 411 } | 418 } |
| 412 | 419 |
| 413 void ProxyResolvingClientSocket::CloseTransportSocket() { | 420 void ProxyResolvingClientSocket::CloseTransportSocket() { |
| 414 if (transport_.get() && transport_->socket()) | 421 if (transport_.get() && transport_->socket()) |
| 415 transport_->socket()->Disconnect(); | 422 transport_->socket()->Disconnect(); |
| 416 transport_.reset(); | 423 transport_.reset(); |
| 417 } | 424 } |
| 418 | 425 |
| 419 } // namespace notifier | 426 } // namespace notifier |
| OLD | NEW |