| 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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/renderer/render_view_impl.h" | 12 #include "content/renderer/render_view_impl.h" |
| 13 #include "ipc/ipc_channel_proxy.h" | 13 #include "ipc/ipc_channel_proxy.h" |
| 14 #include "webkit/glue/webthread_impl.h" | 14 #include "webkit/glue/webthread_impl.h" |
| 15 | 15 |
| 16 namespace WebKit { | 16 namespace WebKit { |
| 17 class WebInputEvent; | 17 class WebInputEvent; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class InputEventFilter; | 20 class InputEventFilter; |
| 21 | 21 |
| 22 // The CompositorThread class manages the background thread for the compositor. | 22 // The CompositorThread class manages the background thread for the compositor. |
| 23 // The CompositorThread instance can be assumed to outlive the background | 23 // The CompositorThread instance can be assumed to outlive the background |
| 24 // thread it manages. | 24 // thread it manages. |
| 25 class CompositorThread { | 25 class CompositorThread { |
| 26 public: | 26 public: |
| 27 // |main_listener| refers to the central IPC message listener that lives on | 27 // |main_listener| refers to the central IPC message listener that lives on |
| 28 // the main thread, where all incoming IPC messages are first handled. | 28 // the main thread, where all incoming IPC messages are first handled. |
| 29 explicit CompositorThread(IPC::Channel::Listener* main_listener); | 29 explicit CompositorThread(IPC::Listener* main_listener); |
| 30 ~CompositorThread(); | 30 ~CompositorThread(); |
| 31 | 31 |
| 32 // This MessageFilter should be added to allow input events to be redirected | 32 // This MessageFilter should be added to allow input events to be redirected |
| 33 // to the compositor's thread. | 33 // to the compositor's thread. |
| 34 IPC::ChannelProxy::MessageFilter* GetMessageFilter() const; | 34 IPC::ChannelProxy::MessageFilter* GetMessageFilter() const; |
| 35 | 35 |
| 36 // Callable from the main thread only. | 36 // Callable from the main thread only. |
| 37 void AddInputHandler(int routing_id, | 37 void AddInputHandler(int routing_id, |
| 38 int input_handler_id, | 38 int input_handler_id, |
| 39 const base::WeakPtr<RenderViewImpl>& render_view_impl); | 39 const base::WeakPtr<RenderViewImpl>& render_view_impl); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 60 | 60 |
| 61 typedef std::map<int, // routing_id | 61 typedef std::map<int, // routing_id |
| 62 scoped_refptr<InputHandlerWrapper> > InputHandlerMap; | 62 scoped_refptr<InputHandlerWrapper> > InputHandlerMap; |
| 63 InputHandlerMap input_handlers_; | 63 InputHandlerMap input_handlers_; |
| 64 | 64 |
| 65 webkit_glue::WebThreadImpl thread_; | 65 webkit_glue::WebThreadImpl thread_; |
| 66 scoped_refptr<InputEventFilter> filter_; | 66 scoped_refptr<InputEventFilter> filter_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ | 69 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_ |
| OLD | NEW |