OLD | NEW |
---|---|
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 FilePathWatcher::~FilePathWatcher() { | 43 FilePathWatcher::~FilePathWatcher() { |
44 impl_->Cancel(); | 44 impl_->Cancel(); |
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, bool recursive, |
Mattias Nissler (ping if slow)
2012/11/21 09:28:48
parameter decls on separate lines
kmadhusu
2012/11/22 01:39:41
Done.
| |
54 Delegate* delegate) { | |
54 DCHECK(path.IsAbsolute()); | 55 DCHECK(path.IsAbsolute()); |
55 return impl_->Watch(path, delegate); | 56 return impl_->Watch(path, recursive, delegate); |
56 } | 57 } |
57 | 58 |
58 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) { | 59 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) { |
59 } | 60 } |
60 | 61 |
61 FilePathWatcher::PlatformDelegate::~PlatformDelegate() { | 62 FilePathWatcher::PlatformDelegate::~PlatformDelegate() { |
62 DCHECK(is_cancelled()); | 63 DCHECK(is_cancelled()); |
63 } | 64 } |
64 | 65 |
65 bool FilePathWatcher::Watch(const FilePath& path, const Callback& callback) { | 66 bool FilePathWatcher::Watch(const FilePath& path, bool recursive, |
Mattias Nissler (ping if slow)
2012/11/21 09:28:48
ditto
kmadhusu
2012/11/22 01:39:41
Done.
| |
66 return Watch(path, new FilePathWatcherDelegate(callback)); | 67 const Callback& callback) { |
68 return Watch(path, recursive, new FilePathWatcherDelegate(callback)); | |
67 } | 69 } |
68 | 70 |
69 } // namespace files | 71 } // namespace files |
70 } // namespace base | 72 } // namespace base |
OLD | NEW |