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