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

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

Issue 6825063: Patch for bug 74983 (among others) to be applied to M11 696 branch. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/696/src
Patch Set: intentionally disabled mac tests. tested by hand. Created 9 years, 8 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.h » ('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 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
« no previous file with comments | « chrome/browser/policy/file_based_policy_loader.h ('k') | chrome/browser/user_style_sheet_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698