| 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 <string> | 10 #include <string> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void RecordFileThreadReceiveBuffers(size_t num_buffers); | 117 void RecordFileThreadReceiveBuffers(size_t num_buffers); |
| 118 | 118 |
| 119 // Record the bandwidth seen in DownloadResourceHandler | 119 // Record the bandwidth seen in DownloadResourceHandler |
| 120 // |actual_bandwidth| and |potential_bandwidth| are in bytes/second. | 120 // |actual_bandwidth| and |potential_bandwidth| are in bytes/second. |
| 121 void RecordBandwidth(double actual_bandwidth, double potential_bandwidth); | 121 void RecordBandwidth(double actual_bandwidth, double potential_bandwidth); |
| 122 | 122 |
| 123 // Record the time of both the first open and all subsequent opens since the | 123 // Record the time of both the first open and all subsequent opens since the |
| 124 // download completed. | 124 // download completed. |
| 125 void RecordOpen(const base::Time& end, bool first); | 125 void RecordOpen(const base::Time& end, bool first); |
| 126 | 126 |
| 127 // Record the number of items that are in the history at the time that a | |
| 128 // new download is added to the history. | |
| 129 void RecordHistorySize(int size); | |
| 130 | |
| 131 // Record whether or not the server accepts ranges, and the download size. | 127 // Record whether or not the server accepts ranges, and the download size. |
| 132 void RecordAcceptsRanges(const std::string& accepts_ranges, int64 download_len); | 128 void RecordAcceptsRanges(const std::string& accepts_ranges, int64 download_len); |
| 133 | 129 |
| 134 // Record the number of downloads removed by ClearAll. | 130 // Record the number of downloads removed by ClearAll. |
| 135 void RecordClearAllSize(int size); | 131 void RecordClearAllSize(int size); |
| 136 | 132 |
| 137 // Record the number of completed unopened downloads when a download is opened. | 133 // Record the number of completed unopened downloads when a download is opened. |
| 138 void RecordOpensOutstanding(int size); | 134 void RecordOpensOutstanding(int size); |
| 139 | 135 |
| 140 // Record how long we block the file thread at a time. | 136 // Record how long we block the file thread at a time. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 168 SAVE_PACKAGE_WRITE_TO_FAILED, | 164 SAVE_PACKAGE_WRITE_TO_FAILED, |
| 169 | 165 |
| 170 SAVE_PACKAGE_LAST_ENTRY | 166 SAVE_PACKAGE_LAST_ENTRY |
| 171 }; | 167 }; |
| 172 | 168 |
| 173 void RecordSavePackageEvent(SavePackageEvent event); | 169 void RecordSavePackageEvent(SavePackageEvent event); |
| 174 | 170 |
| 175 } // namespace download_stats | 171 } // namespace download_stats |
| 176 | 172 |
| 177 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 173 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
| OLD | NEW |