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

Unified Diff: chrome/browser/metrics/chromeos_metrics_provider.h

Issue 301633006: Move ChromeOS hardware class init out of MetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 6 years, 7 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: chrome/browser/metrics/chromeos_metrics_provider.h
diff --git a/chrome/browser/metrics/chromeos_metrics_provider.h b/chrome/browser/metrics/chromeos_metrics_provider.h
index 934a3cfca8e79d68955067a7c55c3220500afa0d..f852f63f26556d384c91ad837c2cd96001249301 100644
--- a/chrome/browser/metrics/chromeos_metrics_provider.h
+++ b/chrome/browser/metrics/chromeos_metrics_provider.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
#define CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/metrics/perf_provider_chromeos.h"
#include "components/metrics/metrics_provider.h"
@@ -30,6 +31,10 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
// Records a crash.
static void LogCrash(const std::string& crash_type);
+ // Loads hardware class information. When this task is complete, |callback|
+ // is run.
+ void InitTaskGetHardwareClass(const base::Closure& callback);
+
// metrics::MetricsProvider:
virtual void OnDidCreateMetricsLog() OVERRIDE;
virtual void ProvideSystemProfileMetrics(
@@ -38,6 +43,11 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
private:
+ // Called on the FILE thread to load hardware class information. When this
+ // task is complete, |callback| is run on |target_loop|.
+ void InitTaskGetHardwareClassOnFileThread(base::MessageLoopProxy* target_loop,
+ const base::Closure& callback);
+
// Update the number of users logged into a multi-profile session.
// If the number of users change while the log is open, the call invalidates
// the user count value.
@@ -65,6 +75,12 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
// true.
uint64 user_count_at_log_initialization_;
+ // Hardware class (e.g., hardware qualification ID). This class identifies
+ // the configured system components such as CPU, WiFi adapter, etc.
+ std::string hardware_class_;
+
+ base::WeakPtrFactory<ChromeOSMetricsProvider> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeOSMetricsProvider);
};

Powered by Google App Engine
This is Rietveld 408576698