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

Side by Side Diff: mojo/services/html_viewer/webthread_impl.h

Issue 1094833002: Mojo changes for moving WebScheduler to WebThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix it Created 5 years, 8 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
« no previous file with comments | « no previous file | mojo/services/html_viewer/webthread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MOJO_SERVICES_HTML_VIEWER_WEBTHREAD_IMPL_H_ 5 #ifndef MOJO_SERVICES_HTML_VIEWER_WEBTHREAD_IMPL_H_
6 #define MOJO_SERVICES_HTML_VIEWER_WEBTHREAD_IMPL_H_ 6 #define MOJO_SERVICES_HTML_VIEWER_WEBTHREAD_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "mojo/services/html_viewer/webscheduler_impl.h"
12 #include "third_party/WebKit/public/platform/WebThread.h" 13 #include "third_party/WebKit/public/platform/WebThread.h"
13 14
14 namespace html_viewer { 15 namespace html_viewer {
15 16
16 class WebThreadBase : public blink::WebThread { 17 class WebThreadBase : public blink::WebThread {
17 public: 18 public:
18 virtual ~WebThreadBase(); 19 virtual ~WebThreadBase();
19 20
20 virtual void addTaskObserver(TaskObserver* observer); 21 virtual void addTaskObserver(TaskObserver* observer);
21 virtual void removeTaskObserver(TaskObserver* observer); 22 virtual void removeTaskObserver(TaskObserver* observer);
(...skipping 16 matching lines...) Expand all
38 ~WebThreadImpl() override; 39 ~WebThreadImpl() override;
39 40
40 virtual void postTask(const blink::WebTraceLocation& location, Task* task); 41 virtual void postTask(const blink::WebTraceLocation& location, Task* task);
41 virtual void postDelayedTask(const blink::WebTraceLocation& location, 42 virtual void postDelayedTask(const blink::WebTraceLocation& location,
42 Task* task, 43 Task* task,
43 long long delay_ms); 44 long long delay_ms);
44 45
45 virtual void enterRunLoop(); 46 virtual void enterRunLoop();
46 virtual void exitRunLoop(); 47 virtual void exitRunLoop();
47 48
49 virtual blink::WebScheduler* scheduler() const;
50
48 base::MessageLoop* message_loop() const { return thread_->message_loop(); } 51 base::MessageLoop* message_loop() const { return thread_->message_loop(); }
49 52
50 bool isCurrentThread() const override; 53 bool isCurrentThread() const override;
51 virtual blink::PlatformThreadId threadId() const; 54 virtual blink::PlatformThreadId threadId() const;
52 55
53 private: 56 private:
54 scoped_ptr<base::Thread> thread_; 57 scoped_ptr<base::Thread> thread_;
58 scoped_ptr<WebSchedulerImpl> web_scheduler_;
55 }; 59 };
56 60
57 class WebThreadImplForMessageLoop : public WebThreadBase { 61 class WebThreadImplForMessageLoop : public WebThreadBase {
58 public: 62 public:
59 explicit WebThreadImplForMessageLoop( 63 explicit WebThreadImplForMessageLoop(
60 base::MessageLoopProxy* message_loop); 64 base::MessageLoopProxy* message_loop);
61 ~WebThreadImplForMessageLoop() override; 65 ~WebThreadImplForMessageLoop() override;
62 66
63 virtual void postTask(const blink::WebTraceLocation& location, Task* task); 67 virtual void postTask(const blink::WebTraceLocation& location, Task* task);
64 virtual void postDelayedTask(const blink::WebTraceLocation& location, 68 virtual void postDelayedTask(const blink::WebTraceLocation& location,
65 Task* task, 69 Task* task,
66 long long delay_ms); 70 long long delay_ms);
67 71
68 virtual void enterRunLoop(); 72 virtual void enterRunLoop();
69 virtual void exitRunLoop(); 73 virtual void exitRunLoop();
70 74
75 virtual blink::WebScheduler* scheduler() const;
76
71 private: 77 private:
72 bool isCurrentThread() const override; 78 bool isCurrentThread() const override;
73 virtual blink::PlatformThreadId threadId() const; 79 virtual blink::PlatformThreadId threadId() const;
74 80
75 scoped_refptr<base::MessageLoopProxy> message_loop_; 81 scoped_refptr<base::MessageLoopProxy> message_loop_;
82 scoped_ptr<WebSchedulerImpl> web_scheduler_;
76 blink::PlatformThreadId thread_id_; 83 blink::PlatformThreadId thread_id_;
77 }; 84 };
78 85
79 } // namespace html_viewer 86 } // namespace html_viewer
80 87
81 #endif // MOJO_SERVICES_HTML_VIEWER_WEBTHREAD_IMPL_H_ 88 #endif // MOJO_SERVICES_HTML_VIEWER_WEBTHREAD_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/services/html_viewer/webthread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698