OLD | NEW |
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/Timer.h" | 5 #include "platform/Timer.h" |
6 | 6 |
7 #include "platform/testing/TestingPlatformSupport.h" | 7 #include "platform/testing/TestingPlatformSupport.h" |
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/WebThread.h" | 10 #include "public/platform/WebThread.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return m_timerTasks.size() == 1; | 178 return m_timerTasks.size() == 1; |
179 } | 179 } |
180 | 180 |
181 double nextTimerTaskDelaySecs() const | 181 double nextTimerTaskDelaySecs() const |
182 { | 182 { |
183 ASSERT(hasOneTimerTask()); | 183 ASSERT(hasOneTimerTask()); |
184 return m_timerTasks.top().delaySeconds(); | 184 return m_timerTasks.top().delaySeconds(); |
185 } | 185 } |
186 | 186 |
187 void shutdown() override {} | 187 void shutdown() override {} |
188 WebPassOwnPtr<WebViewScheduler> createWebViewScheduler(blink::WebView*) over
ride { return nullptr; } | 188 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov
erride { return nullptr; } |
189 void suspendTimerQueue() override { } | 189 void suspendTimerQueue() override { } |
190 void resumeTimerQueue() override { } | 190 void resumeTimerQueue() override { } |
191 void addPendingNavigation() override { } | 191 void addPendingNavigation() override { } |
192 void removePendingNavigation() override { } | 192 void removePendingNavigation() override { } |
193 void onNavigationStarted() override { } | 193 void onNavigationStarted() override { } |
194 | 194 |
195 private: | 195 private: |
196 std::priority_queue<DelayedTask> m_timerTasks; | 196 std::priority_queue<DelayedTask> m_timerTasks; |
197 MockWebTaskRunner m_timerWebTaskRunner; | 197 MockWebTaskRunner m_timerWebTaskRunner; |
198 }; | 198 }; |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); | 760 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); |
761 timer.startOneShot(0, BLINK_FROM_HERE); | 761 timer.startOneShot(0, BLINK_FROM_HERE); |
762 | 762 |
763 // Make sure the task was posted on taskRunner. | 763 // Make sure the task was posted on taskRunner. |
764 EXPECT_FALSE(timerTasks.empty()); | 764 EXPECT_FALSE(timerTasks.empty()); |
765 } | 765 } |
766 | 766 |
767 | 767 |
768 } // namespace | 768 } // namespace |
769 } // namespace blink | 769 } // namespace blink |
OLD | NEW |