| 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/WebTaskRunner.h" | 10 #include "public/platform/WebTaskRunner.h" |
| 11 #include "public/platform/WebThread.h" | 11 #include "public/platform/WebThread.h" |
| 12 #include "public/platform/WebTraceLocation.h" | 12 #include "public/platform/WebTraceLocation.h" |
| 13 #include "public/platform/WebViewScheduler.h" | 13 #include "public/platform/WebViewScheduler.h" |
| 14 | 14 |
| 15 #include <memory> | 15 #include <memory> |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class WebSettingsImpl; |
| 19 class WebView; | 20 class WebView; |
| 20 | 21 |
| 21 // This class is used to submit tasks and pass other information from Blink to | 22 // This class is used to submit tasks and pass other information from Blink to |
| 22 // the platform's scheduler. | 23 // the platform's scheduler. |
| 23 // TODO(skyostil): Replace this class with RendererScheduler. | 24 // TODO(skyostil): Replace this class with RendererScheduler. |
| 24 class BLINK_PLATFORM_EXPORT WebScheduler { | 25 class BLINK_PLATFORM_EXPORT WebScheduler { |
| 25 public: | 26 public: |
| 26 class BLINK_PLATFORM_EXPORT InterventionReporter { | 27 class BLINK_PLATFORM_EXPORT InterventionReporter { |
| 27 public: | 28 public: |
| 28 virtual ~InterventionReporter() {} | 29 virtual ~InterventionReporter() {} |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 70 |
| 70 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. | 71 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. |
| 71 virtual WebTaskRunner* loadingTaskRunner() = 0; | 72 virtual WebTaskRunner* loadingTaskRunner() = 0; |
| 72 | 73 |
| 73 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. | 74 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. |
| 74 virtual WebTaskRunner* timerTaskRunner() = 0; | 75 virtual WebTaskRunner* timerTaskRunner() = 0; |
| 75 | 76 |
| 76 // Creates a new WebViewScheduler for a given WebView. Must be called from | 77 // Creates a new WebViewScheduler for a given WebView. Must be called from |
| 77 // the associated WebThread. | 78 // the associated WebThread. |
| 78 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler( | 79 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler( |
| 79 InterventionReporter*) = 0; | 80 InterventionReporter*, |
| 81 WebSettingsImpl*) = 0; |
| 80 | 82 |
| 81 // Suspends the timer queue and increments the timer queue suspension count. | 83 // Suspends the timer queue and increments the timer queue suspension count. |
| 82 // May only be called from the main thread. | 84 // May only be called from the main thread. |
| 83 virtual void suspendTimerQueue() = 0; | 85 virtual void suspendTimerQueue() = 0; |
| 84 | 86 |
| 85 // Decrements the timer queue suspension count and re-enables the timer queue | 87 // Decrements the timer queue suspension count and re-enables the timer queue |
| 86 // if the suspension count is zero and the current scheduler policy allows it. | 88 // if the suspension count is zero and the current scheduler policy allows it. |
| 87 virtual void resumeTimerQueue() = 0; | 89 virtual void resumeTimerQueue() = 0; |
| 88 | 90 |
| 89 enum class NavigatingFrameType { kMainFrame, kChildFrame }; | 91 enum class NavigatingFrameType { kMainFrame, kChildFrame }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 104 | 106 |
| 105 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>); | 107 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>); |
| 106 void postNonNestableIdleTask(const WebTraceLocation&, | 108 void postNonNestableIdleTask(const WebTraceLocation&, |
| 107 std::unique_ptr<IdleTask>); | 109 std::unique_ptr<IdleTask>); |
| 108 #endif | 110 #endif |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 } // namespace blink | 113 } // namespace blink |
| 112 | 114 |
| 113 #endif // WebScheduler_h | 115 #endif // WebScheduler_h |
| OLD | NEW |