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

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

Issue 11734005: Read CrOS install attributes cache on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, write test. Created 7 years, 11 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/policy/enterprise_install_attributes.h
diff --git a/chrome/browser/policy/enterprise_install_attributes.h b/chrome/browser/policy/enterprise_install_attributes.h
index c1266eb3e03e9c785577b5d6b18210b88fc87c4a..38904daa79b47ca8c372838716e64d2946811f61 100644
--- a/chrome/browser/policy/enterprise_install_attributes.h
+++ b/chrome/browser/policy/enterprise_install_attributes.h
@@ -5,10 +5,12 @@
#ifndef CHROME_BROWSER_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_
#define CHROME_BROWSER_POLICY_ENTERPRISE_INSTALL_ATTRIBUTES_H_
+#include <map>
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/file_path.h"
#include "chrome/browser/policy/cloud_policy_constants.h"
namespace chromeos {
@@ -29,8 +31,20 @@ class EnterpriseInstallAttributes {
LOCK_WRONG_USER,
};
+ // Standard cache file name.
+ static const FilePath::CharType kCacheFilePath[];
+
explicit EnterpriseInstallAttributes(chromeos::CryptohomeLibrary* cryptohome);
+ // Reads data from the cache file. 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 FilePath& cache_file);
+
+ // Makes sure the local caches for enterprise-related install attributes are
+ // up-to-date with what cryptohome has.
+ void ReadImmutableAttributes();
+
// Locks the device to be an enterprise device registered by the given user.
// This can also be called after the lock has already been taken, in which
// case it checks that the passed user agrees with the locked attribute.
@@ -59,9 +73,9 @@ class EnterpriseInstallAttributes {
DeviceMode GetMode();
private:
- // Makes sure the local caches for enterprise-related install attributes are
- // up-to-date with what cryptohome has.
- void ReadImmutableAttributes();
+ // Decodes the install attributes provided in |attr_map|.
+ void DecodeInstallAttributes(
+ const std::map<std::string, std::string>& attr_map);
chromeos::CryptohomeLibrary* cryptohome_;

Powered by Google App Engine
This is Rietveld 408576698