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..d6d8c9d9a9a713b604185378625d2107b66f9dff 100644 |
| --- a/content/browser/download/download_stats.h |
| +++ b/content/browser/download/download_stats.h |
| @@ -145,6 +145,18 @@ enum DownloadDiscardReason { |
| DOWNLOAD_DISCARD_DUE_TO_SHUTDOWN |
| }; |
| +// The reason why parallel download is not applicable and fallbacks to a |
| +// non-parallel download. |
| +enum ParallelDownloadFailReason { |
|
Ilya Sherman
2017/04/07 22:13:08
nit: Could this be an enum class?
xingliu
2017/04/08 01:13:28
Done.
|
| + STRONG_VALIDATORS = 0, |
| + ACCEPT_RANGE_HEADER, |
| + CONTENT_LENGTH_HEADER, |
| + FILE_SIZE, |
| + CONNECTION_TYPE, |
| + FAIL_COUNT, |
|
Ilya Sherman
2017/04/07 22:13:08
What does "FAIL_COUNT" mean? "EXCEEDED_MAX_ALLOWE
xingliu
2017/04/08 01:13:28
Changed to FALLBACK_TO_NORMAL_DOWNLOAD_COUNT.
|
| + MAX_COUNT, |
|
Ilya Sherman
2017/04/07 22:13:08
nit: I find "MAX_COUNT" to be a confusing name. C
xingliu
2017/04/08 01:13:28
Done. Reworked the naming and the comments.
|
| +}; |
| + |
| // Increment one of the above counts. |
| void RecordDownloadCount(DownloadCountTypes type); |
| @@ -236,6 +248,9 @@ void RecordParallelDownloadStats( |
| size_t bytes_downloaded_without_parallel_streams, |
| base::TimeDelta time_without_parallel_streams); |
| +// Records the reason why the download is not created as parallel download. |
| +void RecordParallelDownloadFailReason(ParallelDownloadFailReason reason); |
|
qinmin
2017/04/07 21:00:52
This sounds more like a download failed. what abou
xingliu
2017/04/08 01:13:27
Done.
|
| + |
| // Record the result of a download file rename. |
| void RecordDownloadFileRenameResultAfterRetry( |
| base::TimeDelta time_since_first_failure, |