| Index: base/files/file_path_watcher_win.cc
|
| diff --git a/base/files/file_path_watcher_win.cc b/base/files/file_path_watcher_win.cc
|
| index 6c10c12d313f2a74b55bb98596405ab98775d5e4..66acf4661dcc09c5cc217eb548e3383a38a79a83 100644
|
| --- a/base/files/file_path_watcher_win.cc
|
| +++ b/base/files/file_path_watcher_win.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/logging.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| +#include "base/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| #include "base/win/object_watcher.h"
|
|
|
| @@ -91,7 +92,7 @@ bool FilePathWatcherImpl::Watch(const FilePath& path,
|
| const FilePathWatcher::Callback& callback) {
|
| DCHECK(target_.value().empty()); // Can only watch one path.
|
|
|
| - set_message_loop(MessageLoopProxy::current());
|
| + set_task_runner(ThreadTaskRunnerHandle::Get());
|
| callback_ = callback;
|
| target_ = path;
|
| recursive_watch_ = recursive;
|
| @@ -119,17 +120,17 @@ void FilePathWatcherImpl::Cancel() {
|
| }
|
|
|
| // Switch to the file thread if necessary so we can stop |watcher_|.
|
| - if (!message_loop()->BelongsToCurrentThread()) {
|
| - message_loop()->PostTask(FROM_HERE,
|
| - Bind(&FilePathWatcher::CancelWatch,
|
| - make_scoped_refptr(this)));
|
| + if (!task_runner()->RunsTasksOnCurrentThread()) {
|
| + task_runner()->PostTask(
|
| + FROM_HERE,
|
| + Bind(&FilePathWatcher::CancelWatch, make_scoped_refptr(this)));
|
| } else {
|
| CancelOnMessageLoopThread();
|
| }
|
| }
|
|
|
| void FilePathWatcherImpl::CancelOnMessageLoopThread() {
|
| - DCHECK(message_loop()->BelongsToCurrentThread());
|
| + DCHECK(task_runner()->RunsTasksOnCurrentThread());
|
| set_cancelled();
|
|
|
| if (handle_ != INVALID_HANDLE_VALUE)
|
|
|