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

Unified Diff: content/common/file_path_watcher/file_path_watcher.cc

Issue 6697020: Fixed shutdown concurrency issues in FilePathWatcher. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Introduced CancelTask to simplify cleanup. Created 9 years, 9 months 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
Index: content/common/file_path_watcher/file_path_watcher.cc
diff --git a/content/common/file_path_watcher/file_path_watcher.cc b/content/common/file_path_watcher/file_path_watcher.cc
index 19cee5fdea6995a65983945e6bdfbf3c85ca96d3..f40c8c85d4e6593ba1652d8d83d1f0e465ac919f 100644
--- a/content/common/file_path_watcher/file_path_watcher.cc
+++ b/content/common/file_path_watcher/file_path_watcher.cc
@@ -21,19 +21,10 @@ bool FilePathWatcher::Watch(const FilePath& path,
return impl_->Watch(path, delegate, loop);
}
-FilePathWatcher::PlatformDelegate::PlatformDelegate() {
+FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
}
FilePathWatcher::PlatformDelegate::~PlatformDelegate() {
+ DCHECK(is_cancelled());
}
-void FilePathWatcher::DeletePlatformDelegate::Destruct(
- const PlatformDelegate* delegate) {
- scoped_refptr<base::MessageLoopProxy> loop = delegate->message_loop();
- if (loop.get() == NULL || loop->BelongsToCurrentThread()) {
- delete delegate;
- } else {
- loop->PostNonNestableTask(FROM_HERE,
- new DeleteTask<PlatformDelegate>(delegate));
- }
-}

Powered by Google App Engine
This is Rietveld 408576698