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 0c4a5be726edf4de5dd19f07118aec46ae9dce35..1be9ff14661882d07ec9a5a8c7379863216eb66b 100644 |
| --- a/content/browser/download/download_stats.h |
| +++ b/content/browser/download/download_stats.h |
| @@ -145,6 +145,38 @@ enum DownloadDiscardReason { |
| DOWNLOAD_DISCARD_DUE_TO_SHUTDOWN |
| }; |
| +// When parallel download is enabled, the download may fall back to a normal |
| +// download for various reasons. This enum counts the number of parallel |
| +// download and fallbacks. Also records the reasons why the download falls back |
| +// to a normal download. The reasons are not mutually exclusive. |
| +// Used in histogram "Download.ParallelDownload.CreationEvent". |
|
Ilya Sherman
2017/04/10 21:54:15
nit: Please also document that "and therefore, sho
xingliu
2017/04/10 22:07:12
Done,
sorry I probably forgot this one.
|
| +enum class ParallelDownloadCreationEvent { |
| + // The total number of downloads started as parallel download. |
| + STARTED_PARALLEL_DOWNLOAD = 0, |
| + |
| + // The total number of downloads fell back to normal download when parallel |
| + // download is enabled. |
| + FELL_BACK_TO_NORMAL_DOWNLOAD, |
| + |
| + // No ETag or Last-Modified response header. |
| + FALLBACK_REASON_STRONG_VALIDATORS, |
| + |
| + // No Accept-Range response header. |
| + FALLBACK_REASON_ACCEPT_RANGE_HEADER, |
| + |
| + // No Content-Length response header. |
| + FALLBACK_REASON_CONTENT_LENGTH_HEADER, |
| + |
| + // File size is not complied to finch configuration. |
| + FALLBACK_REASON_FILE_SIZE, |
| + |
| + // The HTTP connection type does not meet the requirement. |
| + FALLBACK_REASON_CONNECTION_TYPE, |
| + |
| + // Last entry of the enum. |
| + COUNT, |
| +}; |
| + |
| // Increment one of the above counts. |
| void RecordDownloadCount(DownloadCountTypes type); |
| @@ -236,6 +268,10 @@ void RecordParallelDownloadStats( |
| size_t bytes_downloaded_without_parallel_streams, |
| base::TimeDelta time_without_parallel_streams); |
| +// Records the parallel download creation counts and the reasons why the |
| +// download falls back to non-parallel download. |
| +void RecordParallelDownloadCreationEvent(ParallelDownloadCreationEvent event); |
| + |
| // Record the result of a download file rename. |
| void RecordDownloadFileRenameResultAfterRetry( |
| base::TimeDelta time_since_first_failure, |