Chromium Code Reviews| 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..36d98975e284feb299ccc6c46ec14fd3b2d2b5e4 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,33 @@ enum DownloadCountTypes { |
| DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
| }; |
| +enum DownloadInitiationSources { |
| + // The download was initiated when the SavePackage system rejected |
| + // a Save Page As ... by returning false from |
| + // SavePackage::IsSaveableContents(). |
|
cbentzel
2012/02/06 19:57:29
I don't love the name of "SAVE_PACKAGE_FAILURE" -
Randy Smith (Not in Mondays)
2012/02/07 18:20:18
Nah, you're right, and more to the point, I think
|
| + INITIATED_BY_SAVE_PACKAGE_FAILURE = 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. |
| + INITIATED_BY_RENDERER_SAVE, |
| + |
| + DOWNLOAD_INITIATION_SOURCES_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(DownloadInitiationSources source); |
| // Record COMPLETED_COUNT and how long the download took. |
| void RecordDownloadCompleted(const base::TimeTicks& start, int64 download_len); |