| 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { | 648 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { |
| 649 if (result == OK) | 649 if (result == OK) |
| 650 next_state_ = STATE_CTRL_CONNECT; | 650 next_state_ = STATE_CTRL_CONNECT; |
| 651 return result; | 651 return result; |
| 652 } | 652 } |
| 653 | 653 |
| 654 int FtpNetworkTransaction::DoCtrlConnect() { | 654 int FtpNetworkTransaction::DoCtrlConnect() { |
| 655 next_state_ = STATE_CTRL_CONNECT_COMPLETE; | 655 next_state_ = STATE_CTRL_CONNECT_COMPLETE; |
| 656 ctrl_socket_ = socket_factory_->CreateTransportClientSocket( | 656 ctrl_socket_ = socket_factory_->CreateTransportClientSocket( |
| 657 addresses_, NULL, net_log_.net_log(), net_log_.source()); | 657 addresses_, NULL, net_log_.net_log(), net_log_.source()); |
| 658 ctrl_socket_->SetFailOnSuspend(true); |
| 658 net_log_.AddEvent( | 659 net_log_.AddEvent( |
| 659 NetLogEventType::FTP_CONTROL_CONNECTION, | 660 NetLogEventType::FTP_CONTROL_CONNECTION, |
| 660 ctrl_socket_->NetLog().source().ToEventParametersCallback()); | 661 ctrl_socket_->NetLog().source().ToEventParametersCallback()); |
| 661 return ctrl_socket_->Connect(io_callback_); | 662 return ctrl_socket_->Connect(io_callback_); |
| 662 } | 663 } |
| 663 | 664 |
| 664 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { | 665 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { |
| 665 if (result == OK) { | 666 if (result == OK) { |
| 666 // Put the peer's IP address and port into the response. | 667 // Put the peer's IP address and port into the response. |
| 667 IPEndPoint ip_endpoint; | 668 IPEndPoint ip_endpoint; |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 if (!had_error_type[type]) { | 1373 if (!had_error_type[type]) { |
| 1373 had_error_type[type] = true; | 1374 had_error_type[type] = true; |
| 1374 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", | 1375 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", |
| 1375 type, NUM_OF_NET_ERROR_TYPES); | 1376 type, NUM_OF_NET_ERROR_TYPES); |
| 1376 } | 1377 } |
| 1377 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", | 1378 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", |
| 1378 type, NUM_OF_NET_ERROR_TYPES); | 1379 type, NUM_OF_NET_ERROR_TYPES); |
| 1379 } | 1380 } |
| 1380 | 1381 |
| 1381 } // namespace net | 1382 } // namespace net |
| OLD | NEW |