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

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

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/disk_cache/entry_unittest.cc ('k') | net/http/disk_cache_based_quic_server_info.cc » ('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.h" 10 #include "base/metrics/histogram.h"
11 #include "base/profiler/scoped_tracker.h"
11 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
13 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
14 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
15 #include "base/values.h" 16 #include "base/values.h"
16 #include "net/base/address_list.h" 17 #include "net/base/address_list.h"
17 #include "net/base/connection_type_histograms.h" 18 #include "net/base/connection_type_histograms.h"
18 #include "net/base/escape.h" 19 #include "net/base/escape.h"
19 #include "net/base/net_errors.h" 20 #include "net/base/net_errors.h"
20 #include "net/base/net_log.h" 21 #include "net/base/net_log.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 DCHECK(rv != ERR_IO_PENDING); 366 DCHECK(rv != ERR_IO_PENDING);
366 DCHECK(!user_callback_.is_null()); 367 DCHECK(!user_callback_.is_null());
367 368
368 // Since Run may result in Read being called, clear callback_ up front. 369 // Since Run may result in Read being called, clear callback_ up front.
369 CompletionCallback c = user_callback_; 370 CompletionCallback c = user_callback_;
370 user_callback_.Reset(); 371 user_callback_.Reset();
371 c.Run(rv); 372 c.Run(rv);
372 } 373 }
373 374
374 void FtpNetworkTransaction::OnIOComplete(int result) { 375 void FtpNetworkTransaction::OnIOComplete(int result) {
376 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed.
377 tracked_objects::ScopedTracker tracking_profile(
378 FROM_HERE_WITH_EXPLICIT_FUNCTION(
379 "436634 FtpNetworkTransaction::OnIOComplete"));
380
375 int rv = DoLoop(result); 381 int rv = DoLoop(result);
376 if (rv != ERR_IO_PENDING) 382 if (rv != ERR_IO_PENDING)
377 DoCallback(rv); 383 DoCallback(rv);
378 } 384 }
379 385
380 int FtpNetworkTransaction::ProcessCtrlResponse() { 386 int FtpNetworkTransaction::ProcessCtrlResponse() {
381 FtpCtrlResponse response = ctrl_response_buffer_->PopResponse(); 387 FtpCtrlResponse response = ctrl_response_buffer_->PopResponse();
382 388
383 int rv = OK; 389 int rv = OK;
384 switch (command_sent_) { 390 switch (command_sent_) {
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 if (!had_error_type[type]) { 1403 if (!had_error_type[type]) {
1398 had_error_type[type] = true; 1404 had_error_type[type] = true;
1399 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1405 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1400 type, NUM_OF_NET_ERROR_TYPES); 1406 type, NUM_OF_NET_ERROR_TYPES);
1401 } 1407 }
1402 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1408 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1403 type, NUM_OF_NET_ERROR_TYPES); 1409 type, NUM_OF_NET_ERROR_TYPES);
1404 } 1410 }
1405 1411
1406 } // namespace net 1412 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/http/disk_cache_based_quic_server_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698