summaryrefslogtreecommitdiffstats
path: root/base/files/file_path_watcher_linux.cc
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 00:36:39 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 00:36:39 +0000
commit66a5940fbfc857691cef0cac9e201f6b3414007d (patch)
tree67b3c03d201dccababf08f31c24ac8fdd414b764 /base/files/file_path_watcher_linux.cc
parentef442aa72df5c6fcd3da8921e365098f1b39f492 (diff)
downloadchromium_src-66a5940fbfc857691cef0cac9e201f6b3414007d.zip
chromium_src-66a5940fbfc857691cef0cac9e201f6b3414007d.tar.gz
chromium_src-66a5940fbfc857691cef0cac9e201f6b3414007d.tar.bz2
(1) Added a recursive boolean param to FilePathWatcher::Watch() function to watch for sub directory tree changes. Fixed all the calling sites.
(2) Added support to watch sub trees on Windows. (3) Added FilePathWatcherTest.RecursiveWatch browser test. BUG=144491 TEST=none Review URL: https://chromiumcodereview.appspot.com/11415066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/files/file_path_watcher_linux.cc')
-rw-r--r--base/files/file_path_watcher_linux.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc
index b4a7136..9e55022 100644
--- a/base/files/file_path_watcher_linux.cc
+++ b/base/files/file_path_watcher_linux.cc
@@ -100,6 +100,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,
+ bool recursive,
FilePathWatcher::Delegate* delegate) OVERRIDE;
// Cancel the watch. This unregisters the instance with InotifyReader.
@@ -361,9 +362,15 @@ void FilePathWatcherImpl::OnFilePathChanged(InotifyReader::Watch fired_watch,
}
bool FilePathWatcherImpl::Watch(const FilePath& path,
+ bool recursive,
FilePathWatcher::Delegate* delegate) {
DCHECK(target_.empty());
DCHECK(MessageLoopForIO::current());
+ if (recursive) {
+ // Recursive watch is not supported on this platform.
+ NOTIMPLEMENTED();
+ return false;
+ }
set_message_loop(base::MessageLoopProxy::current());
delegate_ = delegate;