| 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 "WebString.h" | 9 #include "WebString.h" |
| 10 #include "public/platform/WebThread.h" | 10 #include "public/platform/WebThread.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 enum class NavigatingFrameType { kMainFrame, kChildFrame }; | 89 enum class NavigatingFrameType { kMainFrame, kChildFrame }; |
| 90 | 90 |
| 91 // Tells the scheduler that a navigation task is pending. | 91 // Tells the scheduler that a navigation task is pending. |
| 92 // TODO(alexclarke): Long term should this be a task trait? | 92 // TODO(alexclarke): Long term should this be a task trait? |
| 93 virtual void addPendingNavigation(NavigatingFrameType) = 0; | 93 virtual void addPendingNavigation(NavigatingFrameType) = 0; |
| 94 | 94 |
| 95 // Tells the scheduler that a navigation task is no longer pending. | 95 // Tells the scheduler that a navigation task is no longer pending. |
| 96 virtual void removePendingNavigation(NavigatingFrameType) = 0; | 96 virtual void removePendingNavigation(NavigatingFrameType) = 0; |
| 97 | 97 |
| 98 // Tells the scheduler that an expected navigation was started. | |
| 99 virtual void onNavigationStarted() = 0; | |
| 100 | |
| 101 #ifdef INSIDE_BLINK | 98 #ifdef INSIDE_BLINK |
| 102 // Helpers for posting bound functions as tasks. | 99 // Helpers for posting bound functions as tasks. |
| 103 typedef Function<void(double deadlineSeconds)> IdleTask; | 100 typedef Function<void(double deadlineSeconds)> IdleTask; |
| 104 | 101 |
| 105 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>); | 102 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>); |
| 106 void postNonNestableIdleTask(const WebTraceLocation&, | 103 void postNonNestableIdleTask(const WebTraceLocation&, |
| 107 std::unique_ptr<IdleTask>); | 104 std::unique_ptr<IdleTask>); |
| 108 #endif | 105 #endif |
| 109 }; | 106 }; |
| 110 | 107 |
| 111 } // namespace blink | 108 } // namespace blink |
| 112 | 109 |
| 113 #endif // WebScheduler_h | 110 #endif // WebScheduler_h |
| OLD | NEW |