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 "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
9 #include "platform/TestingPlatformSupport.h" | 9 #include "platform/TestingPlatformSupport.h" |
10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 : m_shouldYieldForHighPriorityWork(false) | 36 : m_shouldYieldForHighPriorityWork(false) |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
40 // WebScheduler implementation: | 40 // WebScheduler implementation: |
41 bool shouldYieldForHighPriorityWork() override | 41 bool shouldYieldForHighPriorityWork() override |
42 { | 42 { |
43 return m_shouldYieldForHighPriorityWork; | 43 return m_shouldYieldForHighPriorityWork; |
44 } | 44 } |
45 | 45 |
46 void postIdleTask(const WebTraceLocation&, IdleTask* task) override | 46 void postIdleTask(const WebTraceLocation&, blink::WebThread::IdleTask* task)
override |
47 { | 47 { |
48 m_latestIdleTask = adoptPtr(task); | 48 m_latestIdleTask = adoptPtr(task); |
49 } | 49 } |
50 | 50 |
51 void setShouldYieldForHighPriorityWork(bool shouldYieldForHighPriorityWork) | 51 void setShouldYieldForHighPriorityWork(bool shouldYieldForHighPriorityWork) |
52 { | 52 { |
53 m_shouldYieldForHighPriorityWork = shouldYieldForHighPriorityWork; | 53 m_shouldYieldForHighPriorityWork = shouldYieldForHighPriorityWork; |
54 } | 54 } |
55 | 55 |
56 void runLatestIdleTask(double deadlineSeconds) | 56 void runLatestIdleTask(double deadlineSeconds) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 92 } |
93 | 93 |
94 TEST_F(SchedulerTest, TestIdleTasks) | 94 TEST_F(SchedulerTest, TestIdleTasks) |
95 { | 95 { |
96 double deadline = 1.1; | 96 double deadline = 1.1; |
97 m_scheduler->postIdleTask(FROM_HERE, WTF::bind<double>(&idleTestTask, deadli
ne)); | 97 m_scheduler->postIdleTask(FROM_HERE, WTF::bind<double>(&idleTestTask, deadli
ne)); |
98 m_webScheduler->runLatestIdleTask(deadline); | 98 m_webScheduler->runLatestIdleTask(deadline); |
99 } | 99 } |
100 | 100 |
101 } // namespace | 101 } // namespace |
OLD | NEW |