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

Unified Diff: chrome/browser/policy/file_based_policy_loader.cc

Issue 8467011: Include only policy definitions that apply to the platfrom in the policy definition list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed dead declarations. 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/file_based_policy_loader.cc
diff --git a/chrome/browser/policy/file_based_policy_loader.cc b/chrome/browser/policy/file_based_policy_loader.cc
index c7a86917c775df458147ce198e362e620a7b2f9d..343e320f6aa4f4baf44d0a77df3a2343c60b9146 100644
--- a/chrome/browser/policy/file_based_policy_loader.cc
+++ b/chrome/browser/policy/file_based_policy_loader.cc
@@ -61,7 +61,7 @@ class FileBasedPolicyWatcherDelegate : public FilePathWatcher::Delegate {
void FileBasedPolicyLoader::OnFilePathChanged(
const FilePath& path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- Reload();
+ Reload(false);
}
void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) {
@@ -69,7 +69,7 @@ void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) {
<< " failed.";
}
-void FileBasedPolicyLoader::Reload() {
+void FileBasedPolicyLoader::Reload(bool force) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
if (!delegate())
@@ -78,7 +78,7 @@ void FileBasedPolicyLoader::Reload() {
// Check the directory time in order to see whether a reload is required.
base::TimeDelta delay;
base::Time now = base::Time::Now();
- if (!IsSafeToReloadPolicy(now, &delay)) {
+ if (!force && !IsSafeToReloadPolicy(now, &delay)) {
ScheduleReloadTask(delay);
return;
}
@@ -87,7 +87,7 @@ void FileBasedPolicyLoader::Reload() {
scoped_ptr<DictionaryValue> new_policy(delegate()->Load());
// Check again in case the directory has changed while reading it.
- if (!IsSafeToReloadPolicy(now, &delay)) {
+ if (!force && !IsSafeToReloadPolicy(now, &delay)) {
ScheduleReloadTask(delay);
return;
}
@@ -109,7 +109,7 @@ void FileBasedPolicyLoader::InitOnFileThread() {
// There might have been changes to the directory in the time between
// construction of the loader and initialization of the watcher. Call reload
// to detect if that is the case.
- Reload();
+ Reload(false);
ScheduleFallbackReloadTask();
}
« no previous file with comments | « chrome/browser/policy/file_based_policy_loader.h ('k') | chrome/browser/policy/file_based_policy_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698