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

Side by Side Diff: chrome/browser/media_galleries/fileapi/file_path_watcher_util.h

Issue 2438913003: Require FilePathWatcher destructor to be called in sequence with Watch(). (Closed)
Patch Set: CR dcheng #33 (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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/files/file_path_watcher.h" 12 #include "base/files/file_path_watcher.h"
13 13
14 typedef base::Callback<void(std::unique_ptr<base::FilePathWatcher> watcher)> 14 typedef base::Callback<void(std::unique_ptr<base::FilePathWatcher> watcher)>
15 FileWatchStartedCallback; 15 FileWatchStartedCallback;
16 16
17 // Called on the MediaTaskRunner to begin a file watch. 17 // Called on the MediaTaskRunner to begin a file watch.
18 // |watch_started_callback| is responsible for taking ownership of the 18 // |watch_started_callback| is responsible for taking ownership of the
19 // file watcher upon start. All callbacks are run on the MediaTaskRunner. 19 // file watcher upon start. All callbacks are run on the MediaTaskRunner.
20 void StartFilePathWatchOnMediaTaskRunner( 20 void StartFilePathWatchOnMediaTaskRunner(
21 const base::FilePath& path, 21 const base::FilePath& path,
22 const FileWatchStartedCallback& watch_started_callback, 22 const FileWatchStartedCallback& watch_started_callback,
23 const base::FilePathWatcher::Callback& path_changed_callback); 23 const base::FilePathWatcher::Callback& path_changed_callback);
24 24
25 // Stops a file path watch started by StartFilePathWatchOnMediaTaskRunner. Must
Lei Zhang 2016/11/10 18:59:31 nit: I really like to refer to functions as FuncNa
fdoray 2016/11/11 15:47:39 Done.
26 // be called from the MediaTaskRunner.
27 void StopFilePathWatchOnMediaTaskRunner(
28 std::unique_ptr<base::FilePathWatcher> watcher);
29
25 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_ 30 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_FILE_PATH_WATCHER_UTIL_H_
OLDNEW
« no previous file with comments | « base/files/file_path_watcher_win.cc ('k') | chrome/browser/media_galleries/fileapi/file_path_watcher_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698