| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 idle_task->run((deadline - base::TimeTicks()).InSecondsF()); | 88 idle_task->run((deadline - base::TimeTicks()).InSecondsF()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void WebThreadBase::postIdleTask(const blink::WebTraceLocation& location, | 91 void WebThreadBase::postIdleTask(const blink::WebTraceLocation& location, |
| 92 IdleTask* idle_task) { | 92 IdleTask* idle_task) { |
| 93 GetIdleTaskRunner()->PostIdleTask( | 93 GetIdleTaskRunner()->PostIdleTask( |
| 94 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, | 94 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, |
| 95 base::Passed(base::WrapUnique(idle_task)))); | 95 base::Passed(base::WrapUnique(idle_task)))); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void WebThreadBase::postIdleTaskAfterWakeup( | |
| 99 const blink::WebTraceLocation& location, | |
| 100 IdleTask* idle_task) { | |
| 101 GetIdleTaskRunner()->PostIdleTaskAfterWakeup( | |
| 102 location, base::Bind(&WebThreadBase::RunWebThreadIdleTask, | |
| 103 base::Passed(base::WrapUnique(idle_task)))); | |
| 104 } | |
| 105 | |
| 106 bool WebThreadBase::isCurrentThread() const { | 98 bool WebThreadBase::isCurrentThread() const { |
| 107 return GetTaskRunner()->BelongsToCurrentThread(); | 99 return GetTaskRunner()->BelongsToCurrentThread(); |
| 108 } | 100 } |
| 109 | 101 |
| 110 } // namespace scheduler | 102 } // namespace scheduler |
| 111 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |