OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef WEBKIT_GLUE_WEBTHREAD_IMPL_H_ | 4 #ifndef WEBKIT_GLUE_WEBTHREAD_IMPL_H_ |
5 #define WEBKIT_GLUE_WEBTHREAD_IMPL_H_ | 5 #define WEBKIT_GLUE_WEBTHREAD_IMPL_H_ |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; | 31 typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; |
32 TaskObserverMap task_observer_map_; | 32 TaskObserverMap task_observer_map_; |
33 }; | 33 }; |
34 | 34 |
35 class WebThreadImpl : public WebThreadBase { | 35 class WebThreadImpl : public WebThreadBase { |
36 public: | 36 public: |
37 WEBKIT_GLUE_EXPORT explicit WebThreadImpl(const char* name); | 37 WEBKIT_GLUE_EXPORT explicit WebThreadImpl(const char* name); |
38 WEBKIT_GLUE_EXPORT virtual ~WebThreadImpl(); | 38 WEBKIT_GLUE_EXPORT virtual ~WebThreadImpl(); |
39 | 39 |
40 virtual void postTask(Task* task) OVERRIDE; | 40 virtual void postTask(Task* task); |
41 virtual void postDelayedTask(Task* task, long long delay_ms) OVERRIDE; | 41 virtual void postDelayedTask(Task* task, long long delay_ms); |
| 42 |
| 43 virtual void enterRunLoop(); |
| 44 virtual void exitRunLoop(); |
42 | 45 |
43 MessageLoop* message_loop() const { return thread_->message_loop(); } | 46 MessageLoop* message_loop() const { return thread_->message_loop(); } |
44 | 47 |
45 private: | 48 private: |
46 virtual bool IsCurrentThread() const OVERRIDE; | 49 virtual bool IsCurrentThread() const OVERRIDE; |
47 scoped_ptr<base::Thread> thread_; | 50 scoped_ptr<base::Thread> thread_; |
48 }; | 51 }; |
49 | 52 |
50 class WebThreadImplForMessageLoop : public WebThreadBase { | 53 class WebThreadImplForMessageLoop : public WebThreadBase { |
51 public: | 54 public: |
52 explicit WebThreadImplForMessageLoop(base::MessageLoopProxy* message_loop); | 55 explicit WebThreadImplForMessageLoop(base::MessageLoopProxy* message_loop); |
53 virtual ~WebThreadImplForMessageLoop(); | 56 virtual ~WebThreadImplForMessageLoop(); |
54 | 57 |
55 virtual void postTask(Task* task) OVERRIDE; | 58 virtual void postTask(Task* task); |
56 virtual void postDelayedTask(Task* task, long long delay_ms) OVERRIDE; | 59 virtual void postDelayedTask(Task* task, long long delay_ms); |
| 60 |
| 61 virtual void enterRunLoop(); |
| 62 virtual void exitRunLoop(); |
57 | 63 |
58 private: | 64 private: |
59 virtual bool IsCurrentThread() const OVERRIDE; | 65 virtual bool IsCurrentThread() const OVERRIDE; |
60 scoped_refptr<base::MessageLoopProxy> message_loop_; | 66 scoped_refptr<base::MessageLoopProxy> message_loop_; |
61 }; | 67 }; |
62 | 68 |
63 } // namespace webkit_glue | 69 } // namespace webkit_glue |
64 | 70 |
65 #endif | 71 #endif |
OLD | NEW |