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 #include "config.h" | 5 #include "config.h" |
6 #include "platform/scheduler/Scheduler.h" | 6 #include "platform/scheduler/Scheduler.h" |
7 | 7 |
8 #include "public/platform/Platform.h" | 8 #include "public/platform/Platform.h" |
9 #include "public/platform/WebScheduler.h" | 9 #include "public/platform/WebScheduler.h" |
10 #include "public/platform/WebTraceLocation.h" | 10 #include "public/platform/WebTraceLocation.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 s_sharedScheduler = scheduler; | 53 s_sharedScheduler = scheduler; |
54 } | 54 } |
55 | 55 |
56 Scheduler::Scheduler(WebScheduler* webScheduler) | 56 Scheduler::Scheduler(WebScheduler* webScheduler) |
57 : m_webScheduler(webScheduler) | 57 : m_webScheduler(webScheduler) |
58 { | 58 { |
59 } | 59 } |
60 | 60 |
61 Scheduler::~Scheduler() | 61 Scheduler::~Scheduler() |
62 { | 62 { |
63 if (m_webScheduler) | |
64 m_webScheduler->shutdown(); | |
65 } | 63 } |
66 | 64 |
67 void Scheduler::postIdleTask(const WebTraceLocation& location, PassOwnPtr<IdleTa
sk> idleTask) | 65 void Scheduler::postIdleTask(const WebTraceLocation& location, PassOwnPtr<IdleTa
sk> idleTask) |
68 { | 66 { |
69 if (m_webScheduler) | 67 if (m_webScheduler) |
70 m_webScheduler->postIdleTask(location, new IdleTaskRunner(idleTask)); | 68 m_webScheduler->postIdleTask(location, new IdleTaskRunner(idleTask)); |
71 } | 69 } |
72 | 70 |
73 void Scheduler::postNonNestableIdleTask(const WebTraceLocation& location, PassOw
nPtr<IdleTask> idleTask) | 71 void Scheduler::postNonNestableIdleTask(const WebTraceLocation& location, PassOw
nPtr<IdleTask> idleTask) |
74 { | 72 { |
(...skipping 14 matching lines...) Expand all Loading... |
89 } | 87 } |
90 | 88 |
91 bool Scheduler::shouldYieldForHighPriorityWork() const | 89 bool Scheduler::shouldYieldForHighPriorityWork() const |
92 { | 90 { |
93 if (m_webScheduler) | 91 if (m_webScheduler) |
94 return m_webScheduler->shouldYieldForHighPriorityWork(); | 92 return m_webScheduler->shouldYieldForHighPriorityWork(); |
95 return false; | 93 return false; |
96 } | 94 } |
97 | 95 |
98 } // namespace blink | 96 } // namespace blink |
OLD | NEW |