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