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 "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebThread.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebThread.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #else | 21 #else |
22 virtual void postDelayedTask(Task* task, int64 delay_ms); | 22 virtual void postDelayedTask(Task* task, int64 delay_ms); |
23 #endif | 23 #endif |
24 | 24 |
25 MessageLoop* message_loop() const { return thread_->message_loop(); } | 25 MessageLoop* message_loop() const { return thread_->message_loop(); } |
26 | 26 |
27 protected: | 27 protected: |
28 scoped_ptr<base::Thread> thread_; | 28 scoped_ptr<base::Thread> thread_; |
29 }; | 29 }; |
30 | 30 |
| 31 class WebThreadImplForMessageLoop : public WebKit::WebThread { |
| 32 public: |
| 33 WebThreadImplForMessageLoop(base::MessageLoopProxy* message_loop); |
| 34 virtual ~WebThreadImplForMessageLoop(); |
| 35 |
| 36 virtual void postTask(Task* task); |
| 37 #ifdef WEBTHREAD_HAS_LONGLONG_CHANGE |
| 38 virtual void postDelayedTask(Task* task, long long delay_ms); |
| 39 #else |
| 40 virtual void postDelayedTask(Task* task, int64 delay_ms); |
| 41 #endif |
| 42 |
| 43 protected: |
| 44 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 45 }; |
| 46 |
31 } // namespace webkit_glue | 47 } // namespace webkit_glue |
32 | 48 |
33 #endif | 49 #endif |
OLD | NEW |