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

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_client.h

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Minor changes 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 CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_
6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 // Factory function. 55 // Factory function.
56 static std::unique_ptr<ChromeMetricsServiceClient> Create( 56 static std::unique_ptr<ChromeMetricsServiceClient> Create(
57 metrics::MetricsStateManager* state_manager); 57 metrics::MetricsStateManager* state_manager);
58 58
59 // Registers local state prefs used by this class. 59 // Registers local state prefs used by this class.
60 static void RegisterPrefs(PrefRegistrySimple* registry); 60 static void RegisterPrefs(PrefRegistrySimple* registry);
61 61
62 // metrics::MetricsServiceClient: 62 // metrics::MetricsServiceClient:
63 metrics::MetricsService* GetMetricsService() override; 63 metrics::MetricsService* GetMetricsService() override;
64 ukm::UkmService* GetUkmService() override;
64 void SetMetricsClientId(const std::string& client_id) override; 65 void SetMetricsClientId(const std::string& client_id) override;
65 int32_t GetProduct() override; 66 int32_t GetProduct() override;
66 std::string GetApplicationLocale() override; 67 std::string GetApplicationLocale() override;
67 bool GetBrand(std::string* brand_code) override; 68 bool GetBrand(std::string* brand_code) override;
68 metrics::SystemProfileProto::Channel GetChannel() override; 69 metrics::SystemProfileProto::Channel GetChannel() override;
69 std::string GetVersionString() override; 70 std::string GetVersionString() override;
70 void OnEnvironmentUpdate(std::string* serialized_environment) override; 71 void OnEnvironmentUpdate(std::string* serialized_environment) override;
71 void OnLogUploadComplete() override; 72 void OnLogUploadComplete() override;
72 void OnLogCleanShutdown() override; 73 void OnLogCleanShutdown() override;
73 void InitializeSystemProfileMetrics( 74 void InitializeSystemProfileMetrics(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 #endif // OS_WIN 146 #endif // OS_WIN
146 147
147 base::ThreadChecker thread_checker_; 148 base::ThreadChecker thread_checker_;
148 149
149 // Weak pointer to the MetricsStateManager. 150 // Weak pointer to the MetricsStateManager.
150 metrics::MetricsStateManager* metrics_state_manager_; 151 metrics::MetricsStateManager* metrics_state_manager_;
151 152
152 // The MetricsService that |this| is a client of. 153 // The MetricsService that |this| is a client of.
153 std::unique_ptr<metrics::MetricsService> metrics_service_; 154 std::unique_ptr<metrics::MetricsService> metrics_service_;
154 155
156 // The UkmService that |this| is a client of.
157 std::unique_ptr<ukm::UkmService> ukm_service_;
158
155 content::NotificationRegistrar registrar_; 159 content::NotificationRegistrar registrar_;
156 160
157 #if defined(OS_CHROMEOS) 161 #if defined(OS_CHROMEOS)
158 // On ChromeOS, holds a weak pointer to the ChromeOSMetricsProvider instance 162 // On ChromeOS, holds a weak pointer to the ChromeOSMetricsProvider instance
159 // that has been registered with MetricsService. On other platforms, is NULL. 163 // that has been registered with MetricsService. On other platforms, is NULL.
160 ChromeOSMetricsProvider* chromeos_metrics_provider_; 164 ChromeOSMetricsProvider* chromeos_metrics_provider_;
161 #endif 165 #endif
162 166
163 // A queue of tasks for initial metrics gathering. These may be asynchronous 167 // A queue of tasks for initial metrics gathering. These may be asynchronous
164 // or synchronous. 168 // or synchronous.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // Whether this client has already uploaded profiler data during this session. 224 // Whether this client has already uploaded profiler data during this session.
221 // Profiler data is uploaded at most once per session. 225 // Profiler data is uploaded at most once per session.
222 bool has_uploaded_profiler_data_; 226 bool has_uploaded_profiler_data_;
223 227
224 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; 228 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_;
225 229
226 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); 230 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient);
227 }; 231 };
228 232
229 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ 233 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698