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

Side by Side Diff: content/browser/download/download_stats.cc

Issue 2593183002: [downloads] Remove DownloadManager::RemoveAllDownloads. (Closed)
Patch Set: Fix SavePageBrowsertest Created 3 years, 12 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 | « content/browser/download/download_stats.h ('k') | content/public/browser/download_manager.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 "content/browser/download/download_stats.h" 5 #include "content/browser/download/download_stats.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 void RecordOpen(const base::Time& end, bool first) { 686 void RecordOpen(const base::Time& end, bool first) {
687 if (!end.is_null()) { 687 if (!end.is_null()) {
688 UMA_HISTOGRAM_LONG_TIMES("Download.OpenTime", (base::Time::Now() - end)); 688 UMA_HISTOGRAM_LONG_TIMES("Download.OpenTime", (base::Time::Now() - end));
689 if (first) { 689 if (first) {
690 UMA_HISTOGRAM_LONG_TIMES("Download.FirstOpenTime", 690 UMA_HISTOGRAM_LONG_TIMES("Download.FirstOpenTime",
691 (base::Time::Now() - end)); 691 (base::Time::Now() - end));
692 } 692 }
693 } 693 }
694 } 694 }
695 695
696 void RecordClearAllSize(int size) {
697 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.ClearAllSize",
698 size,
699 1/*min*/,
700 (1 << 10)/*max*/,
701 32/*num_buckets*/);
702 }
703
704 void RecordOpensOutstanding(int size) { 696 void RecordOpensOutstanding(int size) {
705 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding", 697 UMA_HISTOGRAM_CUSTOM_COUNTS("Download.OpensOutstanding",
706 size, 698 size,
707 1/*min*/, 699 1/*min*/,
708 (1 << 10)/*max*/, 700 (1 << 10)/*max*/,
709 64/*num_buckets*/); 701 64/*num_buckets*/);
710 } 702 }
711 703
712 void RecordContiguousWriteTime(base::TimeDelta time_blocked) { 704 void RecordContiguousWriteTime(base::TimeDelta time_blocked) {
713 UMA_HISTOGRAM_TIMES("Download.FileThreadBlockedTime", time_blocked); 705 UMA_HISTOGRAM_TIMES("Download.FileThreadBlockedTime", time_blocked);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 : DOWNLOAD_REDIRECT_INSECURE 805 : DOWNLOAD_REDIRECT_INSECURE
814 : is_redirect_chain_secure ? DOWNLOAD_TARGET_INSECURE 806 : is_redirect_chain_secure ? DOWNLOAD_TARGET_INSECURE
815 : DOWNLOAD_REDIRECT_TARGET_INSECURE; 807 : DOWNLOAD_REDIRECT_TARGET_INSECURE;
816 } 808 }
817 809
818 UMA_HISTOGRAM_ENUMERATION("Download.TargetConnectionSecurity", state, 810 UMA_HISTOGRAM_ENUMERATION("Download.TargetConnectionSecurity", state,
819 DOWNLOAD_CONNECTION_SECURITY_MAX); 811 DOWNLOAD_CONNECTION_SECURITY_MAX);
820 } 812 }
821 813
822 } // namespace content 814 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_stats.h ('k') | content/public/browser/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698