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

Unified Diff: chrome/browser/chromeos/login/hwid_checker.cc

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: kSystemVendorKey no longer exists 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: chrome/browser/chromeos/login/hwid_checker.cc
diff --git a/chrome/browser/chromeos/login/hwid_checker.cc b/chrome/browser/chromeos/login/hwid_checker.cc
index 334e52035cc01088080119d129c46a00fca6c716..209f35b600d2c09aa12a9e14d9e1206ae1b35f00 100644
--- a/chrome/browser/chromeos/login/hwid_checker.cc
+++ b/chrome/browser/chromeos/login/hwid_checker.cc
@@ -126,27 +126,9 @@ bool IsMachineHWIDCorrect() {
LOG(ERROR) << "Couldn't get machine statistic 'hardware_class'.";
return false;
}
- if (!chromeos::IsHWIDCorrect(hwid)) {
- // Log the system vendor info to see what the system vendor is on the GCE
- // VMs. This info will be used to filter out error messages on VMs. See
- // http://crbug.com/585514 and http://crbug.com/585515 for more info.
- std::string system_vendor;
- stats->GetMachineStatistic(chromeos::system::kSystemVendorKey,
- &system_vendor);
- std::string firmware_type;
- const bool non_chrome_firmware =
- stats->GetMachineStatistic(chromeos::system::kFirmwareTypeKey,
- &firmware_type) &&
- firmware_type == system::kFirmwareTypeValueNonchrome;
- if (non_chrome_firmware) {
- LOG(WARNING) << "Detected non-Chrome firmware with malformed HWID '"
- << hwid << "', assuming VM environment. "
- << "The system vendor is '" << system_vendor << "'.";
- } else {
- LOG(ERROR) << "Machine has malformed HWID '" << hwid << "'. "
- << "The system vendor is '" << system_vendor << "'.";
- return false;
- }
+ if (!(chromeos::IsHWIDCorrect(hwid) || stats->IsRunningOnVm())) {
achuithb 2016/08/11 18:40:15 I wonder if it's clearer to explicitly do somethin
norvez 2016/08/12 10:18:29 Done.
+ LOG(ERROR) << "Machine has malformed HWID '" << hwid << "'. ";
+ return false;
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698