Index: webkit/glue/webthread_impl.h |
diff --git a/webkit/glue/webthread_impl.h b/webkit/glue/webthread_impl.h |
index 842c8c6b0fdcfbaad01ea6694269c4e9b7d58e01..42fb08719540a482f9ec9f5bd48b0c63982d25ad 100644 |
--- a/webkit/glue/webthread_impl.h |
+++ b/webkit/glue/webthread_impl.h |
@@ -4,15 +4,31 @@ |
#ifndef WEBKIT_GLUE_WEBTHREAD_IMPL_H_ |
#define WEBKIT_GLUE_WEBTHREAD_IMPL_H_ |
+#include <map> |
+ |
#include "base/threading/thread.h" |
#include "base/memory/scoped_ptr.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebThread.h" |
namespace webkit_glue { |
-class WebThreadImpl : public WebKit::WebThread { |
+class WebThreadBase : public WebKit::WebThread { |
public: |
- WebThreadImpl(const char* name); |
+ virtual void addTaskObserver(TaskObserver* observer); |
+ virtual void removeTaskObserver(TaskObserver* observer); |
+ |
+ protected: |
+ virtual bool IsCurrentThread() const = 0; |
+ |
+ private: |
+ class TaskObserverAdapter; |
+ typedef std::map<TaskObserver*, TaskObserverAdapter*> TaskObserverMap; |
+ TaskObserverMap task_observer_map_; |
+}; |
+ |
+class WebThreadImpl : public WebThreadBase { |
+ public: |
+ explicit WebThreadImpl(const char* name); |
virtual ~WebThreadImpl(); |
virtual void postTask(Task* task) OVERRIDE; |
@@ -21,18 +37,24 @@ class WebThreadImpl : public WebKit::WebThread { |
MessageLoop* message_loop() const { return thread_->message_loop(); } |
protected: |
+ virtual bool IsCurrentThread() const; |
+ |
+ private: |
scoped_ptr<base::Thread> thread_; |
}; |
-class WebThreadImplForMessageLoop : public WebKit::WebThread { |
+class WebThreadImplForMessageLoop : public WebThreadBase { |
public: |
- WebThreadImplForMessageLoop(base::MessageLoopProxy* message_loop); |
+ explicit WebThreadImplForMessageLoop(base::MessageLoopProxy* message_loop); |
virtual ~WebThreadImplForMessageLoop(); |
virtual void postTask(Task* task) OVERRIDE; |
virtual void postDelayedTask(Task* task, long long delay_ms) OVERRIDE; |
protected: |
+ virtual bool IsCurrentThread() const; |
+ |
+ private: |
scoped_refptr<base::MessageLoopProxy> message_loop_; |
}; |