| 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 #ifndef WebScheduler_h | 5 #ifndef WebScheduler_h |
| 6 #define WebScheduler_h | 6 #define WebScheduler_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
| 9 #include "public/platform/WebTaskRunner.h" | 9 #include "public/platform/WebTaskRunner.h" |
| 10 #include "public/platform/WebThread.h" | 10 #include "public/platform/WebThread.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebV
iew*) = 0; | 72 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebV
iew*) = 0; |
| 73 | 73 |
| 74 // Suspends the timer queue and increments the timer queue suspension count. | 74 // Suspends the timer queue and increments the timer queue suspension count. |
| 75 // May only be called from the main thread. | 75 // May only be called from the main thread. |
| 76 virtual void suspendTimerQueue() = 0; | 76 virtual void suspendTimerQueue() = 0; |
| 77 | 77 |
| 78 // Decrements the timer queue suspension count and re-enables the timer queu
e | 78 // Decrements the timer queue suspension count and re-enables the timer queu
e |
| 79 // if the suspension count is zero and the current scheduler policy allows i
t. | 79 // if the suspension count is zero and the current scheduler policy allows i
t. |
| 80 virtual void resumeTimerQueue() = 0; | 80 virtual void resumeTimerQueue() = 0; |
| 81 | 81 |
| 82 enum class NavigatingFrameType { |
| 83 kMainFrame, |
| 84 kChildFrame |
| 85 }; |
| 86 |
| 82 // Tells the scheduler that a navigation task is pending. | 87 // Tells the scheduler that a navigation task is pending. |
| 83 // TODO(alexclarke): Long term should this be a task trait? | 88 // TODO(alexclarke): Long term should this be a task trait? |
| 84 virtual void addPendingNavigation() = 0; | 89 virtual void addPendingNavigation(NavigatingFrameType) = 0; |
| 85 | 90 |
| 86 // Tells the scheduler that a navigation task is no longer pending. | 91 // Tells the scheduler that a navigation task is no longer pending. |
| 87 virtual void removePendingNavigation() = 0; | 92 virtual void removePendingNavigation(NavigatingFrameType) = 0; |
| 88 | 93 |
| 89 // Tells the scheduler that an expected navigation was started. | 94 // Tells the scheduler that an expected navigation was started. |
| 90 virtual void onNavigationStarted() = 0; | 95 virtual void onNavigationStarted() = 0; |
| 91 | 96 |
| 92 #ifdef INSIDE_BLINK | 97 #ifdef INSIDE_BLINK |
| 93 // Helpers for posting bound functions as tasks. | 98 // Helpers for posting bound functions as tasks. |
| 94 typedef Function<void(double deadlineSeconds)> IdleTask; | 99 typedef Function<void(double deadlineSeconds)> IdleTask; |
| 95 | 100 |
| 96 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 101 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
| 97 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 102 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
| 98 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 103 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
| 99 #endif | 104 #endif |
| 100 }; | 105 }; |
| 101 | 106 |
| 102 } // namespace blink | 107 } // namespace blink |
| 103 | 108 |
| 104 #endif // WebScheduler_h | 109 #endif // WebScheduler_h |
| OLD | NEW |