OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This module provides a way to monitor a file or directory for changes. | 5 // This module provides a way to monitor a file or directory for changes. |
6 | 6 |
7 #ifndef BASE_FILES_FILE_PATH_WATCHER_H_ | 7 #ifndef BASE_FILES_FILE_PATH_WATCHER_H_ |
8 #define BASE_FILES_FILE_PATH_WATCHER_H_ | 8 #define BASE_FILES_FILE_PATH_WATCHER_H_ |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // Stop watching. This is only called on the thread of the appropriate | 56 // Stop watching. This is only called on the thread of the appropriate |
57 // message loop. Since it can also be called more than once, it should | 57 // message loop. Since it can also be called more than once, it should |
58 // check |is_cancelled()| to avoid duplicate work. | 58 // check |is_cancelled()| to avoid duplicate work. |
59 virtual void CancelOnMessageLoopThread() = 0; | 59 virtual void CancelOnMessageLoopThread() = 0; |
60 | 60 |
61 scoped_refptr<base::MessageLoopProxy> message_loop() const { | 61 scoped_refptr<base::MessageLoopProxy> message_loop() const { |
62 return message_loop_; | 62 return message_loop_; |
63 } | 63 } |
64 | 64 |
65 void set_message_loop(base::MessageLoopProxy* loop) { | 65 void set_message_loop(const scoped_refptr<base::MessageLoopProxy>& loop) { |
66 message_loop_ = loop; | 66 message_loop_ = loop; |
67 } | 67 } |
68 | 68 |
69 // Must be called before the PlatformDelegate is deleted. | 69 // Must be called before the PlatformDelegate is deleted. |
70 void set_cancelled() { | 70 void set_cancelled() { |
71 cancelled_ = true; | 71 cancelled_ = true; |
72 } | 72 } |
73 | 73 |
74 bool is_cancelled() const { | 74 bool is_cancelled() const { |
75 return cancelled_; | 75 return cancelled_; |
(...skipping 26 matching lines...) Expand all Loading... |
102 | 102 |
103 private: | 103 private: |
104 scoped_refptr<PlatformDelegate> impl_; | 104 scoped_refptr<PlatformDelegate> impl_; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(FilePathWatcher); | 106 DISALLOW_COPY_AND_ASSIGN(FilePathWatcher); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace base | 109 } // namespace base |
110 | 110 |
111 #endif // BASE_FILES_FILE_PATH_WATCHER_H_ | 111 #endif // BASE_FILES_FILE_PATH_WATCHER_H_ |
OLD | NEW |