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

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

Issue 2595503002: Record the data use by content type (Closed)
Patch Set: Add enum 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..1b7c3c364f59a7cd82b495e997a7a08977f21b10 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,19 @@ class DataUseUserData : public base::SupportsUserData::Data {
UPDATE_CLIENT,
};
+ // Content type of the URL request.
+ enum ContentType {
+ MAIN_FRAME_HTML,
+ NON_MAIN_FRAME_HTML,
+ CSS,
+ IMAGE,
+ JAVASCRIPT,
+ FONT,
+ AUDIO,
+ VIDEO,
+ OTHER,
+ };
+
// The state of the application. Only available on Android and on other
// platforms it is always FOREGROUND.
enum AppState { UNKNOWN, BACKGROUND, FOREGROUND };
@@ -78,6 +91,12 @@ class DataUseUserData : public base::SupportsUserData::Data {
void set_app_state(AppState app_state) { app_state_ = app_state; }
+ ContentType content_type() { return content_type_; }
+
+ void set_content_type(ContentType content_type) {
+ content_type_ = content_type;
+ }
+
// The key for retrieving back this type of user data.
static const void* const kUserDataKey;
@@ -87,6 +106,8 @@ class DataUseUserData : public base::SupportsUserData::Data {
// App state when network access was performed for the request previously.
AppState app_state_;
+ ContentType content_type_;
+
DISALLOW_COPY_AND_ASSIGN(DataUseUserData);
};

Powered by Google App Engine
This is Rietveld 408576698