summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/policy/file_based_policy_loader.cc10
-rw-r--r--chrome/browser/policy/file_based_policy_loader.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/policy/file_based_policy_loader.cc b/chrome/browser/policy/file_based_policy_loader.cc
index 947008b..5d49f98 100644
--- a/chrome/browser/policy/file_based_policy_loader.cc
+++ b/chrome/browser/policy/file_based_policy_loader.cc
@@ -58,7 +58,7 @@ void FileBasedPolicyLoader::Init() {
// the task to be forgotten. Instead, post a task to the ui thread to delay
// the remainder of initialization until threading is fully initialized.
BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
+ BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&FileBasedPolicyLoader::InitAfterFileThreadAvailable));
}
@@ -115,13 +115,11 @@ void FileBasedPolicyLoader::InitAfterFileThreadAvailable() {
if (provider()) {
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(this, &FileBasedPolicyLoader::InitWatcher));
-
- ScheduleFallbackReloadTask();
+ NewRunnableMethod(this, &FileBasedPolicyLoader::InitOnFileThread));
}
}
-void FileBasedPolicyLoader::InitWatcher() {
+void FileBasedPolicyLoader::InitOnFileThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
watcher_.reset(new FilePathWatcher);
if (!config_file_path().empty() &&
@@ -134,6 +132,8 @@ void FileBasedPolicyLoader::InitWatcher() {
// construction of the loader and initialization of the watcher. Call reload
// to detect if that is the case.
Reload();
+
+ ScheduleFallbackReloadTask();
}
void FileBasedPolicyLoader::StopOnFileThread() {
diff --git a/chrome/browser/policy/file_based_policy_loader.h b/chrome/browser/policy/file_based_policy_loader.h
index c1b32f2..f718e8d 100644
--- a/chrome/browser/policy/file_based_policy_loader.h
+++ b/chrome/browser/policy/file_based_policy_loader.h
@@ -42,9 +42,9 @@ class FileBasedPolicyLoader : public AsynchronousPolicyLoader {
// intiialized.
void InitAfterFileThreadAvailable();
- // Creates the file path watcher and configures it watch |config_file_path_|.
- // Must be called on the file thread.
- void InitWatcher();
+ // Creates the file path watcher, configures it to watch |config_file_path_|
+ // and schedules the fallback reload task. Must be called on the file thread.
+ void InitOnFileThread();
// Cancels file path watch notification and destroys the watcher.
// Must be called on file thread.