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 // Holds helpers for gathering UMA stats about downloads. | 5 // Holds helpers for gathering UMA stats about downloads. |
6 | 6 |
7 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 7 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
8 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 8 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Downloads that were interrupted by the OS. | 57 // Downloads that were interrupted by the OS. |
58 INTERRUPTED_COUNT, | 58 INTERRUPTED_COUNT, |
59 | 59 |
60 // Write sizes for downloads. | 60 // Write sizes for downloads. |
61 WRITE_SIZE_COUNT, | 61 WRITE_SIZE_COUNT, |
62 | 62 |
63 // Counts iterations of the BaseFile::AppendDataToFile() loop. | 63 // Counts iterations of the BaseFile::AppendDataToFile() loop. |
64 WRITE_LOOP_COUNT, | 64 WRITE_LOOP_COUNT, |
65 | 65 |
| 66 // Downloads that were removed by the user. |
| 67 REMOVED_COUNT, |
| 68 |
66 DOWNLOAD_COUNT_TYPES_LAST_ENTRY | 69 DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
67 }; | 70 }; |
68 | 71 |
69 // Increment one of the above counts. | 72 // Increment one of the above counts. |
70 void RecordDownloadCount(DownloadCountTypes type); | 73 void RecordDownloadCount(DownloadCountTypes type); |
71 | 74 |
72 // Record COMPLETED_COUNT and how long the download took. | 75 // Record COMPLETED_COUNT and how long the download took. |
73 void RecordDownloadCompleted(const base::TimeTicks& start, int64 download_len); | 76 void RecordDownloadCompleted(const base::TimeTicks& start, int64 download_len); |
74 | 77 |
75 // Record INTERRUPTED_COUNT, |error|, |received| and |total| bytes. | 78 // Record INTERRUPTED_COUNT, |error|, |received| and |total| bytes. |
76 void RecordDownloadInterrupted(int error, int64 received, int64 total); | 79 void RecordDownloadInterrupted(int error, int64 received, int64 total); |
77 | 80 |
78 // Records the mime type of the download. | 81 // Records the mime type of the download. |
79 void RecordDownloadMimeType(const std::string& mime_type); | 82 void RecordDownloadMimeType(const std::string& mime_type); |
80 | 83 |
81 // Record WRITE_SIZE_COUNT and data_len. | 84 // Record WRITE_SIZE_COUNT and data_len. |
82 void RecordDownloadWriteSize(size_t data_len); | 85 void RecordDownloadWriteSize(size_t data_len); |
83 | 86 |
84 // Record WRITE_LOOP_COUNT and number of loops. | 87 // Record WRITE_LOOP_COUNT and number of loops. |
85 void RecordDownloadWriteLoopCount(int count); | 88 void RecordDownloadWriteLoopCount(int count); |
86 | 89 |
87 } // namespace download_stats | 90 } // namespace download_stats |
88 | 91 |
89 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 92 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
OLD | NEW |