summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-14 13:27:33 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-14 13:27:33 +0000
commit5ef470813bb6555f3906f45ab4a0c537f576f057 (patch)
tree3aea448126d9a93c60738817f8fe0f470eb146e2
parentec08a82767b96b50644248dc97711f99037d19b0 (diff)
downloadchromium_src-5ef470813bb6555f3906f45ab4a0c537f576f057.zip
chromium_src-5ef470813bb6555f3906f45ab4a0c537f576f057.tar.gz
chromium_src-5ef470813bb6555f3906f45ab4a0c537f576f057.tar.bz2
Fix policy refresh.
BUG=none TEST=change linux policy and check that it's refreshed Review URL: http://codereview.chromium.org/5732002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69126 0039d316-1c4b-4281-b951-d872f2087c98
-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.