| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/files/file_path_watcher.h" | 5 #include "base/files/file_path_watcher.h" |
| 6 #include "base/files/file_path_watcher_kqueue.h" | 6 #include "base/files/file_path_watcher_kqueue.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if !defined(OS_IOS) | 9 #if !defined(OS_IOS) |
| 10 #include "base/files/file_path_watcher_fsevents.h" | 10 #include "base/files/file_path_watcher_fsevents.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 DCHECK(impl_.get()); | 33 DCHECK(impl_.get()); |
| 34 return impl_->Watch(path, recursive, callback); | 34 return impl_->Watch(path, recursive, callback); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void Cancel() override { | 37 void Cancel() override { |
| 38 if (impl_.get()) | 38 if (impl_.get()) |
| 39 impl_->Cancel(); | 39 impl_->Cancel(); |
| 40 set_cancelled(); | 40 set_cancelled(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void CancelOnMessageLoopThread() override { | |
| 44 if (impl_.get()) | |
| 45 impl_->Cancel(); | |
| 46 set_cancelled(); | |
| 47 } | |
| 48 | |
| 49 protected: | 43 protected: |
| 50 ~FilePathWatcherImpl() override {} | 44 ~FilePathWatcherImpl() override {} |
| 51 | 45 |
| 52 scoped_refptr<PlatformDelegate> impl_; | 46 scoped_refptr<PlatformDelegate> impl_; |
| 53 }; | 47 }; |
| 54 | 48 |
| 55 } // namespace | 49 } // namespace |
| 56 | 50 |
| 57 FilePathWatcher::FilePathWatcher() { | 51 FilePathWatcher::FilePathWatcher() { |
| 58 impl_ = new FilePathWatcherImpl(); | 52 impl_ = new FilePathWatcherImpl(); |
| 59 } | 53 } |
| 60 | 54 |
| 61 } // namespace base | 55 } // namespace base |
| OLD | NEW |