| OLD | NEW |
| 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 // An implementation of WebThread in terms of base::MessageLoop and | 5 // An implementation of WebThread in terms of base::MessageLoop and |
| 6 // base::Thread | 6 // base::Thread |
| 7 | 7 |
| 8 #include "public/platform/scheduler/child/webthread_base.h" | 8 #include "public/platform/scheduler/child/webthread_base.h" |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/pending_task.h" | 13 #include "base/pending_task.h" |
| 14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
| 15 #include "platform/scheduler/child/webthread_impl_for_worker_scheduler.h" | 15 #include "platform/scheduler/child/webthread_impl_for_worker_scheduler.h" |
| 16 #include "platform/scheduler/utility/webthread_impl_for_utility_thread.h" |
| 16 #include "public/platform/WebTraceLocation.h" | 17 #include "public/platform/WebTraceLocation.h" |
| 17 #include "public/platform/scheduler/child/compositor_worker_scheduler.h" | 18 #include "public/platform/scheduler/child/compositor_worker_scheduler.h" |
| 18 #include "public/platform/scheduler/child/single_thread_idle_task_runner.h" | 19 #include "public/platform/scheduler/child/single_thread_idle_task_runner.h" |
| 19 | 20 |
| 20 namespace blink { | 21 namespace blink { |
| 21 namespace scheduler { | 22 namespace scheduler { |
| 22 | 23 |
| 23 class WebThreadBase::TaskObserverAdapter | 24 class WebThreadBase::TaskObserverAdapter |
| 24 : public base::MessageLoop::TaskObserver { | 25 : public base::MessageLoop::TaskObserver { |
| 25 public: | 26 public: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const char* name, | 129 const char* name, |
| 129 base::Thread::Options options) { | 130 base::Thread::Options options) { |
| 130 return base::MakeUnique<WebThreadImplForWorkerScheduler>(name, options); | 131 return base::MakeUnique<WebThreadImplForWorkerScheduler>(name, options); |
| 131 } | 132 } |
| 132 | 133 |
| 133 std::unique_ptr<WebThreadBase> WebThreadBase::CreateCompositorThread( | 134 std::unique_ptr<WebThreadBase> WebThreadBase::CreateCompositorThread( |
| 134 base::Thread::Options options) { | 135 base::Thread::Options options) { |
| 135 return base::MakeUnique<WebThreadForCompositor>(options); | 136 return base::MakeUnique<WebThreadForCompositor>(options); |
| 136 } | 137 } |
| 137 | 138 |
| 139 std::unique_ptr<WebThreadBase> WebThreadBase::InitializeUtilityThread() { |
| 140 return base::MakeUnique<WebThreadImplForUtilityThread>(); |
| 141 } |
| 142 |
| 138 } // namespace scheduler | 143 } // namespace scheduler |
| 139 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |