Chromium Code Reviews| 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..eb91790d59f1f30bee3461146ef082c20b654626 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,25 @@ 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. |
|
Mark P
2016/12/22 21:40:29
Please follow the guidelines here:
https://chromiu
Raj
2016/12/22 23:14:37
Done.
|
| + enum DataUseContentType { |
| + MAIN_FRAME_HTML, |
| + NON_MAIN_FRAME_HTML, |
| + CSS, |
| + IMAGE, |
| + JAVASCRIPT, |
| + FONT, |
| + AUDIO_APPBACKGROUND, |
| + AUDIO_TABBACKGROUND, |
| + AUDIO, |
| + VIDEO_APPBACKGROUND, |
| + VIDEO_TABBACKGROUND, |
| + VIDEO, |
| + OTHER, |
|
Mark P
2016/12/22 21:40:29
Also, it's typical for people to put the unknown/o
Raj
2016/12/22 23:14:37
Done.
|
| + TYPE_MAX, |
| + }; |
| + |
| // The state of the application. Only available on Android and on other |
| // platforms it is always FOREGROUND. |
| enum AppState { UNKNOWN, BACKGROUND, FOREGROUND }; |
| @@ -78,6 +97,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 +112,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); |
| }; |