| OLD | NEW |
| (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 | |
| OLD | NEW |