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

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

Issue 2517323002: Remove destruction observer from base::FilePathWatcherKQueue. (Closed)
Patch Set: document that this must be called from a thread that supports FileDescriptorWatcher Created 4 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
« no previous file with comments | « no previous file | base/files/file_path_watcher_kqueue.h » ('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) 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // A callback that always cleans up the PlatformDelegate, either when executed 84 // A callback that always cleans up the PlatformDelegate, either when executed
85 // or when deleted without having been executed at all, as can happen during 85 // or when deleted without having been executed at all, as can happen during
86 // shutdown. 86 // shutdown.
87 static void CancelWatch(const scoped_refptr<PlatformDelegate>& delegate); 87 static void CancelWatch(const scoped_refptr<PlatformDelegate>& delegate);
88 88
89 // Returns true if the platform and OS version support recursive watches. 89 // Returns true if the platform and OS version support recursive watches.
90 static bool RecursiveWatchAvailable(); 90 static bool RecursiveWatchAvailable();
91 91
92 // Invokes |callback| whenever updates to |path| are detected. This should be 92 // Invokes |callback| whenever updates to |path| are detected. This should be
93 // called at most once, and from a MessageLoop of TYPE_IO. Set |recursive| to 93 // called at most once. Set |recursive| to true, to watch |path| and its
94 // true, to watch |path| and its children. The callback will be invoked on 94 // children. The callback will be invoked on the same thread. Returns true on
95 // the same loop. Returns true on success. 95 // success.
96 //
97 // On POSIX, this must be called from a thread that supports
98 // FileDescriptorWatcher.
96 // 99 //
97 // Recursive watch is not supported on all platforms and file systems. 100 // Recursive watch is not supported on all platforms and file systems.
98 // Watch() will return false in the case of failure. 101 // Watch() will return false in the case of failure.
99 bool Watch(const FilePath& path, bool recursive, const Callback& callback); 102 bool Watch(const FilePath& path, bool recursive, const Callback& callback);
100 103
101 private: 104 private:
102 scoped_refptr<PlatformDelegate> impl_; 105 scoped_refptr<PlatformDelegate> impl_;
103 106
104 SequenceChecker sequence_checker_; 107 SequenceChecker sequence_checker_;
105 108
106 DISALLOW_COPY_AND_ASSIGN(FilePathWatcher); 109 DISALLOW_COPY_AND_ASSIGN(FilePathWatcher);
107 }; 110 };
108 111
109 } // namespace base 112 } // namespace base
110 113
111 #endif // BASE_FILES_FILE_PATH_WATCHER_H_ 114 #endif // BASE_FILES_FILE_PATH_WATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | base/files/file_path_watcher_kqueue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698