Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Unified Diff: chrome/browser/policy/file_based_policy_loader.cc

Issue 6731064: kqueue implementation of FilePathWatcher on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up parens Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/file_based_policy_loader.h ('k') | chrome/browser/user_style_sheet_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c12bbcf15264ef9c9982ba025689015152eacca6..a127a71cf43edd954de4bf099c95bd20e90b6470 100644
--- a/chrome/browser/policy/file_based_policy_loader.cc
+++ b/chrome/browser/policy/file_based_policy_loader.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/policy/file_based_policy_loader.h"
+#include "base/compiler_specific.h"
#include "content/browser/browser_thread.h"
namespace {
@@ -39,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:
@@ -58,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.";
}
@@ -94,12 +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),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))) {
- 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
« no previous file with comments | « chrome/browser/policy/file_based_policy_loader.h ('k') | chrome/browser/user_style_sheet_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698