| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 DownloadDiscardReason reason, | 159 DownloadDiscardReason reason, |
| 160 DownloadDangerType danger_type, | 160 DownloadDangerType danger_type, |
| 161 const base::FilePath& file_path); | 161 const base::FilePath& file_path); |
| 162 | 162 |
| 163 // Records the mime type of the download. | 163 // Records the mime type of the download. |
| 164 void RecordDownloadMimeType(const std::string& mime_type); | 164 void RecordDownloadMimeType(const std::string& mime_type); |
| 165 | 165 |
| 166 // Records usage of Content-Disposition header. | 166 // Records usage of Content-Disposition header. |
| 167 void RecordDownloadContentDisposition(const std::string& content_disposition); | 167 void RecordDownloadContentDisposition(const std::string& content_disposition); |
| 168 | 168 |
| 169 // Record WRITE_SIZE_COUNT and data_len. | |
| 170 void RecordDownloadWriteSize(size_t data_len); | |
| 171 | |
| 172 // Record WRITE_LOOP_COUNT and number of loops. | |
| 173 void RecordDownloadWriteLoopCount(int count); | |
| 174 | |
| 175 // Record the number of buffers piled up by the IO thread | 169 // Record the number of buffers piled up by the IO thread |
| 176 // before the file thread gets to draining them. | 170 // before the file thread gets to draining them. |
| 177 void RecordFileThreadReceiveBuffers(size_t num_buffers); | 171 void RecordFileThreadReceiveBuffers(size_t num_buffers); |
| 178 | 172 |
| 179 // Record the bandwidth seen in DownloadResourceHandler | |
| 180 // |actual_bandwidth| and |potential_bandwidth| are in bytes/second. | |
| 181 void RecordBandwidth(double actual_bandwidth, double potential_bandwidth); | |
| 182 | |
| 183 // Record the time of both the first open and all subsequent opens since the | 173 // Record the time of both the first open and all subsequent opens since the |
| 184 // download completed. | 174 // download completed. |
| 185 void RecordOpen(const base::Time& end, bool first); | 175 void RecordOpen(const base::Time& end, bool first); |
| 186 | 176 |
| 187 // Record whether or not the server accepts ranges, and the download size. Also | 177 // Record whether or not the server accepts ranges, and the download size. Also |
| 188 // counts if a strong validator is supplied. The combination of range request | 178 // counts if a strong validator is supplied. The combination of range request |
| 189 // support and ETag indicates downloads that are candidates for partial | 179 // support and ETag indicates downloads that are candidates for partial |
| 190 // resumption. | 180 // resumption. |
| 191 void RecordAcceptsRanges(const std::string& accepts_ranges, | 181 void RecordAcceptsRanges(const std::string& accepts_ranges, |
| 192 int64_t download_len, | 182 int64_t download_len, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // enum. | 240 // enum. |
| 251 void RecordOriginStateOnResumption(bool is_partial, | 241 void RecordOriginStateOnResumption(bool is_partial, |
| 252 int state); | 242 int state); |
| 253 | 243 |
| 254 void RecordDownloadConnectionSecurity(const GURL& download_url, | 244 void RecordDownloadConnectionSecurity(const GURL& download_url, |
| 255 const std::vector<GURL>& url_chain); | 245 const std::vector<GURL>& url_chain); |
| 256 | 246 |
| 257 } // namespace content | 247 } // namespace content |
| 258 | 248 |
| 259 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 249 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
| OLD | NEW |