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

Unified Diff: chrome/browser/download/download_util.h

Issue 9316116: Isolate initiation counts for downloads to their own histograms and improve (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to LKGR. Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_resource_throttle.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.h
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 6df96e46bce3154890153569f2d26c8d227da0f9..a2cfc4e85a30fb10a532d7173fcef7aea574c46e 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -174,23 +174,51 @@ void RecordShelfClose(int size, int in_progress, bool autoclose);
// Used for counting UMA stats. Similar to content's
// download_stats::DownloadCountTypes but from the chrome layer.
enum ChromeDownloadCountTypes {
+ // A download *would* have been initiated, but it was blocked
+ // by the DownloadThrottlingResourceHandler.
+ BLOCKED_BY_THROTTLING = 0,
+
+ // The "= 2" is to get around a feature of the histogram system
+ // which puts a floor of 1 for the minimum value for enum histograms
+ // to allow there to be a bucket for values outside the expected range.
+ // This isn't ideal since many (possibly most) enum histograms start
+ // at zero, but there isn't any practical negative effect in UMA;
+ // the zero value just uses the underflow bucket. However, if
+ // a histogram only has one entry, it does result in a DCHECK because
+ // the maximum value of the histogram is greater than the minimum value.
+ // We solve this by bumping up the maximum value. This assignment
+ // can be removed if any entries are added to this enum in the
+ // future.
+ CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY = 2
+};
+
+// Used for counting UMA stats. Similar to content's
+// download_stats::DownloadInitiattionSources but from the chrome layer.
+enum ChromeDownloadSource {
// The download was initiated by navigating to a URL (e.g. by user click).
- INITIATED_BY_NAVIGATION_COUNT = 0,
+ INITIATED_BY_NAVIGATION = 0,
// The download was initiated by invoking a context menu within a page.
- INITIATED_BY_CONTEXT_MENU_COUNT,
+ INITIATED_BY_CONTEXT_MENU,
// The download was initiated by the WebStore installer.
- INITIATED_BY_WEBSTORE_INSTALLER_COUNT,
+ INITIATED_BY_WEBSTORE_INSTALLER,
// The download was initiated by the ImageBurner (cros).
- INITIATED_BY_IMAGE_BURNER_COUNT,
+ INITIATED_BY_IMAGE_BURNER,
- DOWNLOAD_COUNT_TYPES_LAST_ENTRY,
+ // The download was initiated by the plugin installer.
+ INITIATED_BY_PLUGIN_INSTALLER,
+
+ CHROME_DOWNLOAD_SOURCE_LAST_ENTRY,
};
+// Increment one of the above counts.
void RecordDownloadCount(ChromeDownloadCountTypes type);
+// Record initiation of a download from a specific source.
+void RecordDownloadSource(ChromeDownloadSource source);
+
} // namespace download_util
#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_
« no previous file with comments | « chrome/browser/download/download_resource_throttle.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698