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

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

Issue 8586030: Added ConfigurationPolicyProvider::RefreshPolicies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years, 1 month 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/asynchronous_policy_provider.h
diff --git a/chrome/browser/policy/asynchronous_policy_provider.h b/chrome/browser/policy/asynchronous_policy_provider.h
index b0dbed3ac3876545c5679b17150f01543fca4638..79720e9ebe9c350c162a42866912e5a33451a3a6 100644
--- a/chrome/browser/policy/asynchronous_policy_provider.h
+++ b/chrome/browser/policy/asynchronous_policy_provider.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "chrome/browser/policy/configuration_policy_provider.h"
@@ -37,17 +38,31 @@ class AsynchronousPolicyProvider
scoped_refptr<AsynchronousPolicyLoader> loader);
virtual ~AsynchronousPolicyProvider();
- // Force a policy reload from the underlying data source.
- void ForceReload();
-
- protected:
// ConfigurationPolicyProvider implementation.
virtual bool ProvideInternal(PolicyMap* map) OVERRIDE;
+ virtual void RefreshPolicies() OVERRIDE;
+
+ private:
+ // Used to trigger a Reload on |loader| on the FILE thread.
+ static void PostReloadOnFileThread(AsynchronousPolicyLoader* loader);
+
+ // Used to notify UI that a reload task has been submitted.
+ void OnReloadPosted();
+
+ // Callback from the loader. This is invoked whenever the loader has completed
+ // a reload of the policies.
+ void OnLoaderReloaded();
// The loader object used internally.
scoped_refptr<AsynchronousPolicyLoader> loader_;
- private:
+ // Number of refreshes requested whose reload is still pending. Used to only
+ // fire notifications when all pending refreshes are done.
+ int pending_refreshes_;
+
+ // Used to post tasks to self on UI.
+ base::WeakPtrFactory<AsynchronousPolicyProvider> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyProvider);
};
« no previous file with comments | « chrome/browser/policy/asynchronous_policy_loader_unittest.cc ('k') | chrome/browser/policy/asynchronous_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698