OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // An implementation of WebThread in terms of base::MessageLoop and | 5 // An implementation of WebThread in terms of base::MessageLoop and |
6 // base::Thread | 6 // base::Thread |
7 | 7 |
8 #include "public/platform/scheduler/child/webthread_base.h" | 8 #include "public/platform/scheduler/child/webthread_base.h" |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 idle_task->run((deadline - base::TimeTicks()).InSecondsF()); | 80 idle_task->run((deadline - base::TimeTicks()).InSecondsF()); |
81 } | 81 } |
82 | 82 |
83 void WebThreadBase::postIdleTask(const blink::WebTraceLocation& location, | 83 void WebThreadBase::postIdleTask(const blink::WebTraceLocation& location, |
84 IdleTask* idle_task) { | 84 IdleTask* idle_task) { |
85 GetIdleTaskRunner()->PostIdleTask( | 85 GetIdleTaskRunner()->PostIdleTask( |
86 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, | 86 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, |
87 base::Passed(base::WrapUnique(idle_task)))); | 87 base::Passed(base::WrapUnique(idle_task)))); |
88 } | 88 } |
89 | 89 |
90 void WebThreadBase::postIdleTaskAfterWakeup( | |
91 const blink::WebTraceLocation& location, | |
92 IdleTask* idle_task) { | |
93 GetIdleTaskRunner()->PostIdleTaskAfterWakeup( | |
94 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, | |
95 base::Passed(base::WrapUnique(idle_task)))); | |
96 } | |
97 | |
98 bool WebThreadBase::isCurrentThread() const { | 90 bool WebThreadBase::isCurrentThread() const { |
99 return GetTaskRunner()->BelongsToCurrentThread(); | 91 return GetTaskRunner()->BelongsToCurrentThread(); |
100 } | 92 } |
101 | 93 |
102 } // namespace scheduler | 94 } // namespace scheduler |
103 } // namespace blink | 95 } // namespace blink |
OLD | NEW |