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

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

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: Fix test and address comments 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 17
18 class WebTaskRunner; 18 class WebTaskRunner;
19 class WebView;
20 19
21 // This class is used to submit tasks and pass other information from Blink to 20 // This class is used to submit tasks and pass other information from Blink to
22 // the platform's scheduler. 21 // the platform's scheduler.
23 // TODO(skyostil): Replace this class with RendererScheduler. 22 // TODO(skyostil): Replace this class with RendererScheduler.
24 class BLINK_PLATFORM_EXPORT WebScheduler { 23 class BLINK_PLATFORM_EXPORT WebScheduler {
25 public: 24 public:
26 class BLINK_PLATFORM_EXPORT InterventionReporter { 25 class BLINK_PLATFORM_EXPORT InterventionReporter {
27 public: 26 public:
28 virtual ~InterventionReporter() {} 27 virtual ~InterventionReporter() {}
29 28
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 68
70 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. 69 // Returns a WebTaskRunner for loading tasks. Can be called from any thread.
71 virtual WebTaskRunner* loadingTaskRunner() = 0; 70 virtual WebTaskRunner* loadingTaskRunner() = 0;
72 71
73 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. 72 // Returns a WebTaskRunner for timer tasks. Can be called from any thread.
74 virtual WebTaskRunner* timerTaskRunner() = 0; 73 virtual WebTaskRunner* timerTaskRunner() = 0;
75 74
76 // Creates a new WebViewScheduler for a given WebView. Must be called from 75 // Creates a new WebViewScheduler for a given WebView. Must be called from
77 // the associated WebThread. 76 // the associated WebThread.
78 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler( 77 virtual std::unique_ptr<WebViewScheduler> createWebViewScheduler(
79 InterventionReporter*) = 0; 78 InterventionReporter*,
79 WebViewScheduler::WebViewSchedulerSettings*) = 0;
80 80
81 // Suspends the timer queue and increments the timer queue suspension count. 81 // Suspends the timer queue and increments the timer queue suspension count.
82 // May only be called from the main thread. 82 // May only be called from the main thread.
83 virtual void suspendTimerQueue() = 0; 83 virtual void suspendTimerQueue() = 0;
84 84
85 // Decrements the timer queue suspension count and re-enables the timer queue 85 // 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. 86 // if the suspension count is zero and the current scheduler policy allows it.
87 virtual void resumeTimerQueue() = 0; 87 virtual void resumeTimerQueue() = 0;
88 88
89 enum class NavigatingFrameType { kMainFrame, kChildFrame }; 89 enum class NavigatingFrameType { kMainFrame, kChildFrame };
(...skipping 14 matching lines...) Expand all
104 104
105 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>); 105 void postIdleTask(const WebTraceLocation&, std::unique_ptr<IdleTask>);
106 void postNonNestableIdleTask(const WebTraceLocation&, 106 void postNonNestableIdleTask(const WebTraceLocation&,
107 std::unique_ptr<IdleTask>); 107 std::unique_ptr<IdleTask>);
108 #endif 108 #endif
109 }; 109 };
110 110
111 } // namespace blink 111 } // namespace blink
112 112
113 #endif // WebScheduler_h 113 #endif // WebScheduler_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/platform/WebViewScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698