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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc

Issue 2959613002: Rename TaskRunner::RunsTasksOnCurrentThread() in //third_party (Closed)
Patch Set: Remove comments Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests .h" 5 #include "platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests .h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return original_task_runner_->PostNonNestableDelayedTask( 84 return original_task_runner_->PostNonNestableDelayedTask(
85 from_here, std::move(task), delay); 85 from_here, std::move(task), delay);
86 } 86 }
87 87
88 bool LazySchedulerMessageLoopDelegateForTests::RunsTasksInCurrentSequence() 88 bool LazySchedulerMessageLoopDelegateForTests::RunsTasksInCurrentSequence()
89 const { 89 const {
90 return thread_id_ == base::PlatformThread::CurrentId(); 90 return thread_id_ == base::PlatformThread::CurrentId();
91 } 91 }
92 92
93 bool LazySchedulerMessageLoopDelegateForTests::IsNested() const { 93 bool LazySchedulerMessageLoopDelegateForTests::IsNested() const {
94 DCHECK(RunsTasksOnCurrentThread()); 94 DCHECK(RunsTasksInCurrentSequence());
95 EnsureMessageLoop(); 95 EnsureMessageLoop();
96 return base::RunLoop::IsNestedOnCurrentThread(); 96 return base::RunLoop::IsNestedOnCurrentThread();
97 } 97 }
98 98
99 void LazySchedulerMessageLoopDelegateForTests::AddNestingObserver( 99 void LazySchedulerMessageLoopDelegateForTests::AddNestingObserver(
100 base::RunLoop::NestingObserver* observer) { 100 base::RunLoop::NestingObserver* observer) {
101 // While |observer| _could_ be associated with the current thread regardless 101 // While |observer| _could_ be associated with the current thread regardless
102 // of the presence of a MessageLoop, the association is delayed until 102 // of the presence of a MessageLoop, the association is delayed until
103 // EnsureMessageLoop() is invoked. This works around a state issue where 103 // EnsureMessageLoop() is invoked. This works around a state issue where
104 // otherwise many tests fail because of the following sequence: 104 // otherwise many tests fail because of the following sequence:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 base::RunLoop::RemoveNestingObserverOnCurrentThread(observer); 138 base::RunLoop::RemoveNestingObserverOnCurrentThread(observer);
139 } 139 }
140 140
141 base::TimeTicks LazySchedulerMessageLoopDelegateForTests::NowTicks() { 141 base::TimeTicks LazySchedulerMessageLoopDelegateForTests::NowTicks() {
142 return time_source_->NowTicks(); 142 return time_source_->NowTicks();
143 } 143 }
144 144
145 } // namespace scheduler 145 } // namespace scheduler
146 } // namespace blink 146 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698