| 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 // Count of new downloads. |
| 98 NEW_DOWNLOAD_COUNT, |
| 99 |
| 100 // Count of new downloads that are started in normal profile. |
| 101 NEW_DOWNLOAD_COUNT_NORMAL_PROFILE, |
| 102 |
| 103 // Downloads that are actually completed in normal profile. |
| 104 COMPLETED_COUNT_NORMAL_PROFILE, |
| 105 |
| 97 DOWNLOAD_COUNT_TYPES_LAST_ENTRY | 106 DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
| 98 }; | 107 }; |
| 99 | 108 |
| 100 enum DownloadSource { | 109 enum DownloadSource { |
| 101 // The download was initiated when the SavePackage system rejected | 110 // The download was initiated when the SavePackage system rejected |
| 102 // a Save Page As ... by returning false from | 111 // a Save Page As ... by returning false from |
| 103 // SavePackage::IsSaveableContents(). | 112 // SavePackage::IsSaveableContents(). |
| 104 INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0, | 113 INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0, |
| 105 | 114 |
| 106 // The download was initiated by a drag and drop from a drag-and-drop | 115 // 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 | 170 |
| 162 // Record a dangerous download discard event. | 171 // Record a dangerous download discard event. |
| 163 void RecordDangerousDownloadDiscard( | 172 void RecordDangerousDownloadDiscard( |
| 164 DownloadDiscardReason reason, | 173 DownloadDiscardReason reason, |
| 165 DownloadDangerType danger_type, | 174 DownloadDangerType danger_type, |
| 166 const base::FilePath& file_path); | 175 const base::FilePath& file_path); |
| 167 | 176 |
| 168 // Records the mime type of the download. | 177 // Records the mime type of the download. |
| 169 void RecordDownloadMimeType(const std::string& mime_type); | 178 void RecordDownloadMimeType(const std::string& mime_type); |
| 170 | 179 |
| 180 // Records the mime type of the download for normal profile. |
| 181 void RecordDownloadMimeTypeForNormalProfile(const std::string& mime_type); |
| 182 |
| 171 // Records usage of Content-Disposition header. | 183 // Records usage of Content-Disposition header. |
| 172 void RecordDownloadContentDisposition(const std::string& content_disposition); | 184 void RecordDownloadContentDisposition(const std::string& content_disposition); |
| 173 | 185 |
| 174 // Record the number of buffers piled up by the IO thread | 186 // Record the number of buffers piled up by the IO thread |
| 175 // before the file thread gets to draining them. | 187 // before the file thread gets to draining them. |
| 176 void RecordFileThreadReceiveBuffers(size_t num_buffers); | 188 void RecordFileThreadReceiveBuffers(size_t num_buffers); |
| 177 | 189 |
| 178 // Record the time of both the first open and all subsequent opens since the | 190 // Record the time of both the first open and all subsequent opens since the |
| 179 // download completed. | 191 // download completed. |
| 180 void RecordOpen(const base::Time& end, bool first); | 192 void RecordOpen(const base::Time& end, bool first); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 266 |
| 255 void RecordDownloadConnectionSecurity(const GURL& download_url, | 267 void RecordDownloadConnectionSecurity(const GURL& download_url, |
| 256 const std::vector<GURL>& url_chain); | 268 const std::vector<GURL>& url_chain); |
| 257 | 269 |
| 258 void RecordDownloadSourcePageTransitionType( | 270 void RecordDownloadSourcePageTransitionType( |
| 259 const base::Optional<ui::PageTransition>& transition); | 271 const base::Optional<ui::PageTransition>& transition); |
| 260 | 272 |
| 261 } // namespace content | 273 } // namespace content |
| 262 | 274 |
| 263 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 275 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
| OLD | NEW |