| Index: chrome/browser/policy/cloud/component_cloud_policy_updater.h
|
| diff --git a/chrome/browser/policy/cloud/component_cloud_policy_updater.h b/chrome/browser/policy/cloud/component_cloud_policy_updater.h
|
| index ba9ec850945cb77e4668ef91e51ea4bec094d5de..a101cb4a345127f730cdcd8edba64c3921d706e5 100644
|
| --- a/chrome/browser/policy/cloud/component_cloud_policy_updater.h
|
| +++ b/chrome/browser/policy/cloud/component_cloud_policy_updater.h
|
| @@ -5,15 +5,10 @@
|
| #ifndef CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
|
| #define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_UPDATER_H_
|
|
|
| -#include <map>
|
| -#include <queue>
|
| -
|
| #include "base/basictypes.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "base/memory/weak_ptr.h"
|
| -#include "base/threading/non_thread_safe.h"
|
| -#include "chrome/browser/policy/policy_service.h"
|
| +#include "chrome/browser/policy/cloud/external_policy_data_updater.h"
|
|
|
| namespace base {
|
| class SequencedTaskRunner;
|
| @@ -36,7 +31,7 @@ class ComponentCloudPolicyStore;
|
| // them in a ComponentCloudPolicyStore. It also enforces size limits on what's
|
| // cached.
|
| // It retries to download the policy data periodically when a download fails.
|
| -class ComponentCloudPolicyUpdater : public base::NonThreadSafe {
|
| +class ComponentCloudPolicyUpdater {
|
| public:
|
| // |task_runner| must support file I/O, and is used to post delayed retry
|
| // tasks.
|
| @@ -57,40 +52,8 @@ class ComponentCloudPolicyUpdater : public base::NonThreadSafe {
|
| scoped_ptr<enterprise_management::PolicyFetchResponse> response);
|
|
|
| private:
|
| - class FetchJob;
|
| - typedef std::map<PolicyNamespace, FetchJob*> FetchJobMap;
|
| -
|
| - // Starts |job| if the job queue is empty, otherwise schedules it.
|
| - void ScheduleJob(FetchJob* job);
|
| -
|
| - // Appends |job| to the |job_queue_|, and starts it immediately if it's the
|
| - // only scheduled job.
|
| - void StartNextJob();
|
| -
|
| - // Callback for jobs that succeeded.
|
| - void OnJobSucceeded(FetchJob* job);
|
| -
|
| - // Callback for jobs that failed.
|
| - void OnJobFailed(FetchJob* job);
|
| -
|
| - scoped_refptr<base::SequencedTaskRunner> task_runner_;
|
| - scoped_refptr<net::URLRequestContextGetter> request_context_;
|
| ComponentCloudPolicyStore* store_;
|
| -
|
| - // Map of jobs that have been scheduled and haven't succeeded yet. Failing
|
| - // jobs stay in |fetch_jobs_|, and may have retries scheduled in the future.
|
| - // This map owns all the currently existing jobs.
|
| - FetchJobMap fetch_jobs_;
|
| -
|
| - // Queue of jobs to start as soon as possible. Each job starts once the
|
| - // previous job completes, to avoid starting too many downloads in parallel
|
| - // at once. The job at the front of the queue is the currently executing
|
| - // job, and will call OnJobSucceeded or OnJobFailed.
|
| - std::queue<base::WeakPtr<FetchJob> > job_queue_;
|
| -
|
| - // True once the destructor enters. Prevents jobs from being scheduled during
|
| - // shutdown.
|
| - bool shutting_down_;
|
| + ExternalPolicyDataUpdater external_policy_data_updater_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ComponentCloudPolicyUpdater);
|
| };
|
|
|