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