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

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

Issue 19220002: [WIP] BufferedInputRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix client assignment Created 7 years, 3 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/renderer/gpu/input_event_filter_unittest.cc ('k') | content/renderer/gpu/renderer_event_packet.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/renderer_event_packet.h
diff --git a/content/renderer/gpu/renderer_event_packet.h b/content/renderer/gpu/renderer_event_packet.h
new file mode 100644
index 0000000000000000000000000000000000000000..1bc5c391cfb1cad0977dca04e0002da79126d555
--- /dev/null
+++ b/content/renderer/gpu/renderer_event_packet.h
@@ -0,0 +1,71 @@
+// Copyright (c) 2013 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_RENDERER_EVENT_PACKET_H_
+#define CONTENT_RENDERER_GPU_RENDERER_EVENT_PACKET_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "content/common/content_export.h"
+#include "content/common/input/input_event_disposition.h"
+#include "ipc/ipc_message.h"
+
+namespace ui {
+struct LatencyInfo;
+}
+
+namespace WebKit {
+class WebInputEvent;
+}
+
+namespace content {
+
+class EventPacket;
+
+// Utility wrapper class for handling EventPacket dispatch in the renderer.
+class RendererEventPacket {
+ public:
+ // |packet| is assumed to outlive the constructed RendererEventPacket.
+ RendererEventPacket(const EventPacket* packet,
+ const InputEventDispositions& dispositions);
+ ~RendererEventPacket();
+
+ // Provides dispatch of individual |InputEvent| payloads.
+ class Dispatcher {
+ public:
+ virtual ~Dispatcher() {}
+ virtual InputEventDisposition Dispatch(const IPC::Message& message) = 0;
+ virtual InputEventDisposition Dispatch(int routing_id,
+ const WebKit::WebInputEvent* event,
+ const ui::LatencyInfo& latency_info,
+ bool is_keyboard_shortcut) = 0;
+ };
+
+ enum DispatchThreadType {
+ THREAD_MAIN,
+ THREAD_IMPL
+ };
+
+ // Attempts to dispatch all unprocessed events to |dispatcher| until an
+ // unhandled event prevents further dispatch (e.g., touch event).
+ // Returns the appropriate message for the result, either
+ // * |InputHostMsg_HandleEventPacket_ACK| if dispatch is complete, or
+ // * |InputMsg_HandleEventPacket| if the packet needs forwarding.
+ scoped_ptr<IPC::Message> DispatchWith(Dispatcher* dispatcher,
+ DispatchThreadType thread_type,
+ int routing_id);
+
+ private:
+ const EventPacket* packet_;
+ InputEventDispositions dispositions_;
+
+ DISALLOW_COPY_AND_ASSIGN(RendererEventPacket);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_GPU_RENDERER_EVENT_PACKET_H_
« no previous file with comments | « content/renderer/gpu/input_event_filter_unittest.cc ('k') | content/renderer/gpu/renderer_event_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698