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 081698f8df12daed09679dfa880445cd370c9ea5..d7ce5248a3a372f9d9fc0349e78174c994871776 100644 |
--- a/base/files/file_path_watcher_win.cc |
+++ b/base/files/file_path_watcher_win.cc |
@@ -10,7 +10,7 @@ |
#include "base/files/file_util.h" |
#include "base/logging.h" |
#include "base/memory/ref_counted.h" |
-#include "base/thread_task_runner_handle.h" |
+#include "base/message_loop/message_loop_proxy.h" |
#include "base/time/time.h" |
#include "base/win/object_watcher.h" |
@@ -57,7 +57,7 @@ |
// Destroy the watch handle. |
void DestroyWatch(); |
- // Cleans up and stops observing the |task_runner_| thread. |
+ // Cleans up and stops observing the |message_loop_| thread. |
void CancelOnMessageLoopThread() override; |
// Callback to notify upon changes. |
@@ -91,7 +91,7 @@ |
const FilePathWatcher::Callback& callback) { |
DCHECK(target_.value().empty()); // Can only watch one path. |
- set_task_runner(ThreadTaskRunnerHandle::Get()); |
+ set_message_loop(MessageLoopProxy::current()); |
callback_ = callback; |
target_ = path; |
recursive_watch_ = recursive; |
@@ -113,22 +113,23 @@ |
void FilePathWatcherImpl::Cancel() { |
if (callback_.is_null()) { |
- // Watch was never called, or the |task_runner_| has already quit. |
+ // Watch was never called, or the |message_loop_| has already quit. |
set_cancelled(); |
return; |
} |
// Switch to the file thread if necessary so we can stop |watcher_|. |
- if (!task_runner()->BelongsToCurrentThread()) { |
- task_runner()->PostTask(FROM_HERE, Bind(&FilePathWatcher::CancelWatch, |
- make_scoped_refptr(this))); |
+ if (!message_loop()->BelongsToCurrentThread()) { |
+ message_loop()->PostTask(FROM_HERE, |
+ Bind(&FilePathWatcher::CancelWatch, |
+ make_scoped_refptr(this))); |
} else { |
CancelOnMessageLoopThread(); |
} |
} |
void FilePathWatcherImpl::CancelOnMessageLoopThread() { |
- DCHECK(task_runner()->BelongsToCurrentThread()); |
+ DCHECK(message_loop()->BelongsToCurrentThread()); |
set_cancelled(); |
if (handle_ != INVALID_HANDLE_VALUE) |