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

Unified Diff: chrome/browser/chromeos/policy/enterprise_install_attributes.h

Issue 1189203003: Add UMA for consistency between TPM and install attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master3
Patch Set: Simplified after comments by Mattias. Created 5 years, 6 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/policy/enterprise_install_attributes.h
diff --git a/chrome/browser/chromeos/policy/enterprise_install_attributes.h b/chrome/browser/chromeos/policy/enterprise_install_attributes.h
index bb9a681c721e037fa0a6f657d8de611f46748e2a..584a6fa7fee8842145ca24b1aa67c1aacb595bfc 100644
--- a/chrome/browser/chromeos/policy/enterprise_install_attributes.h
+++ b/chrome/browser/chromeos/policy/enterprise_install_attributes.h
@@ -52,11 +52,11 @@ class EnterpriseInstallAttributes {
chromeos::CryptohomeClient* cryptohome_client);
~EnterpriseInstallAttributes();
- // Reads data from the cache file which is created early during the boot
- // process. The cache file is used to work around slow cryptohome startup,
- // which takes a while to register its DBus interface. See
- // http://crosbug.com/37367 for background on this.
- void ReadCacheFile(const base::FilePath& cache_file);
+ // Tries to read install attributes from the cache file which is created early
+ // during the boot process. The cache file is used to work around slow
+ // cryptohome startup, which takes a while to register its DBus interface.
+ // (See http://crosbug.com/37367 for background on this.)
+ void Init(const base::FilePath& cache_file);
// Makes sure the local caches for enterprise-related install attributes are
// up-to-date with what cryptohome has. This method checks the readiness of
@@ -97,7 +97,13 @@ class EnterpriseInstallAttributes {
DeviceMode GetMode();
protected:
+ // True if install attributes have been read successfully. False if read
+ // failed or no read attempt was made.
bool device_locked_;
Mattias Nissler (ping if slow) 2015/06/24 08:34:39 nit: blank line before comment.
Thiemo Nagel 2015/06/24 10:43:36 Done.
+ // Whether the TPM / install attributes consistency check is running.
+ bool consistency_check_running_;
Mattias Nissler (ping if slow) 2015/06/24 08:34:39 nit: blank line before comment.
Thiemo Nagel 2015/06/24 10:43:36 Done.
+ // To be run after the consistency check has finished.
+ base::Closure post_check_action_;
Mattias Nissler (ping if slow) 2015/06/24 08:34:39 nit: blank line here. The members below conceptual
Thiemo Nagel 2015/06/24 10:43:36 Done.
std::string registration_user_;
std::string registration_domain_;
std::string registration_device_id_;
@@ -158,6 +164,17 @@ class EnterpriseInstallAttributes {
void OnReadImmutableAttributes(const std::string& user,
const LockResultCallback& callback);
+ // Check state of install attributes against TPM lock state and generate UMA
+ // for the result. Asynchronously retry |dbus_tries| times in case of DBUS
+ // errors (cryptohomed startup is slow).
+ void TriggerConsistencyCheck(int dbus_tries);
+
+ // Callback for TpmIsOwned() DBUS call. Generates UMA or schedules retry in
+ // case of DBUS error.
+ void OnTpmIsOwned(int dbus_tries_remaining,
Mattias Nissler (ping if slow) 2015/06/24 08:34:39 The name of this function is misleading. Should On
Thiemo Nagel 2015/06/24 10:43:36 You're right. Done.
+ chromeos::DBusMethodCallStatus call_status,
+ bool result);
+
chromeos::CryptohomeClient* cryptohome_client_;
base::WeakPtrFactory<EnterpriseInstallAttributes> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698