Index: base/files/file_path_watcher_browsertest.cc |
diff --git a/base/files/file_path_watcher_browsertest.cc b/base/files/file_path_watcher_browsertest.cc |
index f6d6d333a0fb11f366010cdc4a2e2c7149d2c7fe..520d90b3ad524e2d927cb1ff851f516f009cf0e6 100644 |
--- a/base/files/file_path_watcher_browsertest.cc |
+++ b/base/files/file_path_watcher_browsertest.cc |
@@ -21,13 +21,14 @@ |
#include "base/files/file_util.h" |
#include "base/files/scoped_temp_dir.h" |
#include "base/message_loop/message_loop.h" |
-#include "base/message_loop/message_loop_proxy.h" |
#include "base/run_loop.h" |
+#include "base/sequenced_task_runner.h" |
#include "base/stl_util.h" |
#include "base/strings/stringprintf.h" |
#include "base/synchronization/waitable_event.h" |
#include "base/test/test_file_util.h" |
#include "base/test/test_timeouts.h" |
+#include "base/thread_task_runner_handle.h" |
#include "base/threading/thread.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -42,14 +43,14 @@ class TestDelegate; |
class NotificationCollector |
: public base::RefCountedThreadSafe<NotificationCollector> { |
public: |
- NotificationCollector() |
- : loop_(base::MessageLoopProxy::current()) {} |
+ NotificationCollector() : task_runner_(base::ThreadTaskRunnerHandle::Get()) {} |
// Called from the file thread by the delegates. |
void OnChange(TestDelegate* delegate) { |
- loop_->PostTask(FROM_HERE, |
- base::Bind(&NotificationCollector::RecordChange, this, |
- base::Unretained(delegate))); |
+ task_runner_->PostTask(FROM_HERE, |
+ base::Bind(&NotificationCollector::RecordChange, |
+ this, |
+ base::Unretained(delegate))); |
} |
void Register(TestDelegate* delegate) { |
@@ -70,13 +71,13 @@ class NotificationCollector |
void RecordChange(TestDelegate* delegate) { |
// Warning: |delegate| is Unretained. Do not dereference. |
- ASSERT_TRUE(loop_->BelongsToCurrentThread()); |
+ ASSERT_TRUE(task_runner_->RunsTasksOnCurrentThread()); |
ASSERT_TRUE(delegates_.count(delegate)); |
signaled_.insert(delegate); |
// Check whether all delegates have been signaled. |
if (signaled_ == delegates_) |
- loop_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure()); |
+ task_runner_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure()); |
} |
// Set of registered delegates. |
@@ -86,7 +87,7 @@ class NotificationCollector |
std::set<TestDelegate*> signaled_; |
// The loop we should break after all delegates signaled. |
- scoped_refptr<base::MessageLoopProxy> loop_; |
+ scoped_refptr<base::SequencedTaskRunner> task_runner_; |
}; |
class TestDelegateBase : public SupportsWeakPtr<TestDelegateBase> { |