Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: content/renderer/gpu/compositor_thread.h

Issue 8089002: Input event filtering and compositor thread setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/gpu/compositor_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_thread.h
===================================================================
--- content/renderer/gpu/compositor_thread.h (revision 0)
+++ content/renderer/gpu/compositor_thread.h (revision 0)
@@ -0,0 +1,56 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_
+#define CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_
+
+#include <map>
+
+#include "base/memory/linked_ptr.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "webkit/glue/webthread_impl.h"
+
+namespace WebKit {
+class WebInputEvent;
+}
+
+class InputEventFilter;
+
+// The CompositorThread class manages the background thread for the compositor.
+// The CompositorThread instance can be assumed to outlive the background
+// thread it manages.
+class CompositorThread {
+ public:
+ // |main_listener| refers to the central IPC message listener that lives on
+ // the main thread, where all incoming IPC messages are first handled.
+ explicit CompositorThread(IPC::Channel::Listener* main_listener);
+ ~CompositorThread();
+
+ // This MessageFilter should be added to allow input events to be redirected
+ // to the compositor's thread.
+ IPC::ChannelProxy::MessageFilter* GetMessageFilter() const;
+
+ // Callable from the main thread or the compositor's thread.
+ void AddCompositor(int routing_id, int compositor_id);
+
+ private:
+ // Callback only from the compositor's thread.
+ void RemoveCompositor(int routing_id);
+
+ // Called from the compositor's thread.
+ void HandleInputEvent(int routing_id,
+ const WebKit::WebInputEvent* input_event);
+
+ class CompositorWrapper;
+ friend class CompositorWrapper;
+
+ typedef std::map<int, // routing_id
+ linked_ptr<CompositorWrapper> > CompositorMap;
+ CompositorMap compositors_;
+
+ webkit_glue::WebThreadImpl thread_;
+ scoped_refptr<InputEventFilter> filter_;
+};
+
+#endif // CONTENT_RENDERER_GPU_COMPOSITOR_THREAD_H_
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/gpu/compositor_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698