| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/browser/download/interrupt_reasons.h" | 15 #include "content/browser/download/interrupt_reasons.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class Time; |
| 18 class TimeTicks; | 19 class TimeTicks; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace download_stats { | 22 namespace download_stats { |
| 22 | 23 |
| 23 // We keep a count of how often various events occur in the | 24 // We keep a count of how often various events occur in the |
| 24 // histogram "Download.Counts". | 25 // histogram "Download.Counts". |
| 25 enum DownloadCountTypes { | 26 enum DownloadCountTypes { |
| 26 // The download was initiated by navigating to a URL (e.g. by user | 27 // The download was initiated by navigating to a URL (e.g. by user |
| 27 // click). | 28 // click). |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 85 |
| 85 // Records the mime type of the download. | 86 // Records the mime type of the download. |
| 86 void RecordDownloadMimeType(const std::string& mime_type); | 87 void RecordDownloadMimeType(const std::string& mime_type); |
| 87 | 88 |
| 88 // Record WRITE_SIZE_COUNT and data_len. | 89 // Record WRITE_SIZE_COUNT and data_len. |
| 89 void RecordDownloadWriteSize(size_t data_len); | 90 void RecordDownloadWriteSize(size_t data_len); |
| 90 | 91 |
| 91 // Record WRITE_LOOP_COUNT and number of loops. | 92 // Record WRITE_LOOP_COUNT and number of loops. |
| 92 void RecordDownloadWriteLoopCount(int count); | 93 void RecordDownloadWriteLoopCount(int count); |
| 93 | 94 |
| 95 // Record the time of both the first open and all subsequent opens since the |
| 96 // download completed. |
| 97 void RecordOpen(const base::Time& end, bool first); |
| 98 |
| 99 // Record the number of items that are in the history at the time that a |
| 100 // new download is added to the history. |
| 101 void RecordHistorySize(int size); |
| 102 |
| 103 // Record the total number of items and the number of in-progress items showing |
| 104 // in the shelf when it closes. Set |autoclose| to true when the shelf is |
| 105 // closing itself, false when the user explicitly closed it. |
| 106 void RecordShelfClose(int size, int in_progress, bool autoclose); |
| 107 |
| 108 // Record the number of downloads removed by ClearAll. |
| 109 void RecordClearAllSize(int size); |
| 110 |
| 111 // Record the number of completed unopened downloads when a download is opened. |
| 112 void RecordOpensOutstanding(int size); |
| 113 |
| 94 } // namespace download_stats | 114 } // namespace download_stats |
| 95 | 115 |
| 96 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ | 116 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ |
| OLD | NEW |