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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 years, 7 months 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: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
index a282c4e220ff42c15070dfb7bbfdbf2244002e4f..9ad442b6b8f7d9e4bd845b168cca6cce3e6e80b0 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
@@ -60,19 +60,19 @@ class MessageLoopTaskRunner : public TaskQueueManagerDelegateForTest {
return make_scoped_refptr(new MessageLoopTaskRunner(std::move(tick_clock)));
}
- // NestableTaskRunner implementation.
+ // TaskQueueManagerDelegateForTest:
bool IsNested() const override {
- return base::MessageLoop::current()->IsNested();
+ DCHECK(RunsTasksOnCurrentThread());
+ return base::RunLoop::IsNestedOnCurrentThread();
}
- void AddNestingObserver(
- base::MessageLoop::NestingObserver* observer) override {
- base::MessageLoop::current()->AddNestingObserver(observer);
+ void AddNestingObserver(base::RunLoop::NestingObserver* observer) override {
+ base::RunLoop::AddNestingObserverOnCurrentThread(observer);
}
void RemoveNestingObserver(
- base::MessageLoop::NestingObserver* observer) override {
- base::MessageLoop::current()->RemoveNestingObserver(observer);
+ base::RunLoop::NestingObserver* observer) override {
+ base::RunLoop::RemoveNestingObserverOnCurrentThread(observer);
}
private:
@@ -1251,7 +1251,7 @@ TEST_F(TaskQueueManagerTest, DelayedTaskDoesNotSkipAHeadOfShorterDelayedTask) {
}
void CheckIsNested(bool* is_nested) {
- *is_nested = base::MessageLoop::current()->IsNested();
+ *is_nested = base::RunLoop::IsNestedOnCurrentThread();
}
void PostAndQuitFromNestedRunloop(base::RunLoop* run_loop,

Powered by Google App Engine
This is Rietveld 408576698