| 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 21 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 // Count of downloads that didn't have a valid WebContents at the time it was | 85 // Count of downloads that didn't have a valid WebContents at the time it was |
| 86 // interrupted. | 86 // interrupted. |
| 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 // Downloads that are started in normal profile. |
| 95 START_COUNT_NORMAL_PROFILE, |
| 96 |
| 97 // Downloads that are actually completed in normal profile. |
| 98 COMPLETED_COUNT_NORMAL_PROFILE, |
| 99 |
| 94 DOWNLOAD_COUNT_TYPES_LAST_ENTRY | 100 DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
| 95 }; | 101 }; |
| 96 | 102 |
| 97 enum DownloadSource { | 103 enum DownloadSource { |
| 98 // The download was initiated when the SavePackage system rejected | 104 // The download was initiated when the SavePackage system rejected |
| 99 // a Save Page As ... by returning false from | 105 // a Save Page As ... by returning false from |
| 100 // SavePackage::IsSaveableContents(). | 106 // SavePackage::IsSaveableContents(). |
| 101 INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0, | 107 INITIATED_BY_SAVE_PACKAGE_ON_NON_HTML = 0, |
| 102 | 108 |
| 103 // The download was initiated by a drag and drop from a drag-and-drop | 109 // 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... |
| 158 | 164 |
| 159 // Record a dangerous download discard event. | 165 // Record a dangerous download discard event. |
| 160 void RecordDangerousDownloadDiscard( | 166 void RecordDangerousDownloadDiscard( |
| 161 DownloadDiscardReason reason, | 167 DownloadDiscardReason reason, |
| 162 DownloadDangerType danger_type, | 168 DownloadDangerType danger_type, |
| 163 const base::FilePath& file_path); | 169 const base::FilePath& file_path); |
| 164 | 170 |
| 165 // Records the mime type of the download. | 171 // Records the mime type of the download. |
| 166 void RecordDownloadMimeType(const std::string& mime_type); | 172 void RecordDownloadMimeType(const std::string& mime_type); |
| 167 | 173 |
| 174 // Records the mime type of the download for normal profile. |
| 175 void RecordDownloadMimeTypeForNormalProfile(const std::string& mime_type); |
| 176 |
| 168 // Records usage of Content-Disposition header. | 177 // Records usage of Content-Disposition header. |
| 169 void RecordDownloadContentDisposition(const std::string& content_disposition); | 178 void RecordDownloadContentDisposition(const std::string& content_disposition); |
| 170 | 179 |
| 171 // Record the number of buffers piled up by the IO thread | 180 // Record the number of buffers piled up by the IO thread |
| 172 // before the file thread gets to draining them. | 181 // before the file thread gets to draining them. |
| 173 void RecordFileThreadReceiveBuffers(size_t num_buffers); | 182 void RecordFileThreadReceiveBuffers(size_t num_buffers); |
| 174 | 183 |
| 175 // Record the time of both the first open and all subsequent opens since the | 184 // Record the time of both the first open and all subsequent opens since the |
| 176 // download completed. | 185 // download completed. |
| 177 void RecordOpen(const base::Time& end, bool first); | 186 void RecordOpen(const base::Time& end, bool first); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 252 |
| 244 void RecordDownloadConnectionSecurity(const GURL& download_url, | 253 void RecordDownloadConnectionSecurity(const GURL& download_url, |
| 245 const std::vector<GURL>& url_chain); | 254 const std::vector<GURL>& url_chain); |
| 246 | 255 |
| 247 void RecordDownloadSourcePageTransitionType( | 256 void RecordDownloadSourcePageTransitionType( |
| 248 const base::Optional<ui::PageTransition>& transition); | 257 const base::Optional<ui::PageTransition>& transition); |
| 249 | 258 |
| 250 } // namespace content | 259 } // namespace content |
| 251 | 260 |
| 252 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 261 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
| OLD | NEW |