| 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 343e320f6aa4f4baf44d0a77df3a2343c60b9146..9148d11f82c2de0c9eb6339e6e2fd6ac6f7cf886 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(false);
|
| + Reload(default_callback(), false);
|
| }
|
|
|
| void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) {
|
| @@ -69,17 +69,19 @@ void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) {
|
| << " failed.";
|
| }
|
|
|
| -void FileBasedPolicyLoader::Reload(bool force) {
|
| +void FileBasedPolicyLoader::Reload(const base::Closure& callback, bool force) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
|
|
| - if (!delegate())
|
| + if (!delegate()) {
|
| + PostUpdatePolicyTask(callback, NULL);
|
| return;
|
| + }
|
|
|
| // Check the directory time in order to see whether a reload is required.
|
| base::TimeDelta delay;
|
| base::Time now = base::Time::Now();
|
| if (!force && !IsSafeToReloadPolicy(now, &delay)) {
|
| - ScheduleReloadTask(delay);
|
| + ScheduleReloadTask(callback, delay);
|
| return;
|
| }
|
|
|
| @@ -88,11 +90,11 @@ void FileBasedPolicyLoader::Reload(bool force) {
|
|
|
| // Check again in case the directory has changed while reading it.
|
| if (!force && !IsSafeToReloadPolicy(now, &delay)) {
|
| - ScheduleReloadTask(delay);
|
| + ScheduleReloadTask(callback, delay);
|
| return;
|
| }
|
|
|
| - PostUpdatePolicyTask(new_policy.release());
|
| + PostUpdatePolicyTask(callback, new_policy.release());
|
|
|
| ScheduleFallbackReloadTask();
|
| }
|
| @@ -109,7 +111,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(false);
|
| + Reload(default_callback(), false);
|
|
|
| ScheduleFallbackReloadTask();
|
| }
|
|
|