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 "net/ftp/ftp_network_transaction.h" | 5 #include "net/ftp/ftp_network_transaction.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { | 661 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { |
662 if (result == OK) | 662 if (result == OK) |
663 next_state_ = STATE_CTRL_CONNECT; | 663 next_state_ = STATE_CTRL_CONNECT; |
664 return result; | 664 return result; |
665 } | 665 } |
666 | 666 |
667 int FtpNetworkTransaction::DoCtrlConnect() { | 667 int FtpNetworkTransaction::DoCtrlConnect() { |
668 next_state_ = STATE_CTRL_CONNECT_COMPLETE; | 668 next_state_ = STATE_CTRL_CONNECT_COMPLETE; |
669 ctrl_socket_ = socket_factory_->CreateTransportClientSocket( | 669 ctrl_socket_ = socket_factory_->CreateTransportClientSocket( |
670 addresses_, NULL, net_log_.net_log(), net_log_.source()); | 670 addresses_, NULL, net_log_.net_log(), net_log_.source()); |
| 671 ctrl_socket_->SetFailOnSuspend(true); |
671 net_log_.AddEvent( | 672 net_log_.AddEvent( |
672 NetLogEventType::FTP_CONTROL_CONNECTION, | 673 NetLogEventType::FTP_CONTROL_CONNECTION, |
673 ctrl_socket_->NetLog().source().ToEventParametersCallback()); | 674 ctrl_socket_->NetLog().source().ToEventParametersCallback()); |
674 return ctrl_socket_->Connect(io_callback_); | 675 return ctrl_socket_->Connect(io_callback_); |
675 } | 676 } |
676 | 677 |
677 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { | 678 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { |
678 if (result == OK) { | 679 if (result == OK) { |
679 // Put the peer's IP address and port into the response. | 680 // Put the peer's IP address and port into the response. |
680 IPEndPoint ip_endpoint; | 681 IPEndPoint ip_endpoint; |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 if (!had_error_type[type]) { | 1362 if (!had_error_type[type]) { |
1362 had_error_type[type] = true; | 1363 had_error_type[type] = true; |
1363 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", | 1364 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", |
1364 type, NUM_OF_NET_ERROR_TYPES); | 1365 type, NUM_OF_NET_ERROR_TYPES); |
1365 } | 1366 } |
1366 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", | 1367 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", |
1367 type, NUM_OF_NET_ERROR_TYPES); | 1368 type, NUM_OF_NET_ERROR_TYPES); |
1368 } | 1369 } |
1369 | 1370 |
1370 } // namespace net | 1371 } // namespace net |
OLD | NEW |