Chromium Code Reviews| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 DCHECK_LE(result, OK); | 352 DCHECK_LE(result, OK); |
| 353 if (result == OK) | 353 if (result == OK) |
| 354 result = ERR_CONNECTION_CLOSED; | 354 result = ERR_CONNECTION_CLOSED; |
| 355 DCHECK_EQ(next_state_, STATE_NONE); | 355 DCHECK_EQ(next_state_, STATE_NONE); |
| 356 DVLOG(1) << "Finish result=" << ErrorToString(result); | 356 DVLOG(1) << "Finish result=" << ErrorToString(result); |
| 357 | 357 |
| 358 metrics_->OnClose(); | 358 metrics_->OnClose(); |
| 359 Delegate* delegate = delegate_; | 359 Delegate* delegate = delegate_; |
| 360 delegate_ = NULL; | 360 delegate_ = NULL; |
| 361 if (delegate) { | 361 if (delegate) { |
| 362 delegate->OnError(this, result); | 362 if (result != ERR_CONNECTION_CLOSED && result != ERR_PROTOCOL_SWITCHED) |
|
Li Yin
2013/04/26 06:57:18
I am unfamiliar with SwitchToSpdy related code, an
tyoshino (SeeGerritForStatus)
2013/04/26 07:19:43
Yes. I'm looking here too. Raising ERR_PROTOCOL_SW
| |
| 363 delegate->OnError(this, result); | |
| 363 if (result != ERR_PROTOCOL_SWITCHED) | 364 if (result != ERR_PROTOCOL_SWITCHED) |
| 364 delegate->OnClose(this); | 365 delegate->OnClose(this); |
| 365 } | 366 } |
| 366 Release(); | 367 Release(); |
| 367 } | 368 } |
| 368 | 369 |
| 369 int SocketStream::DidEstablishConnection() { | 370 int SocketStream::DidEstablishConnection() { |
| 370 if (!socket_.get() || !socket_->IsConnected()) { | 371 if (!socket_.get() || !socket_->IsConnected()) { |
| 371 next_state_ = STATE_CLOSE; | 372 next_state_ = STATE_CLOSE; |
| 372 return ERR_CONNECTION_FAILED; | 373 return ERR_CONNECTION_FAILED; |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1307 | 1308 |
| 1308 SSLConfigService* SocketStream::ssl_config_service() const { | 1309 SSLConfigService* SocketStream::ssl_config_service() const { |
| 1309 return context_->ssl_config_service(); | 1310 return context_->ssl_config_service(); |
| 1310 } | 1311 } |
| 1311 | 1312 |
| 1312 ProxyService* SocketStream::proxy_service() const { | 1313 ProxyService* SocketStream::proxy_service() const { |
| 1313 return context_->proxy_service(); | 1314 return context_->proxy_service(); |
| 1314 } | 1315 } |
| 1315 | 1316 |
| 1316 } // namespace net | 1317 } // namespace net |
| OLD | NEW |