| 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 // 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 CONTENT_COMMON_FILE_PATH_WATCHER_FILE_PATH_WATCHER_H_ | 7 #ifndef BASE_FILES_FILE_PATH_WATCHER_H_ |
| 8 #define CONTENT_COMMON_FILE_PATH_WATCHER_FILE_PATH_WATCHER_H_ | 8 #define BASE_FILES_FILE_PATH_WATCHER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 15 | 15 |
| 16 namespace base { |
| 17 namespace files { |
| 18 |
| 16 // This class lets you register interest in changes on a FilePath. | 19 // This class lets you register interest in changes on a FilePath. |
| 17 // The delegate will get called whenever the file or directory referenced by the | 20 // The delegate will get called whenever the file or directory referenced by the |
| 18 // FilePath is changed, including created or deleted. Due to limitations in the | 21 // FilePath is changed, including created or deleted. Due to limitations in the |
| 19 // underlying OS APIs, FilePathWatcher has slightly different semantics on OS X | 22 // underlying OS APIs, FilePathWatcher has slightly different semantics on OS X |
| 20 // than on Windows or Linux. FilePathWatcher on Linux and Windows will detect | 23 // than on Windows or Linux. FilePathWatcher on Linux and Windows will detect |
| 21 // modifications to files in a watched directory. FilePathWatcher on Mac will | 24 // modifications to files in a watched directory. FilePathWatcher on Mac will |
| 22 // detect the creation and deletion of files in a watched directory, but will | 25 // detect the creation and deletion of files in a watched directory, but will |
| 23 // not detect modifications to those files. See file_path_watcher_mac.cc for | 26 // not detect modifications to those files. See file_path_watcher_mac.cc for |
| 24 // details. | 27 // details. |
| 25 class FilePathWatcher { | 28 class FilePathWatcher { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 scoped_refptr<base::MessageLoopProxy> message_loop_; | 115 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 113 bool cancelled_; | 116 bool cancelled_; |
| 114 }; | 117 }; |
| 115 | 118 |
| 116 private: | 119 private: |
| 117 scoped_refptr<PlatformDelegate> impl_; | 120 scoped_refptr<PlatformDelegate> impl_; |
| 118 | 121 |
| 119 DISALLOW_COPY_AND_ASSIGN(FilePathWatcher); | 122 DISALLOW_COPY_AND_ASSIGN(FilePathWatcher); |
| 120 }; | 123 }; |
| 121 | 124 |
| 122 #endif // CONTENT_COMMON_FILE_PATH_WATCHER_FILE_PATH_WATCHER_H_ | 125 } // namespace files |
| 126 } // namespace base |
| 127 |
| 128 #endif // BASE_FILES_FILE_PATH_WATCHER_H_ |
| OLD | NEW |