Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chromeos / system / statistics_provider.cc
index 7fc6327..60b3c4b 100644 (file)
@@ -41,8 +41,8 @@ const char kUnknownHardwareClass[] = "unknown";
 const char kSerialNumber[] = "sn";
 
 // File to get machine hardware info from, and key/value delimiters of
-// the file.
-// /tmp/machine-info is generated by platform/init/chromeos_startup.
+// the file. machine-info is generated only for OOBE and enterprise enrollment
+// and may not be present. See login-manager/init/machine-info.conf.
 const char kMachineHardwareInfoFile[] = "/tmp/machine-info";
 const char kMachineHardwareInfoEq[] = "=";
 const char kMachineHardwareInfoDelim[] = " \n";
@@ -74,7 +74,6 @@ const char kHardwareClassKey[] = "hardware_class";
 const char kOffersCouponCodeKey[] = "ubind_attribute";
 const char kOffersGroupCodeKey[] = "gbind_attribute";
 const char kRlzBrandCodeKey[] = "rlz_brand_code";
-const char kDiskSerialNumber[] = "root_disk_serial_number";
 
 // OEM specific statistics. Must be prefixed with "oem_".
 const char kOemCanExitEnterpriseEnrollmentKey[] = "oem_can_exit_enrollment";
@@ -135,7 +134,7 @@ bool StatisticsProviderImpl::WaitForStatisticsLoaded() {
     return true;
 
   // Block if the statistics are not loaded yet. Normally this shouldn't
-  // happen excpet during OOBE.
+  // happen except during OOBE.
   base::Time start_time = base::Time::Now();
   base::ThreadRestrictions::ScopedAllowWait allow_wait;
   on_statistics_loaded_.TimedWait(base::TimeDelta::FromSeconds(kTimeoutSecs));
@@ -268,7 +267,6 @@ void StatisticsProviderImpl::LoadMachineStatistics(bool load_oem_manifest) {
     } else if (base::SysInfo::IsRunningOnChromeOS()) {
       LoadOemManifestFromFile(base::FilePath(kOemManifestFilePath));
     }
-    oem_manifest_loaded_ = true;
   }
 
   if (!base::SysInfo::IsRunningOnChromeOS() &&
@@ -307,6 +305,7 @@ void StatisticsProviderImpl::LoadOemManifestFromFile(
   machine_flags_[kOemKeyboardDrivenOobeKey] =
       oem_manifest.keyboard_driven_oobe;
 
+  oem_manifest_loaded_ = true;
   VLOG(1) << "Loaded OEM Manifest statistics from " << file.value();
 }