Index: chrome/browser/chromeos/policy/enterprise_install_attributes.cc |
diff --git a/chrome/browser/chromeos/policy/enterprise_install_attributes.cc b/chrome/browser/chromeos/policy/enterprise_install_attributes.cc |
index c303e9ad6a37e36692a46ba3a1644dae99d7bb2d..9fd9c8033d815d1321be2198f0c036dd0156df2f 100644 |
--- a/chrome/browser/chromeos/policy/enterprise_install_attributes.cc |
+++ b/chrome/browser/chromeos/policy/enterprise_install_attributes.cc |
@@ -81,9 +81,9 @@ EnterpriseInstallAttributes::~EnterpriseInstallAttributes() {} |
void EnterpriseInstallAttributes::Init(const base::FilePath& cache_file) { |
DCHECK_EQ(false, device_locked_); |
- // The actual check happens asynchronously, thus it is ok to trigger it before |
- // Init() has completed. |
- TriggerConsistencyCheck(kDbusRetryCount * kDbusRetryIntervalInSeconds); |
Daniel Erat
2016/08/11 21:34:43
the multiplication by kDbusRetryIntervalInSeconds
Mattias Nissler (ping if slow)
2016/09/07 19:47:24
Agreed.
Daniel Erat
2016/09/07 20:46:52
Acknowledged.
|
+ cryptohome_client_->WaitForServiceToBeAvailable(base::Bind( |
+ &EnterpriseInstallAttributes::OnCryptohomeServiceInitiallyAvailable, |
+ weak_ptr_factory_.GetWeakPtr())); |
if (!base::PathExists(cache_file)) |
return; |
@@ -425,6 +425,16 @@ const char EnterpriseInstallAttributes::kAttrEnterpriseUser[] = |
const char EnterpriseInstallAttributes::kAttrConsumerKioskEnabled[] = |
"consumer.app_kiosk_enabled"; |
+void EnterpriseInstallAttributes::OnCryptohomeServiceInitiallyAvailable( |
+ bool service_is_ready) { |
+ if (!service_is_ready) |
+ LOG(ERROR) << "Failed waiting for cryptohome D-Bus service availability"; |
+ |
+ // Start the consistency check even if we failed to wait for availability; |
+ // hopefully the service will become available eventually. |
+ TriggerConsistencyCheck(kDbusRetryCount); |
Daniel Erat
2016/08/11 21:34:43
calling this asynchronously when the service becom
Mattias Nissler (ping if slow)
2016/09/07 19:47:25
I'd just set consistency_check_running_ to true in
Daniel Erat
2016/09/07 20:46:52
Done.
|
+} |
+ |
std::string EnterpriseInstallAttributes::GetDeviceModeString(DeviceMode mode) { |
switch (mode) { |
case DEVICE_MODE_CONSUMER: |