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

Side by Side Diff: base/files/file_path_watcher.cc

Issue 11415066: FilePathWatcher::Watch() - Listen for sub directory changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added more test cases Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Cross platform methods for FilePathWatcher. See the various platform 5 // Cross platform methods for FilePathWatcher. See the various platform
6 // specific implementation files, too. 6 // specific implementation files, too.
7 7
8 #include "base/files/file_path_watcher.h" 8 #include "base/files/file_path_watcher.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 // static 47 // static
48 void FilePathWatcher::CancelWatch( 48 void FilePathWatcher::CancelWatch(
49 const scoped_refptr<PlatformDelegate>& delegate) { 49 const scoped_refptr<PlatformDelegate>& delegate) {
50 delegate->CancelOnMessageLoopThread(); 50 delegate->CancelOnMessageLoopThread();
51 } 51 }
52 52
53 bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) { 53 bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) {
54 DCHECK(path.IsAbsolute()); 54 DCHECK(path.IsAbsolute());
55 return impl_->Watch(path, delegate); 55 return impl_->Watch(path, false, delegate);
56 } 56 }
57 57
58 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) { 58 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
59 } 59 }
60 60
61 FilePathWatcher::PlatformDelegate::~PlatformDelegate() { 61 FilePathWatcher::PlatformDelegate::~PlatformDelegate() {
62 DCHECK(is_cancelled()); 62 DCHECK(is_cancelled());
63 } 63 }
64 64
65 bool FilePathWatcher::Watch(const FilePath& path, const Callback& callback) { 65 bool FilePathWatcher::Watch(const FilePath& path,
66 return Watch(path, new FilePathWatcherDelegate(callback)); 66 bool recursive,
67 const Callback& callback) {
68 DCHECK(path.IsAbsolute());
69 return impl_->Watch(path, recursive, new FilePathWatcherDelegate(callback));
67 } 70 }
68 71
69 } // namespace files 72 } // namespace files
70 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698