| 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);
|
|
|