Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: net/ftp/ftp_network_transaction.cc

Issue 2447083003: Move fail on suspend logic from URLRequestJob to TcpClientSocket.
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/socket/stream_socket.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/socket/stream_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698