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

Unified Diff: chromeos/system/statistics_provider.h

Issue 2371213002: Refactor: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. (Closed)
Patch Set: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. Created 4 years, 3 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: chromeos/system/statistics_provider.h
diff --git a/chromeos/system/statistics_provider.h b/chromeos/system/statistics_provider.h
index 62305e8a3ce9e892e16c5491cc0fd1c7bf135b4a..ef20cca487a037dacfcf64d719e517c0eceb5987 100644
--- a/chromeos/system/statistics_provider.h
+++ b/chromeos/system/statistics_provider.h
@@ -41,6 +41,10 @@ CHROMEOS_EXPORT extern const char kFirmwareTypeValueDeveloper[];
CHROMEOS_EXPORT extern const char kFirmwareTypeValueNonchrome[];
CHROMEOS_EXPORT extern const char kFirmwareTypeValueNormal[];
+// Serial number key (only VPD v2+ devices). Use GetMachineID() to cover legacy
+// devices.
+CHROMEOS_EXPORT extern const char kSerialNumberKey[];
+
// HWID key.
CHROMEOS_EXPORT extern const char kHardwareClassKey[];
@@ -103,12 +107,13 @@ class CHROMEOS_EXPORT StatisticsProvider {
virtual bool GetMachineStatistic(const std::string& name,
std::string* result) = 0;
- // Checks whether a machine statistic is present (without logging a warning).
- bool HasMachineStatistic(const std::string& name);
-
// Similar to GetMachineStatistic for boolean flags.
virtual bool GetMachineFlag(const std::string& name, bool* result) = 0;
+ // Returns the machine serial number after examining a set of well-known
+ // keys. In case no serial is found, an empty string is returned.
+ std::string GetMachineID();
+
// Cancels any pending file operations.
virtual void Shutdown() = 0;

Powered by Google App Engine
This is Rietveld 408576698