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.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/profiler/scoped_tracker.h" | |
12 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
14 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
16 #include "base/values.h" | 15 #include "base/values.h" |
17 #include "net/base/address_list.h" | 16 #include "net/base/address_list.h" |
18 #include "net/base/connection_type_histograms.h" | 17 #include "net/base/connection_type_histograms.h" |
19 #include "net/base/escape.h" | 18 #include "net/base/escape.h" |
20 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
21 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 DCHECK(rv != ERR_IO_PENDING); | 354 DCHECK(rv != ERR_IO_PENDING); |
356 DCHECK(!user_callback_.is_null()); | 355 DCHECK(!user_callback_.is_null()); |
357 | 356 |
358 // Since Run may result in Read being called, clear callback_ up front. | 357 // Since Run may result in Read being called, clear callback_ up front. |
359 CompletionCallback c = user_callback_; | 358 CompletionCallback c = user_callback_; |
360 user_callback_.Reset(); | 359 user_callback_.Reset(); |
361 c.Run(rv); | 360 c.Run(rv); |
362 } | 361 } |
363 | 362 |
364 void FtpNetworkTransaction::OnIOComplete(int result) { | 363 void FtpNetworkTransaction::OnIOComplete(int result) { |
365 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. | |
366 tracked_objects::ScopedTracker tracking_profile( | |
367 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
368 "436634 FtpNetworkTransaction::OnIOComplete")); | |
369 | |
370 int rv = DoLoop(result); | 364 int rv = DoLoop(result); |
371 if (rv != ERR_IO_PENDING) | 365 if (rv != ERR_IO_PENDING) |
372 DoCallback(rv); | 366 DoCallback(rv); |
373 } | 367 } |
374 | 368 |
375 int FtpNetworkTransaction::ProcessCtrlResponse() { | 369 int FtpNetworkTransaction::ProcessCtrlResponse() { |
376 FtpCtrlResponse response = ctrl_response_buffer_->PopResponse(); | 370 FtpCtrlResponse response = ctrl_response_buffer_->PopResponse(); |
377 | 371 |
378 int rv = OK; | 372 int rv = OK; |
379 switch (command_sent_) { | 373 switch (command_sent_) { |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 if (!had_error_type[type]) { | 1369 if (!had_error_type[type]) { |
1376 had_error_type[type] = true; | 1370 had_error_type[type] = true; |
1377 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", | 1371 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", |
1378 type, NUM_OF_NET_ERROR_TYPES); | 1372 type, NUM_OF_NET_ERROR_TYPES); |
1379 } | 1373 } |
1380 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", | 1374 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", |
1381 type, NUM_OF_NET_ERROR_TYPES); | 1375 type, NUM_OF_NET_ERROR_TYPES); |
1382 } | 1376 } |
1383 | 1377 |
1384 } // namespace net | 1378 } // namespace net |
OLD | NEW |