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

Unified Diff: components/data_use_measurement/core/data_use_user_data.h

Issue 2595503002: Record the data use by content type (Closed)
Patch Set: fixed nits Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: components/data_use_measurement/core/data_use_user_data.h
diff --git a/components/data_use_measurement/core/data_use_user_data.h b/components/data_use_measurement/core/data_use_user_data.h
index cfae6b9b75c9c6c3e21d295005915ddb3064d387..99ba656b67b815f65ab0f3cff5ccff7991bcc729 100644
--- a/components/data_use_measurement/core/data_use_user_data.h
+++ b/components/data_use_measurement/core/data_use_user_data.h
@@ -52,6 +52,27 @@ class DataUseUserData : public base::SupportsUserData::Data {
UPDATE_CLIENT,
};
+ // Data use broken by content type. This enum must remain synchronized
+ // with the enum of the same name in metrics/histograms/histograms.xml.
+ // These values are written to logs. New enum values can be added, but
+ // existing enums must never be renumbered or deleted and reused.
+ enum DataUseContentType {
+ OTHER = 0,
+ MAIN_FRAME_HTML = 1,
+ NON_MAIN_FRAME_HTML = 2,
+ CSS = 3,
+ IMAGE = 4,
+ JAVASCRIPT = 5,
+ FONT = 6,
+ AUDIO_APPBACKGROUND = 7,
+ AUDIO_TABBACKGROUND = 8,
+ AUDIO = 9,
+ VIDEO_APPBACKGROUND = 10,
+ VIDEO_TABBACKGROUND = 11,
+ VIDEO = 12,
+ TYPE_MAX = 13,
+ };
+
// The state of the application. Only available on Android and on other
// platforms it is always FOREGROUND.
enum AppState { UNKNOWN, BACKGROUND, FOREGROUND };
@@ -78,6 +99,12 @@ class DataUseUserData : public base::SupportsUserData::Data {
void set_app_state(AppState app_state) { app_state_ = app_state; }
+ DataUseContentType content_type() { return content_type_; }
+
+ void set_content_type(DataUseContentType content_type) {
+ content_type_ = content_type;
+ }
+
// The key for retrieving back this type of user data.
static const void* const kUserDataKey;
@@ -87,6 +114,8 @@ class DataUseUserData : public base::SupportsUserData::Data {
// App state when network access was performed for the request previously.
AppState app_state_;
+ DataUseContentType content_type_;
+
DISALLOW_COPY_AND_ASSIGN(DataUseUserData);
};

Powered by Google App Engine
This is Rietveld 408576698