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

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: 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..ce17418b23f6ba01f440aa43e80ae6930f0d7315 100644
--- a/chrome/browser/chromeos/policy/enterprise_install_attributes.h
+++ b/chrome/browser/chromeos/policy/enterprise_install_attributes.h
@@ -25,6 +25,13 @@ namespace policy {
// TODO(zelidrag, mnissler): Rename + move this class - http://crbug.com/249513.
class EnterpriseInstallAttributes {
public:
+ enum LockState {
+ STATE_UNKNOWN = 0, // A valid lock can't be confirmed.
+ STATE_NOT_LOCKED = 1,
+ STATE_LOCKING = 2, // Lock attempt in process.
+ STATE_LOCKED = 3, // Valid lock confirmed by attribute read.
+ };
+
// EnterpriseInstallAttributes status codes. Do not change the numeric ids or
// the meaning of the existing codes to preserve the interpretability of old
// logfiles.
@@ -52,10 +59,10 @@ 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.
+ // Tries to read install attributes from the cache file which is created early
+ // during the boot process to work around slow cryptohome startup, which takes
Mattias Nissler (ping if slow) 2015/06/19 07:32:45 nit: Your edit makes this sentence ambiguous. Now
Thiemo Nagel 2015/06/19 17:47:04 Done.
+ // a while to register its DBus interface. (See http://crosbug.com/37367 for
+ // background on this.) May only be called once for initialization.
void ReadCacheFile(const base::FilePath& cache_file);
// Makes sure the local caches for enterprise-related install attributes are
@@ -96,8 +103,10 @@ class EnterpriseInstallAttributes {
// are not locked yet will be DEVICE_MODE_UNKNOWN.
DeviceMode GetMode();
+ void CheckConsistency();
+
protected:
- bool device_locked_;
+ LockState lock_state_;
std::string registration_user_;
std::string registration_domain_;
std::string registration_device_id_;
@@ -158,6 +167,10 @@ class EnterpriseInstallAttributes {
void OnReadImmutableAttributes(const std::string& user,
const LockResultCallback& callback);
+ void CheckConsistencyAgainstTpmOwnershipState(
+ 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