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

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

Issue 22645011: policy: use JSON schema to deserialize entries from Windows registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 3rd party policy unit tests Created 7 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/policy/async_policy_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/async_policy_loader.h
diff --git a/chrome/browser/policy/async_policy_loader.h b/chrome/browser/policy/async_policy_loader.h
index e80bf6f7e7027446f25820aed115aa50bbbb14dc..e9de9a3eec926413d6f808719310e839782e692d 100644
--- a/chrome/browser/policy/async_policy_loader.h
+++ b/chrome/browser/policy/async_policy_loader.h
@@ -35,6 +35,8 @@ class PolicyDomainDescriptor;
// LastModificationTime() is also invoked once on that thread at startup.
class AsyncPolicyLoader {
public:
+ typedef base::Callback<void(scoped_ptr<PolicyBundle>)> UpdateCallback;
+
explicit AsyncPolicyLoader(
scoped_refptr<base::SequencedTaskRunner> task_runner);
virtual ~AsyncPolicyLoader();
@@ -47,6 +49,10 @@ class AsyncPolicyLoader {
// invoked from the thread that owns the provider.
virtual scoped_ptr<PolicyBundle> Load() = 0;
+ // Used by the AsyncPolicyProvider to install the |update_callback_|.
+ // Invoked on the background thread.
+ void Init(const UpdateCallback& update_callback);
+
// Allows implementations to finalize their initialization on the background
// thread (e.g. setup file watchers).
virtual void InitOnBackgroundThread() = 0;
@@ -71,6 +77,10 @@ class AsyncPolicyLoader {
void RegisterPolicyDomain(
scoped_refptr<const PolicyDomainDescriptor> descriptor);
+ // Registers a policy domain without triggering a policy load.
+ void InitialRegisterPolicyDomain(
+ scoped_refptr<const PolicyDomainDescriptor> descriptor);
+
protected:
typedef std::map<PolicyDomain, scoped_refptr<const PolicyDomainDescriptor> >
DescriptorMap;
@@ -80,24 +90,18 @@ class AsyncPolicyLoader {
// unknonwn policies.
const DescriptorMap& descriptor_map() const { return descriptor_map_; }
+ // Returns the desired descriptor if it exists, otherwise NULL.
+ scoped_refptr<const PolicyDomainDescriptor> get_descriptor(
+ PolicyDomain domain) const;
+
private:
// Allow AsyncPolicyProvider to call Init().
friend class AsyncPolicyProvider;
- typedef base::Callback<void(scoped_ptr<PolicyBundle>)> UpdateCallback;
-
// Used by the AsyncPolicyProvider to do the initial Load(). The first load
// is also used to initialize |last_modification_time_|.
scoped_ptr<PolicyBundle> InitialLoad();
- // Registers a policy domain without triggering a policy load.
- void InitialRegisterPolicyDomain(
- scoped_refptr<const PolicyDomainDescriptor> descriptor);
-
- // Used by the AsyncPolicyProvider to install the |update_callback_|.
- // Invoked on the background thread.
- void Init(const UpdateCallback& update_callback);
-
// Cancels any pending periodic reload and posts one |delay| time units from
// now.
void ScheduleNextReload(base::TimeDelta delay);
« no previous file with comments | « no previous file | chrome/browser/policy/async_policy_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698