Index: base/files/file_path_watcher_linux.cc |
diff --git a/content/common/file_path_watcher/file_path_watcher_inotify.cc b/base/files/file_path_watcher_linux.cc |
similarity index 95% |
rename from content/common/file_path_watcher/file_path_watcher_inotify.cc |
rename to base/files/file_path_watcher_linux.cc |
index f91756f6efe8d20493f849c76ac63e9f9a392756..69b9c930ed54962542bdef8e4eb0c334e865feac 100644 |
--- a/content/common/file_path_watcher/file_path_watcher_inotify.cc |
+++ b/base/files/file_path_watcher_linux.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 <errno.h> |
#include <string.h> |
@@ -80,8 +80,9 @@ class InotifyReader { |
DISALLOW_COPY_AND_ASSIGN(InotifyReader); |
}; |
-class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
- public MessageLoop::DestructionObserver { |
+class FilePathWatcherImpl |
+ : public base::files::FilePathWatcher::PlatformDelegate, |
+ public MessageLoop::DestructionObserver { |
public: |
FilePathWatcherImpl(); |
@@ -98,7 +99,7 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
// Start watching |path| for changes and notify |delegate| on each change. |
// Returns true if watch for |path| has been added successfully. |
virtual bool Watch(const FilePath& path, |
- FilePathWatcher::Delegate* delegate) OVERRIDE; |
+ base::files::FilePathWatcher::Delegate* delegate) OVERRIDE; |
// Cancel the watch. This unregisters the instance with InotifyReader. |
virtual void Cancel() OVERRIDE; |
@@ -132,7 +133,7 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
bool UpdateWatches() WARN_UNUSED_RESULT; |
// Delegate to notify upon changes. |
- scoped_refptr<FilePathWatcher::Delegate> delegate_; |
+ scoped_refptr<base::files::FilePathWatcher::Delegate> delegate_; |
// The file or directory we're supposed to watch. |
FilePath target_; |
@@ -362,8 +363,9 @@ void FilePathWatcherImpl::OnFilePathChanged( |
} |
} |
-bool FilePathWatcherImpl::Watch(const FilePath& path, |
- FilePathWatcher::Delegate* delegate) { |
+bool FilePathWatcherImpl::Watch( |
+ const FilePath& path, |
+ base::files::FilePathWatcher::Delegate* delegate) { |
DCHECK(target_.empty()); |
DCHECK(MessageLoopForIO::current()); |
@@ -393,8 +395,9 @@ void FilePathWatcherImpl::Cancel() { |
// Switch to the message_loop_ if necessary so we can access |watches_|. |
if (!message_loop()->BelongsToCurrentThread()) { |
- message_loop()->PostTask(FROM_HERE, |
- new FilePathWatcher::CancelTask(this)); |
+ message_loop()->PostTask( |
+ FROM_HERE, |
+ new base::files::FilePathWatcher::CancelTask(this)); |
} else { |
CancelOnMessageLoopThread(); |
} |
@@ -451,6 +454,6 @@ bool FilePathWatcherImpl::UpdateWatches() { |
} // namespace |
-FilePathWatcher::FilePathWatcher() { |
+base::files::FilePathWatcher::FilePathWatcher() { |
impl_ = new FilePathWatcherImpl(); |
} |