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

Unified Diff: base/files/file_path_watcher_mac.cc

Issue 6793020: Move FilePathWatcher to base/files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move OWNERS file and rebase to pick up latest changes 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
Index: base/files/file_path_watcher_mac.cc
diff --git a/content/common/file_path_watcher/file_path_watcher_mac.cc b/base/files/file_path_watcher_mac.cc
similarity index 96%
rename from content/common/file_path_watcher/file_path_watcher_mac.cc
rename to base/files/file_path_watcher_mac.cc
index eb72b9428885e24225dde2c4b7c111449b353704..4e7031473a4a974131e77616521c761061ad08a6 100644
--- a/content/common/file_path_watcher/file_path_watcher_mac.cc
+++ b/base/files/file_path_watcher_mac.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/file_path_watcher/file_path_watcher.h"
+#include "base/files/file_path_watcher.h"
#include <fcntl.h>
#include <sys/event.h>
@@ -37,9 +37,10 @@ namespace {
// detect the creation and deletion of files, just not the modification of
// files. It does however detect the attribute changes that the FSEvents impl
// would miss.
-class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate,
- public MessageLoopForIO::Watcher,
- public MessageLoop::DestructionObserver {
+class FilePathWatcherImpl
+ : public base::files::FilePathWatcher::PlatformDelegate,
+ public MessageLoopForIO::Watcher,
+ public MessageLoop::DestructionObserver {
public:
FilePathWatcherImpl() : kqueue_(-1) {}
virtual ~FilePathWatcherImpl() {}
@@ -53,7 +54,7 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate,
// FilePathWatcher::PlatformDelegate overrides.
virtual bool Watch(const FilePath& path,
- FilePathWatcher::Delegate* delegate) OVERRIDE;
+ base::files::FilePathWatcher::Delegate* delegate) OVERRIDE;
virtual void Cancel() OVERRIDE;
private:
@@ -125,7 +126,7 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate,
EventVector events_;
scoped_refptr<base::MessageLoopProxy> io_message_loop_;
MessageLoopForIO::FileDescriptorWatcher kqueue_watcher_;
- scoped_refptr<FilePathWatcher::Delegate> delegate_;
+ scoped_refptr<base::files::FilePathWatcher::Delegate> delegate_;
FilePath target_;
int kqueue_;
@@ -413,8 +414,9 @@ void FilePathWatcherImpl::WillDestroyCurrentMessageLoop() {
CancelOnMessageLoopThread();
}
-bool FilePathWatcherImpl::Watch(const FilePath& path,
- FilePathWatcher::Delegate* delegate) {
+bool FilePathWatcherImpl::Watch(
+ const FilePath& path,
+ base::files::FilePathWatcher::Delegate* delegate) {
DCHECK(MessageLoopForIO::current());
DCHECK(target_.value().empty()); // Can only watch one path.
DCHECK(delegate);
@@ -482,6 +484,6 @@ void FilePathWatcherImpl::CancelOnMessageLoopThread() {
} // namespace
-FilePathWatcher::FilePathWatcher() {
+base::files::FilePathWatcher::FilePathWatcher() {
impl_ = new FilePathWatcherImpl();
}

Powered by Google App Engine
This is Rietveld 408576698