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

Unified Diff: base/files/file_path_watcher.h

Issue 2438913003: Require FilePathWatcher destructor to be called in sequence with Watch(). (Closed)
Patch Set: CR thestig #36 (fix comment) Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/files/file_path_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path_watcher.h
diff --git a/base/files/file_path_watcher.h b/base/files/file_path_watcher.h
index 7b1483a404330c8844093aecc53b015fbc20cf40..267c03ae00b7bb8600ade73b74236d3e68e12562 100644
--- a/base/files/file_path_watcher.h
+++ b/base/files/file_path_watcher.h
@@ -12,6 +12,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
namespace base {
@@ -25,6 +26,8 @@ namespace base {
// detect the creation and deletion of files in a watched directory, but will
// not detect modifications to those files. See file_path_watcher_kqueue.cc for
// details.
+//
+// Must be destroyed on the sequence that invokes Watch().
class BASE_EXPORT FilePathWatcher {
public:
// Callback type for Watch(). |path| points to the file that was updated,
@@ -76,7 +79,7 @@ class BASE_EXPORT FilePathWatcher {
};
FilePathWatcher();
- virtual ~FilePathWatcher();
+ ~FilePathWatcher();
// A callback that always cleans up the PlatformDelegate, either when executed
// or when deleted without having been executed at all, as can happen during
@@ -98,6 +101,8 @@ class BASE_EXPORT FilePathWatcher {
private:
scoped_refptr<PlatformDelegate> impl_;
+ SequenceChecker sequence_checker_;
+
DISALLOW_COPY_AND_ASSIGN(FilePathWatcher);
};
« no previous file with comments | « no previous file | base/files/file_path_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698