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

Side by Side Diff: components/metrics/metrics_service_client.h

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: RegisterPrefs 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_METRICS_METRICS_SERVICE_CLIENT_H_ 5 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ 6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "components/metrics/metrics_reporting_default_state.h" 16 #include "components/metrics/metrics_reporting_default_state.h"
17 #include "components/metrics/proto/system_profile.pb.h" 17 #include "components/metrics/proto/system_profile.pb.h"
18 18
19 namespace base { 19 namespace base {
20 class FilePath; 20 class FilePath;
21 } 21 }
22 22
23 namespace ukm {
24 class UkmService;
25 }
26
23 namespace metrics { 27 namespace metrics {
24 28
25 class MetricsLogUploader; 29 class MetricsLogUploader;
26 class MetricsService; 30 class MetricsService;
27 31
28 // An abstraction of operations that depend on the embedder's (e.g. Chrome) 32 // An abstraction of operations that depend on the embedder's (e.g. Chrome)
29 // environment. 33 // environment.
30 class MetricsServiceClient { 34 class MetricsServiceClient {
31 public: 35 public:
32 virtual ~MetricsServiceClient() {} 36 virtual ~MetricsServiceClient() {}
33 37
34 // Returns the MetricsService instance that this client is associated with. 38 // Returns the MetricsService instance that this client is associated with.
35 // With the exception of testing contexts, the returned instance must be valid 39 // With the exception of testing contexts, the returned instance must be valid
36 // for the lifetime of this object (typically, the embedder's client 40 // for the lifetime of this object (typically, the embedder's client
37 // implementation will own the MetricsService instance being returned). 41 // implementation will own the MetricsService instance being returned).
38 virtual MetricsService* GetMetricsService() = 0; 42 virtual MetricsService* GetMetricsService() = 0;
39 43
44 // Returns the UkmService instance that this client is associated with.
45 virtual ukm::UkmService* GetUkmService();
46
40 // Registers the client id with other services (e.g. crash reporting), called 47 // Registers the client id with other services (e.g. crash reporting), called
41 // when metrics recording gets enabled. 48 // when metrics recording gets enabled.
42 virtual void SetMetricsClientId(const std::string& client_id) = 0; 49 virtual void SetMetricsClientId(const std::string& client_id) = 0;
43 50
44 // Returns the product value to use in uploaded reports, which will be used to 51 // Returns the product value to use in uploaded reports, which will be used to
45 // set the ChromeUserMetricsExtension.product field. See comments on that 52 // set the ChromeUserMetricsExtension.product field. See comments on that
46 // field on why it's an int32_t rather than an enum. 53 // field on why it's an int32_t rather than an enum.
47 virtual int32_t GetProduct() = 0; 54 virtual int32_t GetProduct() = 0;
48 55
49 // Returns the current application locale (e.g. "en-US"). 56 // Returns the current application locale (e.g. "en-US").
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // shown during first-run. 121 // shown during first-run.
115 virtual EnableMetricsDefault GetMetricsReportingDefaultState(); 122 virtual EnableMetricsDefault GetMetricsReportingDefaultState();
116 123
117 // Returns whether cellular logic is enabled for metrics reporting. 124 // Returns whether cellular logic is enabled for metrics reporting.
118 virtual bool IsUMACellularUploadLogicEnabled(); 125 virtual bool IsUMACellularUploadLogicEnabled();
119 }; 126 };
120 127
121 } // namespace metrics 128 } // namespace metrics
122 129
123 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ 130 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698