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

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

Issue 8549004: base::Bind: Convert HostResolver::Resolve. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/dns/async_host_resolver_unittest.cc ('k') | net/http/http_auth_handler_negotiate.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
8 #include "base/bind_helpers.h"
7 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
8 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
9 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
10 #include "base/string_split.h" 12 #include "base/string_split.h"
11 #include "base/string_util.h" 13 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
13 #include "net/base/address_list.h" 15 #include "net/base/address_list.h"
14 #include "net/base/connection_type_histograms.h" 16 #include "net/base/connection_type_histograms.h"
15 #include "net/base/escape.h" 17 #include "net/base/escape.h"
16 #include "net/base/net_errors.h" 18 #include "net/base/net_errors.h"
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 } 622 }
621 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); 623 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
622 return rv; 624 return rv;
623 } 625 }
624 626
625 int FtpNetworkTransaction::DoCtrlResolveHost() { 627 int FtpNetworkTransaction::DoCtrlResolveHost() {
626 next_state_ = STATE_CTRL_RESOLVE_HOST_COMPLETE; 628 next_state_ = STATE_CTRL_RESOLVE_HOST_COMPLETE;
627 629
628 HostResolver::RequestInfo info(HostPortPair::FromURL(request_->url)); 630 HostResolver::RequestInfo info(HostPortPair::FromURL(request_->url));
629 // No known referrer. 631 // No known referrer.
630 return resolver_.Resolve(info, &addresses_, &io_callback_, net_log_); 632 return resolver_.Resolve(
633 info, &addresses_,
634 base::Bind(&FtpNetworkTransaction::OnIOComplete, base::Unretained(this)),
635 net_log_);
631 } 636 }
632 637
633 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { 638 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) {
634 if (result == OK) 639 if (result == OK)
635 next_state_ = STATE_CTRL_CONNECT; 640 next_state_ = STATE_CTRL_CONNECT;
636 return result; 641 return result;
637 } 642 }
638 643
639 int FtpNetworkTransaction::DoCtrlConnect() { 644 int FtpNetworkTransaction::DoCtrlConnect() {
640 next_state_ = STATE_CTRL_CONNECT_COMPLETE; 645 next_state_ = STATE_CTRL_CONNECT_COMPLETE;
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 if (!had_error_type[type]) { 1337 if (!had_error_type[type]) {
1333 had_error_type[type] = true; 1338 had_error_type[type] = true;
1334 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1339 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1335 type, NUM_OF_NET_ERROR_TYPES); 1340 type, NUM_OF_NET_ERROR_TYPES);
1336 } 1341 }
1337 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1342 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1338 type, NUM_OF_NET_ERROR_TYPES); 1343 type, NUM_OF_NET_ERROR_TYPES);
1339 } 1344 }
1340 1345
1341 } // namespace net 1346 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/async_host_resolver_unittest.cc ('k') | net/http/http_auth_handler_negotiate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698