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

Unified Diff: chrome/browser/policy/cloud/component_cloud_policy_updater.h

Issue 13792003: Switch ComponentCloudPolicyUpdater to ExternalPolicyDataUpdater backend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed copy&paste mistake that tripped up clang. Created 7 years, 8 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/cloud/component_cloud_policy_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | chrome/browser/policy/cloud/component_cloud_policy_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698