Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: third_party/WebKit/public/platform/WebScheduler.h

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: Address nits from skyostil@ Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "public/platform/WebTraceLocation.h" 11 #include "public/platform/WebTraceLocation.h"
12 #include "public/platform/WebViewScheduler.h" 12 #include "public/platform/WebViewScheduler.h"
13 13
14 #include <memory> 14 #include <memory>
15 15
16 namespace blink { 16 namespace blink {
17
foolip 2016/11/09 11:08:18 OK if clang-format doesn't care, but blank line af
altimin 2016/11/09 14:46:29 Done.
18 class WebTaskRunner; 17 class WebTaskRunner;
19 class WebView;
20 18
21 // This class is used to submit tasks and pass other information from Blink to 19 // This class is used to submit tasks and pass other information from Blink to
22 // the platform's scheduler. 20 // the platform's scheduler.
23 // TODO(skyostil): Replace this class with RendererScheduler. 21 // TODO(skyostil): Replace this class with RendererScheduler.
24 class BLINK_PLATFORM_EXPORT WebScheduler { 22 class BLINK_PLATFORM_EXPORT WebScheduler {
25 public: 23 public:
26 class BLINK_PLATFORM_EXPORT InterventionReporter { 24 class BLINK_PLATFORM_EXPORT InterventionReporter {
27 public: 25 public:
28 virtual ~InterventionReporter() {} 26 virtual ~InterventionReporter() {}
29 27
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 67
70 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. 68 // Returns a WebTaskRunner for loading tasks. Can be called from any thread.
71 virtual WebTaskRunner* loadingTaskRunner() = 0; 69 virtual WebTaskRunner* loadingTaskRunner() = 0;
72 70
73 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. 71 // Returns a WebTaskRunner for timer tasks. Can be called from any thread.
74 virtual WebTaskRunner* timerTaskRunner() = 0; 72 virtual WebTaskRunner* timerTaskRunner() = 0;
75 73
76 // Creates a new WebViewScheduler for a given WebView. Must be called from 74 // Creates a new WebViewScheduler for a given WebView. Must be called from
77 // the associated WebThread. 75 // the associated WebThread.
78 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler( 76 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler(
79 InterventionReporter*) = 0; 77 InterventionReporter*,
78 WebViewScheduler::WebViewSchedulerSettings*) = 0;
80 79
81 // Suspends the timer queue and increments the timer queue suspension count. 80 // Suspends the timer queue and increments the timer queue suspension count.
82 // May only be called from the main thread. 81 // May only be called from the main thread.
83 virtual void suspendTimerQueue() = 0; 82 virtual void suspendTimerQueue() = 0;
84 83
85 // Decrements the timer queue suspension count and re-enables the timer queue 84 // 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. 85 // if the suspension count is zero and the current scheduler policy allows it.
87 virtual void resumeTimerQueue() = 0; 86 virtual void resumeTimerQueue() = 0;
88 87
89 enum class NavigatingFrameType { kMainFrame, kChildFrame }; 88 enum class NavigatingFrameType { kMainFrame, kChildFrame };
(...skipping 14 matching lines...) Expand all
104 103
105 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>); 104 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>);
106 void postNonNestableIdleTask(const WebTraceLocation&, 105 void postNonNestableIdleTask(const WebTraceLocation&,
107 std::unique_ptr<IdleTask>); 106 std::unique_ptr<IdleTask>);
108 #endif 107 #endif
109 }; 108 };
110 109
111 } // namespace blink 110 } // namespace blink
112 111
113 #endif // WebScheduler_h 112 #endif // WebScheduler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698