OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Download utilities. | 5 // Download utilities. |
6 | 6 |
7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 // Downloads that are cancelled before completion (user action or error). | 159 // Downloads that are cancelled before completion (user action or error). |
160 CANCELLED_COUNT, | 160 CANCELLED_COUNT, |
161 | 161 |
162 // Downloads that are started. Should be equal to UNTHROTTLED_COUNT. | 162 // Downloads that are started. Should be equal to UNTHROTTLED_COUNT. |
163 START_COUNT, | 163 START_COUNT, |
164 | 164 |
165 // Downloads that were interrupted by the OS. | 165 // Downloads that were interrupted by the OS. |
166 INTERRUPTED_COUNT, | 166 INTERRUPTED_COUNT, |
167 | 167 |
| 168 // Downloads that were removed by the user. |
| 169 REMOVED_COUNT, |
| 170 |
168 DOWNLOAD_COUNT_TYPES_LAST_ENTRY | 171 DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
169 }; | 172 }; |
170 | 173 |
171 // Increment one of the above counts. | 174 // Increment one of the above counts. |
172 void RecordDownloadCount(DownloadCountTypes type); | 175 void RecordDownloadCount(DownloadCountTypes type); |
173 | 176 |
174 // Record COMPLETED_COUNT and how long the download took. | 177 // Record COMPLETED_COUNT and how long the download took. |
175 void RecordDownloadCompleted(const base::TimeTicks& start); | 178 void RecordDownloadCompleted(const base::TimeTicks& start); |
176 | 179 |
177 // Record INTERRUPTED_COUNT, |error|, |received| and |total| bytes. | 180 // Record INTERRUPTED_COUNT, |error|, |received| and |total| bytes. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // Erases all downloaded files with the specified path and name prefix. | 276 // Erases all downloaded files with the specified path and name prefix. |
274 // Used by download UI tests to clean up the download directory. | 277 // Used by download UI tests to clean up the download directory. |
275 void EraseUniqueDownloadFiles(const FilePath& path_prefix); | 278 void EraseUniqueDownloadFiles(const FilePath& path_prefix); |
276 | 279 |
277 // Returns a .crdownload intermediate path for the |suggested_path|. | 280 // Returns a .crdownload intermediate path for the |suggested_path|. |
278 FilePath GetCrDownloadPath(const FilePath& suggested_path); | 281 FilePath GetCrDownloadPath(const FilePath& suggested_path); |
279 | 282 |
280 } // namespace download_util | 283 } // namespace download_util |
281 | 284 |
282 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 285 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
OLD | NEW |