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

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

Issue 2595503002: Record the data use by content type (Closed)
Patch Set: Removed loadflags 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_measurement.h
diff --git a/components/data_use_measurement/core/data_use_measurement.h b/components/data_use_measurement/core/data_use_measurement.h
index ffd64f71cef36ed29172c5ac84e82fa5440878d6..a0e4298c94e59d77b0f7a9eab46f4cb649f2aa6e 100644
--- a/components/data_use_measurement/core/data_use_measurement.h
+++ b/components/data_use_measurement/core/data_use_measurement.h
@@ -24,6 +24,7 @@
class GURL;
namespace net {
+class HttpResponseHeaders;
class URLRequest;
}
@@ -53,6 +54,10 @@ class DataUseMeasurement {
void OnBeforeRedirect(const net::URLRequest& request,
const GURL& new_location);
+ // Called when response headers are received for |request|.
+ void OnHeadersReceived(net::URLRequest* request,
+ const net::HttpResponseHeaders* response_headers);
+
// Called when data is received or sent on the network, respectively.
void OnNetworkBytesReceived(const net::URLRequest& request,
int64_t bytes_received);
@@ -137,6 +142,15 @@ class DataUseMeasurement {
bool is_tab_visible,
int64_t bytes);
+ // Records data use histograms of user traffic and services traffic split on
+ // content type, AppState and TabState.
+ void RecordContentTypeHistogram(
+ DataUseUserData::DataUseContentType content_type,
+ bool is_user_traffic,
+ DataUseUserData::AppState app_state,
+ bool is_tab_visible,
+ int64_t bytes);
+
// Classifier for identifying if an URL request is user initiated.
std::unique_ptr<URLRequestClassifier> url_request_classifier_;

Powered by Google App Engine
This is Rietveld 408576698