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 cc89d13e684f4145933fe20b05ac1778cdfbefe7..a127a71cf43edd954de4bf099c95bd20e90b6470 100644 |
--- a/chrome/browser/policy/file_based_policy_loader.cc |
+++ b/chrome/browser/policy/file_based_policy_loader.cc |
@@ -1,9 +1,12 @@ |
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
#include "chrome/browser/policy/file_based_policy_loader.h" |
+#include "base/compiler_specific.h" |
+#include "content/browser/browser_thread.h" |
+ |
namespace { |
// Amount of time we wait for the files on disk to settle before trying to load |
@@ -37,12 +40,12 @@ class FileBasedPolicyWatcherDelegate : public FilePathWatcher::Delegate { |
virtual ~FileBasedPolicyWatcherDelegate() {} |
// FilePathWatcher::Delegate implementation: |
- void OnFilePathChanged(const FilePath& path) { |
+ virtual void OnFilePathChanged(const FilePath& path) OVERRIDE { |
loader_->OnFilePathChanged(path); |
} |
- void OnError() { |
- loader_->OnError(); |
+ virtual void OnFilePathError(const FilePath& path) OVERRIDE { |
+ loader_->OnFilePathError(path); |
} |
private: |
@@ -56,8 +59,8 @@ void FileBasedPolicyLoader::OnFilePathChanged( |
Reload(); |
} |
-void FileBasedPolicyLoader::OnError() { |
- LOG(ERROR) << "FilePathWatcher on " << config_file_path().value() |
+void FileBasedPolicyLoader::OnFilePathError(const FilePath& path) { |
+ LOG(ERROR) << "FilePathWatcher on " << path.value() |
<< " failed."; |
} |
@@ -92,10 +95,10 @@ void FileBasedPolicyLoader::Reload() { |
void FileBasedPolicyLoader::InitOnFileThread() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
watcher_.reset(new FilePathWatcher); |
- if (!config_file_path().empty() && |
- !watcher_->Watch(config_file_path(), |
- new FileBasedPolicyWatcherDelegate(this))) { |
- OnError(); |
+ const FilePath& path = config_file_path(); |
+ if (!path.empty() && |
+ !watcher_->Watch(path, new FileBasedPolicyWatcherDelegate(this))) { |
+ OnFilePathError(path); |
} |
// There might have been changes to the directory in the time between |