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

Side by Side Diff: content/renderer/scheduler/webthread_impl_for_scheduler.h

Issue 923973002: Refactor WebThreadImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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_
OLDNEW
« no previous file with comments | « content/child/webthread_impl.cc ('k') | content/renderer/scheduler/webthread_impl_for_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698