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

Unified Diff: components/metrics/metrics_log_uploader.h

Issue 2708293002: Switch UKM service to properly mark upload data as UKM and not UMA. (Closed)
Patch Set: no switch default now requires a default value Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/metrics_log_uploader.h
diff --git a/components/metrics/metrics_log_uploader.h b/components/metrics/metrics_log_uploader.h
index 2ef0cf2577e71103ffaee8431d67a6fbdaf39feb..bcc46626ad51f17864d6b3418b10c151410f36e2 100644
--- a/components/metrics/metrics_log_uploader.h
+++ b/components/metrics/metrics_log_uploader.h
@@ -16,11 +16,20 @@ namespace metrics {
// of MetricsService.
class MetricsLogUploader {
public:
+ // Possible service types. This should correspond to a type from
+ // DataUseUserData.
+ enum MetricServiceType {
+ UMA,
+ UKM,
+ };
+
// Constructs the uploader that will upload logs to the specified |server_url|
- // with the given |mime_type|. The |on_upload_complete| callback will be
- // called with the HTTP response code of the upload or with -1 on an error.
+ // with the given |mime_type|. The |service_type| marks which service the
+ // data usage should be attributed to. The |on_upload_complete| callback will
+ // be called with the HTTP response code of the upload or with -1 on an error.
MetricsLogUploader(const std::string& server_url,
const std::string& mime_type,
+ MetricServiceType service_type,
const base::Callback<void(int)>& on_upload_complete);
virtual ~MetricsLogUploader();
@@ -33,6 +42,11 @@ class MetricsLogUploader {
protected:
const std::string server_url_;
const std::string mime_type_;
+
+ // Which service type this uploads for. This is used for bandwidth
+ // attribution.
+ const MetricServiceType service_type_;
+
const base::Callback<void(int)> on_upload_complete_;
private:
« no previous file with comments | « components/data_use_measurement/core/data_use_user_data.cc ('k') | components/metrics/metrics_log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698