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

Unified Diff: content/browser/download/download_stats.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: Restored curlies to original. 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
Index: content/browser/download/download_stats.h
diff --git a/content/browser/download/download_stats.h b/content/browser/download/download_stats.h
index ecf87f30f9e1172a8a45a4cb03146e2cd9b8b3c0..f9f244b8573a3e43331f023f9ddb9b2d10c0e3fd 100644
--- a/content/browser/download/download_stats.h
+++ b/content/browser/download/download_stats.h
@@ -24,30 +24,15 @@ namespace download_stats {
// We keep a count of how often various events occur in the
// histogram "Download.Counts".
enum DownloadCountTypes {
- // The download was initiated by navigating to a URL (e.g. by user
- // click).
- // This is now unused, but left around so that the values don't change.
- INITIATED_BY_NAVIGATION_COUNT = 0,
-
- // The download was initiated by invoking a context menu within a page.
- // This is now unused, but left around so that the values don't change.
- INITIATED_BY_CONTEXT_MENU_COUNT,
-
- // The download was initiated when the SavePackage system rejected
- // a Save Page As ... by returning false from
- // SavePackage::IsSaveableContents().
- INITIATED_BY_SAVE_PACKAGE_FAILURE_COUNT,
-
- // The download was initiated by a drag and drop from a drag-and-drop
- // enabled web application.
- INITIATED_BY_DRAG_N_DROP_COUNT,
-
- // The download was initiated by explicit RPC from the renderer process
- // (e.g. by Alt-click).
- INITIATED_BY_RENDERER_COUNT,
-
- // Downloads that made it to DownloadResourceHandler -- all of the
- // above minus those blocked by DownloadThrottlingResourceHandler.
+ // Stale enum values left around so that values passed to UMA don't
+ // change.
+ DOWNLOAD_COUNT_UNUSED_0 = 0,
+ DOWNLOAD_COUNT_UNUSED_1,
+ DOWNLOAD_COUNT_UNUSED_2,
+ DOWNLOAD_COUNT_UNUSED_3,
+ DOWNLOAD_COUNT_UNUSED_4,
+
+ // Downloads that made it to DownloadResourceHandler
UNTHROTTLED_COUNT,
// Downloads that actually complete.
@@ -81,8 +66,34 @@ enum DownloadCountTypes {
DOWNLOAD_COUNT_TYPES_LAST_ENTRY
};
+enum DownloadSource {
+ // The download was initiated when the SavePackage system rejected
+ // a Save Page As ... by returning false from
+ // SavePackage::IsSaveableContents().
+ INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0,
+
+ // The download was initiated by a drag and drop from a drag-and-drop
+ // enabled web application.
+ INITIATED_BY_DRAG_N_DROP,
+
+ // The download was initiated by explicit RPC from the renderer process
+ // (e.g. by Alt-click) through the IPC ViewHostMsg_DownloadUrl.
+ INITIATED_BY_RENDERER,
+
+ // The download was initiated by a renderer or plugin process through
+ // the IPC ViewHostMsg_SaveURLAs; currently this is only used by the
+ // Pepper plugin API.
+ INITIATED_BY_PEPPER_SAVE,
+
+ DOWNLOAD_SOURCE_LAST_ENTRY
+};
+
+
// Increment one of the above counts.
-CONTENT_EXPORT void RecordDownloadCount(DownloadCountTypes type);
+void RecordDownloadCount(DownloadCountTypes type);
+
+// Record initiation of a download from a specific source.
+void RecordDownloadSource(DownloadSource source);
// Record COMPLETED_COUNT and how long the download took.
void RecordDownloadCompleted(const base::TimeTicks& start, int64 download_len);

Powered by Google App Engine
This is Rietveld 408576698