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

Unified Diff: third_party/WebKit/Source/platform/scheduler/child/global_scope_scheduler.cc

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/scheduler/child/global_scope_scheduler.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/child/global_scope_scheduler.cc b/third_party/WebKit/Source/platform/scheduler/child/global_scope_scheduler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1874e6761d79bbafcbffd6335d93ede175d3709c
--- /dev/null
+++ b/third_party/WebKit/Source/platform/scheduler/child/global_scope_scheduler.cc
@@ -0,0 +1,27 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/scheduler/child/global_scope_scheduler.h"
+
+#include "public/platform/scheduler/child/worker_scheduler.h"
+
+namespace blink {
+namespace scheduler {
+
+GlobalScopeScheduler::GlobalScopeScheduler(WorkerScheduler* worker_scheduler)
+ : worker_scheduler_(worker_scheduler) {
+ unthrottled_task_queue_ = worker_scheduler_->NewUnthrottledTaskRunner(
+ TaskQueue::QueueType::UNTHROTTLED);
+ unthrottled_task_runner_ = WebTaskRunnerImpl::create(unthrottled_task_queue_);
+}
+
+GlobalScopeScheduler::~GlobalScopeScheduler() = default;
+
+void GlobalScopeScheduler::dispose() {
+ if (unthrottled_task_queue_)
+ unthrottled_task_queue_->UnregisterTaskQueue();
+}
+
+} // namespace scheduler
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698