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 "jingle/glue/proxy_resolving_client_socket.h" | 5 #include "jingle/glue/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/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 int ProxyResolvingClientSocket::Write( | 100 int ProxyResolvingClientSocket::Write( |
101 net::IOBuffer* buf, | 101 net::IOBuffer* buf, |
102 int buf_len, | 102 int buf_len, |
103 const net::CompletionCallback& callback) { | 103 const net::CompletionCallback& callback) { |
104 if (transport_.get() && transport_->socket()) | 104 if (transport_.get() && transport_->socket()) |
105 return transport_->socket()->Write(buf, buf_len, callback); | 105 return transport_->socket()->Write(buf, buf_len, callback); |
106 NOTREACHED(); | 106 NOTREACHED(); |
107 return net::ERR_SOCKET_NOT_CONNECTED; | 107 return net::ERR_SOCKET_NOT_CONNECTED; |
108 } | 108 } |
109 | 109 |
110 bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { | 110 int ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { |
111 if (transport_.get() && transport_->socket()) | 111 if (transport_.get() && transport_->socket()) |
112 return transport_->socket()->SetReceiveBufferSize(size); | 112 return transport_->socket()->SetReceiveBufferSize(size); |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 return false; | 114 return net::ERR_SOCKET_NOT_CONNECTED; |
115 } | 115 } |
116 | 116 |
117 bool ProxyResolvingClientSocket::SetSendBufferSize(int32 size) { | 117 int ProxyResolvingClientSocket::SetSendBufferSize(int32 size) { |
118 if (transport_.get() && transport_->socket()) | 118 if (transport_.get() && transport_->socket()) |
119 return transport_->socket()->SetSendBufferSize(size); | 119 return transport_->socket()->SetSendBufferSize(size); |
120 NOTREACHED(); | 120 NOTREACHED(); |
121 return false; | 121 return net::ERR_SOCKET_NOT_CONNECTED; |
122 } | 122 } |
123 | 123 |
124 int ProxyResolvingClientSocket::Connect( | 124 int ProxyResolvingClientSocket::Connect( |
125 const net::CompletionCallback& callback) { | 125 const net::CompletionCallback& callback) { |
126 DCHECK(user_connect_callback_.is_null()); | 126 DCHECK(user_connect_callback_.is_null()); |
127 | 127 |
128 tried_direct_connect_fallback_ = false; | 128 tried_direct_connect_fallback_ = false; |
129 | 129 |
130 // First we try and resolve the proxy. | 130 // First we try and resolve the proxy. |
131 int status = network_session_->proxy_service()->ResolveProxy( | 131 int status = network_session_->proxy_service()->ResolveProxy( |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 return false; | 389 return false; |
390 } | 390 } |
391 | 391 |
392 void ProxyResolvingClientSocket::CloseTransportSocket() { | 392 void ProxyResolvingClientSocket::CloseTransportSocket() { |
393 if (transport_.get() && transport_->socket()) | 393 if (transport_.get() && transport_->socket()) |
394 transport_->socket()->Disconnect(); | 394 transport_->socket()->Disconnect(); |
395 transport_.reset(); | 395 transport_.reset(); |
396 } | 396 } |
397 | 397 |
398 } // namespace jingle_glue | 398 } // namespace jingle_glue |
OLD | NEW |