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

Side by Side Diff: components/data_use_measurement/core/data_use_measurement.h

Issue 2614203002: Record data use of user traffic by different core page transition types (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_MEASUREMENT_H_ 5 #ifndef COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_MEASUREMENT_H_
6 #define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_MEASUREMENT_H_ 6 #define COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_MEASUREMENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 TrafficDirection dir, 128 TrafficDirection dir,
129 DataUseUserData::AppState app_state, 129 DataUseUserData::AppState app_state,
130 bool is_connection_cellular, 130 bool is_connection_cellular,
131 int64_t message_size) const; 131 int64_t message_size) const;
132 132
133 // Records data use histograms split on TrafficDirection, AppState and 133 // Records data use histograms split on TrafficDirection, AppState and
134 // TabState. 134 // TabState.
135 void RecordTabStateHistogram(TrafficDirection dir, 135 void RecordTabStateHistogram(TrafficDirection dir,
136 DataUseUserData::AppState app_state, 136 DataUseUserData::AppState app_state,
137 bool is_tab_visible, 137 bool is_tab_visible,
138 int64_t bytes); 138 int64_t bytes) const;
139
140 // Records data use histograms split on page tranition.
141 void RecordPageTransitionUMA(const net::URLRequest& request) const;
139 142
140 // Classifier for identifying if an URL request is user initiated. 143 // Classifier for identifying if an URL request is user initiated.
141 std::unique_ptr<URLRequestClassifier> url_request_classifier_; 144 std::unique_ptr<URLRequestClassifier> url_request_classifier_;
142 145
143 // Callback for updating data use prefs. 146 // Callback for updating data use prefs.
144 // TODO(rajendrant): If a similar mechanism would need be used for components 147 // TODO(rajendrant): If a similar mechanism would need be used for components
145 // other than metrics, then the better approach would be to refactor this 148 // other than metrics, then the better approach would be to refactor this
146 // class to support registering arbitrary observers. crbug.com/601185 149 // class to support registering arbitrary observers. crbug.com/601185
147 metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_; 150 metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_;
148 151
(...skipping 27 matching lines...) Expand all
176 // True if app is in background and first network read has not yet happened. 179 // True if app is in background and first network read has not yet happened.
177 bool no_reads_since_background_; 180 bool no_reads_since_background_;
178 #endif 181 #endif
179 182
180 DISALLOW_COPY_AND_ASSIGN(DataUseMeasurement); 183 DISALLOW_COPY_AND_ASSIGN(DataUseMeasurement);
181 }; 184 };
182 185
183 } // namespace data_use_measurement 186 } // namespace data_use_measurement
184 187
185 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_MEASUREMENT_H_ 188 #endif // COMPONENTS_DATA_USE_MEASUREMENT_CONTENT_DATA_USE_MEASUREMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698