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

Unified Diff: chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc

Issue 2518053002: Always delete media galleries FilePathWatchers on the FILE thread. (Closed)
Patch Set: fix build error 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
Index: chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc
diff --git a/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc b/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc
index 16295c999a16981a1e4be8aea330e3473538a13e..05ca7426591375dbc7a4219d45cfdeb0da47e96c 100644
--- a/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc
+++ b/chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc
@@ -33,7 +33,7 @@ void StartFilePathWatchOnFileThread(
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
// The watcher is created on the FILE thread because it is very difficult
// to safely pass an already-created file watcher to a different thread.
- std::unique_ptr<base::FilePathWatcher> watcher(new base::FilePathWatcher);
+ MediaFilePathWatcherUniquePtr watcher(new base::FilePathWatcher);
bool success = watcher->Watch(
path,
false /* recursive */,
@@ -58,15 +58,3 @@ void StartFilePathWatchOnMediaTaskRunner(
watch_started_callback,
path_changed_callback));
}
-
-void StopFilePathWatchOnMediaTaskRunner(
- std::unique_ptr<base::FilePathWatcher> watcher) {
- MediaFileSystemBackend::AssertCurrentlyOnMediaSequence();
- if (watcher) {
- const bool task_posted = content::BrowserThread::DeleteSoon(
- content::BrowserThread::FILE, FROM_HERE, watcher.release());
-
- // This will fail if the FILE thread has been stopped.
- DCHECK(task_posted);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698