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

Unified Diff: chromeos/system/statistics_provider.h

Issue 2218703006: Clean up handling of invalid HWID when running ChromeOS in VMs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: crossystem command changed from is_in_vm to inside_vm Created 4 years, 4 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 2b96fbf1097dfa321b0eca64f3750a62d4f27aaa..aeebeeed96e0d24c58a2c58964727dc9c0c7cdbd 100644
--- a/chromeos/system/statistics_provider.h
+++ b/chromeos/system/statistics_provider.h
@@ -44,9 +44,14 @@ CHROMEOS_EXPORT extern const char kFirmwareTypeValueNormal[];
// HWID key.
CHROMEOS_EXPORT extern const char kHardwareClassKey[];
+// Key/values reporting if Chrome OS is running in a VM or not. These values are
+// read from crossystem output. See crossystem source for VM detection logic.
+CHROMEOS_EXPORT extern const char kIsCrosVMKey[];
+CHROMEOS_EXPORT extern const char kIsCrosVMValueTrue[];
+CHROMEOS_EXPORT extern const char kIsCrosVMValueFalse[];
Daniel Erat 2016/08/10 13:58:05 nit: change "VM" to "Vm" in all of these (https://
+
// System vendor key.
-// The value is used to check if Chrome is running on a VM or a real Chrome OS
-// device. On QEMU VMs this value is QEMU.
+// Empty on non-x86 architectures, most meaningful in VM environments
CHROMEOS_EXPORT extern const char kSystemVendorKey[];
// OEM customization flag that permits exiting enterprise enrollment flow in
@@ -83,6 +88,10 @@ CHROMEOS_EXPORT extern const char kInitialLocaleKey[];
CHROMEOS_EXPORT extern const char kInitialTimezoneKey[];
CHROMEOS_EXPORT extern const char kKeyboardLayoutKey[];
+// Returns true when Chrome OS is running in a VM. NOTE: if crossystem is not
+// installed it will return false even if Chrome OS is running in a VM.
+CHROMEOS_EXPORT bool isRunningOnChromeOSVM();
Daniel Erat 2016/08/10 13:58:05 s/is/Is/ (see naming conventions in style guide)
+
// This interface provides access to Chrome OS statistics.
class CHROMEOS_EXPORT StatisticsProvider {
public:

Powered by Google App Engine
This is Rietveld 408576698