| 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 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
| 6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
| 7 | 7 |
| 8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 FROM_HERE, | 270 FROM_HERE, |
| 271 base::Bind(&SocketStream::DoLoop, this, OK)); | 271 base::Bind(&SocketStream::DoLoop, this, OK)); |
| 272 } | 272 } |
| 273 | 273 |
| 274 SocketStream::~SocketStream() { | 274 SocketStream::~SocketStream() { |
| 275 set_context(NULL); | 275 set_context(NULL); |
| 276 DCHECK(!delegate_); | 276 DCHECK(!delegate_); |
| 277 DCHECK(!pac_request_); | 277 DCHECK(!pac_request_); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void SocketStream::CopyAddrInfo(struct addrinfo* head) { | 280 void SocketStream::set_addresses(const AddressList& addresses) { |
| 281 addresses_ = AddressList::CreateByCopying(head); | 281 addresses_ = addresses; |
| 282 } | 282 } |
| 283 | 283 |
| 284 void SocketStream::DoClose() { | 284 void SocketStream::DoClose() { |
| 285 closing_ = true; | 285 closing_ = true; |
| 286 // If next_state_ is STATE_TCP_CONNECT, it's waiting other socket | 286 // If next_state_ is STATE_TCP_CONNECT, it's waiting other socket |
| 287 // establishing connection. If next_state_ is STATE_AUTH_REQUIRED, it's | 287 // establishing connection. If next_state_ is STATE_AUTH_REQUIRED, it's |
| 288 // waiting for restarting. In these states, we'll close the SocketStream | 288 // waiting for restarting. In these states, we'll close the SocketStream |
| 289 // now. | 289 // now. |
| 290 if (next_state_ == STATE_TCP_CONNECT || next_state_ == STATE_AUTH_REQUIRED) { | 290 if (next_state_ == STATE_TCP_CONNECT || next_state_ == STATE_AUTH_REQUIRED) { |
| 291 DoLoop(ERR_ABORTED); | 291 DoLoop(ERR_ABORTED); |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 | 1214 |
| 1215 SSLConfigService* SocketStream::ssl_config_service() const { | 1215 SSLConfigService* SocketStream::ssl_config_service() const { |
| 1216 return context_->ssl_config_service(); | 1216 return context_->ssl_config_service(); |
| 1217 } | 1217 } |
| 1218 | 1218 |
| 1219 ProxyService* SocketStream::proxy_service() const { | 1219 ProxyService* SocketStream::proxy_service() const { |
| 1220 return context_->proxy_service(); | 1220 return context_->proxy_service(); |
| 1221 } | 1221 } |
| 1222 | 1222 |
| 1223 } // namespace net | 1223 } // namespace net |
| OLD | NEW |