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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/global_scope_scheduler.h

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: wip Created 3 years, 8 months 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_GLOBAL_SCOPE_SCHEDULER_H_
6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_GLOBAL_SCOPE_SCHEDULER_H_
7
8 #include "platform/scheduler/child/web_task_runner_impl.h"
9 #include "public/platform/WebCommon.h"
10 #include "public/platform/scheduler/base/task_queue.h"
11
12 namespace blink {
13 namespace scheduler {
14
15 class WorkerScheduler;
16
17 // A scheduler provides per-global-scope task queues. This is constructed when a
18 // global scope is created and destructed when it's closed.
19 //
20 // Unless stated otherwise, all methods must be called on the same thread.
21 class BLINK_PLATFORM_EXPORT GlobalScopeScheduler {
22 public:
23 GlobalScopeScheduler(WorkerScheduler* worker_scheduler);
24 ~GlobalScopeScheduler();
25
26 void dispose();
Sami 2017/04/10 16:58:10 Please document what this method does.
nhiroki 2017/04/11 10:47:54 Done.
27
28 // Returns the WebTaskRunner for tasks which should never get throttled. This
29 // can be called from any thread.
30 RefPtr<WebTaskRunner> unthrottledTaskRunner() {
31 return unthrottled_task_runner_;
32 }
33
34 // TODO(nhiroki): Add mechanism to throttle/suspend tasks in response to the
35 // state of the parent document (https://crbug.com/670534).
36
37 private:
38 WorkerScheduler* worker_scheduler_;
39 scoped_refptr<TaskQueue> unthrottled_task_queue_;
40 RefPtr<WebTaskRunnerImpl> unthrottled_task_runner_;
41 };
42
43 } // namespace scheduler
44 } // namespace blink
45
46 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_GLOBAL_SCOPE_SCHEDULER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698