| 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_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ | 6 #define CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "content/child/webthread_impl.h" | 8 #include "content/child/webthread_impl.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 class RendererScheduler; | 12 class RendererScheduler; |
| 13 | 13 |
| 14 class WebThreadImplForScheduler : public WebThreadBase { | 14 class WebThreadImplForScheduler : public WebThreadBase { |
| 15 public: | 15 public: |
| 16 CONTENT_EXPORT explicit WebThreadImplForScheduler( | 16 CONTENT_EXPORT explicit WebThreadImplForScheduler( |
| 17 RendererScheduler* scheduler); | 17 RendererScheduler* scheduler); |
| 18 CONTENT_EXPORT virtual ~WebThreadImplForScheduler(); | 18 CONTENT_EXPORT virtual ~WebThreadImplForScheduler(); |
| 19 | 19 |
| 20 virtual void postTask(const blink::WebTraceLocation& location, Task* task); | 20 // blink::WebThread implementation. |
| 21 virtual void postDelayedTask(const blink::WebTraceLocation& location, | 21 blink::PlatformThreadId threadId() const override; |
| 22 Task* task, | |
| 23 long long delay_ms); | |
| 24 | 22 |
| 25 // TODO(skyostil): Remove once blink has migrated. | 23 // WebThreadBase implementation. |
| 26 virtual void postTask(Task* task); | 24 base::SingleThreadTaskRunner* TaskRunner() const override; |
| 27 virtual void postDelayedTask(Task* task, long long delay_ms); | |
| 28 | |
| 29 virtual void enterRunLoop() override; | |
| 30 virtual void exitRunLoop() override; | |
| 31 | |
| 32 virtual bool isCurrentThread() const override; | |
| 33 virtual blink::PlatformThreadId threadId() const override; | |
| 34 | 25 |
| 35 private: | 26 private: |
| 27 base::MessageLoop* MessageLoop() const override; |
| 28 |
| 36 void AddTaskObserverInternal( | 29 void AddTaskObserverInternal( |
| 37 base::MessageLoop::TaskObserver* observer) override; | 30 base::MessageLoop::TaskObserver* observer) override; |
| 38 void RemoveTaskObserverInternal( | 31 void RemoveTaskObserverInternal( |
| 39 base::MessageLoop::TaskObserver* observer) override; | 32 base::MessageLoop::TaskObserver* observer) override; |
| 40 | 33 |
| 41 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 34 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 42 RendererScheduler* scheduler_; // Not owned. | 35 RendererScheduler* scheduler_; // Not owned. |
| 43 blink::PlatformThreadId thread_id_; | 36 blink::PlatformThreadId thread_id_; |
| 44 }; | 37 }; |
| 45 | 38 |
| 46 } // namespace content | 39 } // namespace content |
| 47 | 40 |
| 48 #endif // CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ | 41 #endif // CONTENT_RENDERER_SCHEDULER_WEBTHREAD_IMPL_FOR_SCHEDULER_H_ |
| OLD | NEW |