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

Unified Diff: base/files/file_path_watcher.cc

Issue 11876025: Eliminate FilePathWatcher::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_kqueue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path_watcher.cc
diff --git a/base/files/file_path_watcher.cc b/base/files/file_path_watcher.cc
index bc8db37f1b636881348be5a46a830ec314d7d833..3802ee3a3e93d8eff8be7cce01b72d9f88766036 100644
--- a/base/files/file_path_watcher.cc
+++ b/base/files/file_path_watcher.cc
@@ -13,33 +13,6 @@
namespace base {
namespace files {
-namespace {
-
-// A delegate implementation for the callback interface.
-class FilePathWatcherDelegate : public base::files::FilePathWatcher::Delegate {
- public:
- explicit FilePathWatcherDelegate(const FilePathWatcher::Callback& callback)
- : callback_(callback) {}
-
- // FilePathWatcher::Delegate implementation.
- virtual void OnFilePathChanged(const FilePath& path) OVERRIDE {
- callback_.Run(path, false);
- }
-
- virtual void OnFilePathError(const FilePath& path) OVERRIDE {
- callback_.Run(path, true);
- }
-
- private:
- virtual ~FilePathWatcherDelegate() {}
-
- FilePathWatcher::Callback callback_;
-
- DISALLOW_COPY_AND_ASSIGN(FilePathWatcherDelegate);
-};
-
-} // namespace
-
FilePathWatcher::~FilePathWatcher() {
impl_->Cancel();
}
@@ -50,11 +23,6 @@ void FilePathWatcher::CancelWatch(
delegate->CancelOnMessageLoopThread();
}
-bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) {
- DCHECK(path.IsAbsolute());
- return impl_->Watch(path, false, delegate);
-}
-
FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
}
@@ -66,7 +34,7 @@ bool FilePathWatcher::Watch(const FilePath& path,
bool recursive,
const Callback& callback) {
DCHECK(path.IsAbsolute());
- return impl_->Watch(path, recursive, new FilePathWatcherDelegate(callback));
+ return impl_->Watch(path, recursive, callback);
}
} // namespace files
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_kqueue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698