Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: content/browser/download/download_stats.h

Issue 10074001: Initial implementation of the ByteStream refactor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Checkpoint and merge to LKGR. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #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/public/browser/download_interrupt_reasons.h" 15 #include "content/public/browser/download_interrupt_reasons.h"
16 16
17 namespace base { 17 namespace base {
18 class Time; 18 class Time;
19 class TimeDelta;
19 class TimeTicks; 20 class TimeTicks;
20 } 21 }
21 22
22 namespace download_stats { 23 namespace download_stats {
23 24
24 // We keep a count of how often various events occur in the 25 // We keep a count of how often various events occur in the
25 // histogram "Download.Counts". 26 // histogram "Download.Counts".
26 enum DownloadCountTypes { 27 enum DownloadCountTypes {
27 // Stale enum values left around so that values passed to UMA don't 28 // Stale enum values left around so that values passed to UMA don't
28 // change. 29 // change.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 131
131 // Record whether or not the server accepts ranges, and the download size. 132 // Record whether or not the server accepts ranges, and the download size.
132 void RecordAcceptsRanges(const std::string& accepts_ranges, int64 download_len); 133 void RecordAcceptsRanges(const std::string& accepts_ranges, int64 download_len);
133 134
134 // Record the number of downloads removed by ClearAll. 135 // Record the number of downloads removed by ClearAll.
135 void RecordClearAllSize(int size); 136 void RecordClearAllSize(int size);
136 137
137 // Record the number of completed unopened downloads when a download is opened. 138 // Record the number of completed unopened downloads when a download is opened.
138 void RecordOpensOutstanding(int size); 139 void RecordOpensOutstanding(int size);
139 140
141 // Record how long we block the file thread at a time.
142 void RecordContiguousWriteTime(base::TimeDelta time_blocked);
143
140 enum SavePackageEvent { 144 enum SavePackageEvent {
141 // The user has started to save a page as a package. 145 // The user has started to save a page as a package.
142 SAVE_PACKAGE_STARTED, 146 SAVE_PACKAGE_STARTED,
143 147
144 // The save package operation was cancelled. 148 // The save package operation was cancelled.
145 SAVE_PACKAGE_CANCELLED, 149 SAVE_PACKAGE_CANCELLED,
146 150
147 // The save package operation finished without being cancelled. 151 // The save package operation finished without being cancelled.
148 SAVE_PACKAGE_FINISHED, 152 SAVE_PACKAGE_FINISHED,
149 153
150 // The save package tried to write to an already completed file. 154 // The save package tried to write to an already completed file.
151 SAVE_PACKAGE_WRITE_TO_COMPLETED, 155 SAVE_PACKAGE_WRITE_TO_COMPLETED,
152 156
153 // The save package tried to write to an already failed file. 157 // The save package tried to write to an already failed file.
154 SAVE_PACKAGE_WRITE_TO_FAILED, 158 SAVE_PACKAGE_WRITE_TO_FAILED,
155 159
156 SAVE_PACKAGE_LAST_ENTRY 160 SAVE_PACKAGE_LAST_ENTRY
157 }; 161 };
158 162
159 void RecordSavePackageEvent(SavePackageEvent event); 163 void RecordSavePackageEvent(SavePackageEvent event);
160 164
161 } // namespace download_stats 165 } // namespace download_stats
162 166
163 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_ 167 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATS_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/download_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698