| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ | 5 #ifndef CONTENT_CHILD_SCHEDULER_WEBTHREAD_IMPL_FOR_WORKER_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ | 6 #define CONTENT_CHILD_SCHEDULER_WEBTHREAD_IMPL_FOR_WORKER_H_ |
| 7 | 7 |
| 8 #include "content/child/webthread_impl.h" | 8 #include "content/child/webthread_impl.h" |
| 9 #include "content/child/scheduler/task_queue_manager.h" |
| 9 | 10 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 11 namespace cc { |
| 12 class CompletionEvent; |
| 13 }; |
| 11 | 14 |
| 12 namespace content { | 15 namespace content { |
| 13 | 16 |
| 14 class RendererScheduler; | 17 class SingleThreadIdleTaskRunner; |
| 18 class WorkerScheduler; |
| 15 | 19 |
| 16 class CONTENT_EXPORT WebThreadImplForScheduler : public WebThreadBase { | 20 class CONTENT_EXPORT WebThreadImplForWorker : public WebThreadBase { |
| 17 public: | 21 public: |
| 18 explicit WebThreadImplForScheduler(RendererScheduler* scheduler); | 22 explicit WebThreadImplForWorker(const char* name); |
| 19 virtual ~WebThreadImplForScheduler(); | 23 virtual ~WebThreadImplForWorker(); |
| 20 | 24 |
| 21 // blink::WebThread implementation. | 25 // blink::WebThread implementation. |
| 22 blink::PlatformThreadId threadId() const override; | 26 blink::PlatformThreadId threadId() const override; |
| 23 | 27 |
| 24 // WebThreadBase implementation. | 28 // WebThreadBase implementation. |
| 25 base::SingleThreadTaskRunner* TaskRunner() const override; | 29 base::SingleThreadTaskRunner* TaskRunner() const override; |
| 30 SingleThreadIdleTaskRunner* IdleTaskRunner() const override; |
| 26 | 31 |
| 27 private: | 32 private: |
| 28 base::MessageLoop* MessageLoop() const override; | 33 base::MessageLoop* MessageLoop() const override; |
| 29 void AddTaskObserverInternal( | 34 void AddTaskObserverInternal( |
| 30 base::MessageLoop::TaskObserver* observer) override; | 35 base::MessageLoop::TaskObserver* observer) override; |
| 31 void RemoveTaskObserverInternal( | 36 void RemoveTaskObserverInternal( |
| 32 base::MessageLoop::TaskObserver* observer) override; | 37 base::MessageLoop::TaskObserver* observer) override; |
| 33 | 38 |
| 39 void InitOnThread(cc::CompletionEvent* completion); |
| 40 void ShutDownOnThread(cc::CompletionEvent* completion); |
| 41 |
| 42 scoped_ptr<base::Thread> thread_; |
| 43 scoped_ptr<WorkerScheduler> worker_scheduler_; |
| 34 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 44 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 35 RendererScheduler* scheduler_; // Not owned. | 45 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; |
| 36 blink::PlatformThreadId thread_id_; | |
| 37 }; | 46 }; |
| 38 | 47 |
| 39 } // namespace content | 48 } // namespace content |
| 40 | 49 |
| 41 #endif // CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ | 50 #endif // CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_WORKER_H_ |
| OLD | NEW |