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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/child/worker_global_scope_scheduler.cc

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: remove unnecessary comments 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 #include "platform/scheduler/child/worker_global_scope_scheduler.h"
6
7 #include "platform/scheduler/child/worker_scheduler.h"
8
9 namespace blink {
10 namespace scheduler {
11
12 WorkerGlobalScopeScheduler::WorkerGlobalScopeScheduler(
13 WorkerScheduler* worker_scheduler) {
14 scoped_refptr<TaskQueue> task_queue =
15 worker_scheduler->CreateUnthrottledTaskRunner(
16 TaskQueue::QueueType::UNTHROTTLED);
17 unthrottled_task_runner_ = WebTaskRunnerImpl::Create(std::move(task_queue));
18 }
19
20 WorkerGlobalScopeScheduler::~WorkerGlobalScopeScheduler() {
21 #if DCHECK_IS_ON()
22 DCHECK(is_disposed_);
23 #endif
24 }
25
26 void WorkerGlobalScopeScheduler::Dispose() {
27 unthrottled_task_runner_->GetTaskQueue()->UnregisterTaskQueue();
28 #if DCHECK_IS_ON()
29 is_disposed_ = true;
30 #endif
31 }
32
33 } // namespace scheduler
34 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698