| 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/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Callable from the main thread only. | 38 // Callable from the main thread only. |
| 39 void AddInputHandler(int routing_id, | 39 void AddInputHandler(int routing_id, |
| 40 int input_handler_id, | 40 int input_handler_id, |
| 41 const base::WeakPtr<RenderViewImpl>& render_view_impl); | 41 const base::WeakPtr<RenderViewImpl>& render_view_impl); |
| 42 | 42 |
| 43 webkit_glue::WebThreadImpl* GetWebThread() { return &thread_; } | 43 webkit_glue::WebThreadImpl* GetWebThread() { return &thread_; } |
| 44 | 44 |
| 45 MessageLoop* message_loop() { return thread_.message_loop(); } | 45 MessageLoop* message_loop() { return thread_.message_loop(); } |
| 46 | 46 |
| 47 void InitOnThread(); |
| 48 |
| 47 private: | 49 private: |
| 48 // Callback only from the compositor's thread. | 50 // Callback only from the compositor's thread. |
| 49 void RemoveInputHandler(int routing_id); | 51 void RemoveInputHandler(int routing_id); |
| 50 | 52 |
| 51 // Called from the compositor's thread. | 53 // Called from the compositor's thread. |
| 52 void HandleInputEvent(int routing_id, | 54 void HandleInputEvent(int routing_id, |
| 53 const WebKit::WebInputEvent* input_event); | 55 const WebKit::WebInputEvent* input_event); |
| 54 | 56 |
| 55 // Called from the compositor's thread. | 57 // Called from the compositor's thread. |
| 56 void AddInputHandlerOnCompositorThread( | 58 void AddInputHandlerOnCompositorThread( |
| 57 int routing_id, | 59 int routing_id, |
| 58 int input_handler_id, | 60 int input_handler_id, |
| 59 scoped_refptr<base::MessageLoopProxy> main_loop, | 61 scoped_refptr<base::MessageLoopProxy> main_loop, |
| 60 const base::WeakPtr<RenderViewImpl>& render_view_impl); | 62 const base::WeakPtr<RenderViewImpl>& render_view_impl); |
| 61 | 63 |
| 62 class InputHandlerWrapper; | 64 class InputHandlerWrapper; |
| 63 friend class InputHandlerWrapper; | 65 friend class InputHandlerWrapper; |
| 64 | 66 |
| 65 typedef std::map<int, // routing_id | 67 typedef std::map<int, // routing_id |
| 66 scoped_refptr<InputHandlerWrapper> > InputHandlerMap; | 68 scoped_refptr<InputHandlerWrapper> > InputHandlerMap; |
| 67 InputHandlerMap input_handlers_; | 69 InputHandlerMap input_handlers_; |
| 68 | 70 |
| 69 webkit_glue::WebThreadImpl thread_; | 71 webkit_glue::WebThreadImpl thread_; |
| 70 scoped_refptr<InputEventFilter> filter_; | 72 scoped_refptr<InputEventFilter> filter_; |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace content | 75 } // namespace content |
| 74 | 76 |
| 75 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ | 77 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ |
| OLD | NEW |