OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GPU_COMPOSITOR_THREAD_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ |
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ | 6 #define CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 // |main_listener| refers to the central IPC message listener that lives on | 25 // |main_listener| refers to the central IPC message listener that lives on |
26 // the main thread, where all incoming IPC messages are first handled. | 26 // the main thread, where all incoming IPC messages are first handled. |
27 explicit CompositorThread(IPC::Channel::Listener* main_listener); | 27 explicit CompositorThread(IPC::Channel::Listener* main_listener); |
28 ~CompositorThread(); | 28 ~CompositorThread(); |
29 | 29 |
30 // This MessageFilter should be added to allow input events to be redirected | 30 // This MessageFilter should be added to allow input events to be redirected |
31 // to the compositor's thread. | 31 // to the compositor's thread. |
32 IPC::ChannelProxy::MessageFilter* GetMessageFilter() const; | 32 IPC::ChannelProxy::MessageFilter* GetMessageFilter() const; |
33 | 33 |
34 // Callable from the main thread or the compositor's thread. | 34 // Callable from the main thread only. |
35 void AddInputHandler(int routing_id, int input_handler_id); | 35 void AddInputHandler(int routing_id, int input_handler_id); |
36 | 36 |
37 webkit_glue::WebThreadImpl* GetWebThread() { return &thread_; } | 37 webkit_glue::WebThreadImpl* GetWebThread() { return &thread_; } |
38 | 38 |
39 private: | 39 private: |
40 // Callback only from the compositor's thread. | 40 // Callback only from the compositor's thread. |
41 void RemoveInputHandler(int routing_id); | 41 void RemoveInputHandler(int routing_id); |
42 | 42 |
43 // Called from the compositor's thread. | 43 // Called from the compositor's thread. |
44 void HandleInputEvent(int routing_id, | 44 void HandleInputEvent(int routing_id, |
45 const WebKit::WebInputEvent* input_event); | 45 const WebKit::WebInputEvent* input_event); |
46 | 46 |
| 47 // Called from the compositor's thread. |
| 48 void AddInputHandlerOnCompositorThread( |
| 49 int routing_id, |
| 50 int input_handler_id, |
| 51 scoped_refptr<base::MessageLoopProxy> main_loop); |
| 52 |
47 class InputHandlerWrapper; | 53 class InputHandlerWrapper; |
48 friend class InputHandlerWrapper; | 54 friend class InputHandlerWrapper; |
49 | 55 |
50 typedef std::map<int, // routing_id | 56 typedef std::map<int, // routing_id |
51 linked_ptr<InputHandlerWrapper> > InputHandlerMap; | 57 linked_ptr<InputHandlerWrapper> > InputHandlerMap; |
52 InputHandlerMap input_handlers_; | 58 InputHandlerMap input_handlers_; |
53 | 59 |
54 webkit_glue::WebThreadImpl thread_; | 60 webkit_glue::WebThreadImpl thread_; |
55 scoped_refptr<InputEventFilter> filter_; | 61 scoped_refptr<InputEventFilter> filter_; |
56 }; | 62 }; |
57 | 63 |
58 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ | 64 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ |
OLD | NEW |