Index: base/files/file_path_watcher_win.cc |
diff --git a/content/common/file_path_watcher/file_path_watcher_win.cc b/base/files/file_path_watcher_win.cc |
similarity index 92% |
rename from content/common/file_path_watcher/file_path_watcher_win.cc |
rename to base/files/file_path_watcher_win.cc |
index bf24e18ce3e47d0e3c8a837142f26168295ac4e8..99fa89a7d5239e0b7624177e25925b31281f482d 100644 |
--- a/content/common/file_path_watcher/file_path_watcher_win.cc |
+++ b/base/files/file_path_watcher_win.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 "base/file_path.h" |
#include "base/file_util.h" |
@@ -14,15 +14,16 @@ |
namespace { |
-class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
- public base::win::ObjectWatcher::Delegate, |
- public MessageLoop::DestructionObserver { |
+class FilePathWatcherImpl |
+ : public base::files::FilePathWatcher::PlatformDelegate, |
+ public base::win::ObjectWatcher::Delegate, |
+ public MessageLoop::DestructionObserver { |
public: |
FilePathWatcherImpl() : delegate_(NULL), handle_(INVALID_HANDLE_VALUE) {} |
// FilePathWatcher::PlatformDelegate overrides. |
virtual bool Watch(const FilePath& path, |
- FilePathWatcher::Delegate* delegate) OVERRIDE; |
+ base::files::FilePathWatcher::Delegate* delegate) OVERRIDE; |
virtual void Cancel() OVERRIDE; |
// Deletion of the FilePathWatcher will call Cancel() to dispose of this |
@@ -52,7 +53,7 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
void CancelOnMessageLoopThread() OVERRIDE; |
// Delegate to notify upon changes. |
- scoped_refptr<FilePathWatcher::Delegate> delegate_; |
+ scoped_refptr<base::files::FilePathWatcher::Delegate> delegate_; |
// Path we're supposed to watch (passed to delegate). |
FilePath target_; |
@@ -74,8 +75,9 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl); |
}; |
-bool FilePathWatcherImpl::Watch(const FilePath& path, |
- FilePathWatcher::Delegate* delegate) { |
+bool FilePathWatcherImpl::Watch( |
+ const FilePath& path, |
+ base::files::FilePathWatcher::Delegate* delegate) { |
DCHECK(target_.value().empty()); // Can only watch one path. |
set_message_loop(base::MessageLoopProxy::CreateForCurrentThread()); |
@@ -100,8 +102,9 @@ void FilePathWatcherImpl::Cancel() { |
// Switch to the file thread if necessary so we can stop |watcher_|. |
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(); |
} |
@@ -269,6 +272,6 @@ void FilePathWatcherImpl::DestroyWatch() { |
} // namespace |
-FilePathWatcher::FilePathWatcher() { |
+base::files::FilePathWatcher::FilePathWatcher() { |
impl_ = new FilePathWatcherImpl(); |
} |