OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // Downloads that made it to DownloadResourceHandler | 43 // Downloads that made it to DownloadResourceHandler |
44 UNTHROTTLED_COUNT, | 44 UNTHROTTLED_COUNT, |
45 | 45 |
46 // Downloads that actually complete. | 46 // Downloads that actually complete. |
47 COMPLETED_COUNT, | 47 COMPLETED_COUNT, |
48 | 48 |
49 // Downloads that are cancelled before completion (user action or error). | 49 // Downloads that are cancelled before completion (user action or error). |
50 CANCELLED_COUNT, | 50 CANCELLED_COUNT, |
51 | 51 |
52 // Downloads that are started. Should be equal to UNTHROTTLED_COUNT. | 52 // Downloads that are started. |
53 START_COUNT, | 53 START_COUNT, |
54 | 54 |
55 // Downloads that were interrupted by the OS. | 55 // Downloads that were interrupted by the OS. |
56 INTERRUPTED_COUNT, | 56 INTERRUPTED_COUNT, |
57 | 57 |
58 // (Deprecated) Write sizes for downloads. | 58 // (Deprecated) Write sizes for downloads. |
59 // This is equal to the number of samples in Download.WriteSize histogram. | 59 // This is equal to the number of samples in Download.WriteSize histogram. |
60 DOWNLOAD_COUNT_UNUSED_10, | 60 DOWNLOAD_COUNT_UNUSED_10, |
61 | 61 |
62 // (Deprecated) Counts iterations of the BaseFile::AppendDataToFile() loop. | 62 // (Deprecated) Counts iterations of the BaseFile::AppendDataToFile() loop. |
(...skipping 24 matching lines...) Expand all Loading... |
87 INTERRUPTED_WITHOUT_WEBCONTENTS, | 87 INTERRUPTED_WITHOUT_WEBCONTENTS, |
88 | 88 |
89 // Count of downloads that supplies a strong validator (implying byte-wise | 89 // Count of downloads that supplies a strong validator (implying byte-wise |
90 // equivalence) and has a 'Accept-Ranges: bytes' header. These downloads are | 90 // equivalence) and has a 'Accept-Ranges: bytes' header. These downloads are |
91 // candidates for partial resumption. | 91 // candidates for partial resumption. |
92 STRONG_VALIDATOR_AND_ACCEPTS_RANGES, | 92 STRONG_VALIDATOR_AND_ACCEPTS_RANGES, |
93 | 93 |
94 // Count of downloads that uses parallel download requests. | 94 // Count of downloads that uses parallel download requests. |
95 USES_PARALLEL_REQUESTS, | 95 USES_PARALLEL_REQUESTS, |
96 | 96 |
| 97 // Downloads that are started in normal profile. |
| 98 START_COUNT_NORMAL_PROFILE, |
| 99 |
| 100 // Downloads that are actually completed in normal profile. |
| 101 COMPLETED_COUNT_NORMAL_PROFILE, |
| 102 |
97 DOWNLOAD_COUNT_TYPES_LAST_ENTRY | 103 DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
98 }; | 104 }; |
99 | 105 |
100 enum DownloadSource { | 106 enum DownloadSource { |
101 // The download was initiated when the SavePackage system rejected | 107 // The download was initiated when the SavePackage system rejected |
102 // a Save Page As ... by returning false from | 108 // a Save Page As ... by returning false from |
103 // SavePackage::IsSaveableContents(). | 109 // SavePackage::IsSaveableContents(). |
104 INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0, | 110 INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0, |
105 | 111 |
106 // The download was initiated by a drag and drop from a drag-and-drop | 112 // The download was initiated by a drag and drop from a drag-and-drop |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 167 |
162 // Record a dangerous download discard event. | 168 // Record a dangerous download discard event. |
163 void RecordDangerousDownloadDiscard( | 169 void RecordDangerousDownloadDiscard( |
164 DownloadDiscardReason reason, | 170 DownloadDiscardReason reason, |
165 DownloadDangerType danger_type, | 171 DownloadDangerType danger_type, |
166 const base::FilePath& file_path); | 172 const base::FilePath& file_path); |
167 | 173 |
168 // Records the mime type of the download. | 174 // Records the mime type of the download. |
169 void RecordDownloadMimeType(const std::string& mime_type); | 175 void RecordDownloadMimeType(const std::string& mime_type); |
170 | 176 |
| 177 // Records the mime type of the download for normal profile. |
| 178 void RecordDownloadMimeTypeForNormalProfile(const std::string& mime_type); |
| 179 |
171 // Records usage of Content-Disposition header. | 180 // Records usage of Content-Disposition header. |
172 void RecordDownloadContentDisposition(const std::string& content_disposition); | 181 void RecordDownloadContentDisposition(const std::string& content_disposition); |
173 | 182 |
174 // Record the number of buffers piled up by the IO thread | 183 // Record the number of buffers piled up by the IO thread |
175 // before the file thread gets to draining them. | 184 // before the file thread gets to draining them. |
176 void RecordFileThreadReceiveBuffers(size_t num_buffers); | 185 void RecordFileThreadReceiveBuffers(size_t num_buffers); |
177 | 186 |
178 // Record the time of both the first open and all subsequent opens since the | 187 // Record the time of both the first open and all subsequent opens since the |
179 // download completed. | 188 // download completed. |
180 void RecordOpen(const base::Time& end, bool first); | 189 void RecordOpen(const base::Time& end, bool first); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 263 |
255 void RecordDownloadConnectionSecurity(const GURL& download_url, | 264 void RecordDownloadConnectionSecurity(const GURL& download_url, |
256 const std::vector<GURL>& url_chain); | 265 const std::vector<GURL>& url_chain); |
257 | 266 |
258 void RecordDownloadSourcePageTransitionType( | 267 void RecordDownloadSourcePageTransitionType( |
259 const base::Optional<ui::PageTransition>& transition); | 268 const base::Optional<ui::PageTransition>& transition); |
260 | 269 |
261 } // namespace content | 270 } // namespace content |
262 | 271 |
263 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 272 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
OLD | NEW |