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

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

Issue 9404011: Explicitly wait for user policy before completing login. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/user_policy_cache.h
diff --git a/chrome/browser/policy/user_policy_cache.h b/chrome/browser/policy/user_policy_cache.h
index c98adfefbf0ec4cf33e79dba75932eaf35c06daf..c91a25bbb6c3e2f9c82afc56b411a26d58b950ce 100644
--- a/chrome/browser/policy/user_policy_cache.h
+++ b/chrome/browser/policy/user_policy_cache.h
@@ -8,6 +8,7 @@
#include <string>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/values.h"
@@ -37,8 +38,10 @@ class UserPolicyCache : public CloudPolicyCacheBase,
// |backing_file_path| is the path to the cache file.
// |wait_for_policy_fetch| is true if the cache should be ready only after
// an attempt was made to fetch user policy.
+ // If |callback| is not null, it will be invoked once the cache is ready.
UserPolicyCache(const FilePath& backing_file_path,
- bool wait_for_policy_fetch);
+ bool wait_for_policy_fetch,
+ const base::Closure& callback);
virtual ~UserPolicyCache();
// CloudPolicyCacheBase implementation:
@@ -94,6 +97,9 @@ class UserPolicyCache : public CloudPolicyCacheBase,
// fetched policy, or if there is no need to wait for that.
bool fetch_ready_;
+ // Callback to invoke when the cache becomes ready.
+ base::Closure ready_callback_;
+
DISALLOW_COPY_AND_ASSIGN(UserPolicyCache);
};

Powered by Google App Engine
This is Rietveld 408576698