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

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: Rebase 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 ff2023df5bbb4e78297ece1bfd9502bda449784a..39da740cdf56dc80a9d2e07847adff199a80a620 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(
@@ -40,6 +45,9 @@ class ChromeOSMetricsProvider : public metrics::MetricsProvider {
metrics::ChromeUserMetricsExtension* uma_proto) OVERRIDE;
private:
+ // Called on the FILE thread to load hardware class information.
+ void InitTaskGetHardwareClassOnFileThread();
+
// 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.
@@ -66,6 +74,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);
};
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_client.cc ('k') | chrome/browser/metrics/chromeos_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698