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

Unified Diff: blimp/net/input_message_generator.h

Issue 1426993008: Serialize a subset of WebInputEvents to protobufs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove commented out old messages in input.proto Created 5 years, 1 month 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
Index: blimp/net/input_message_generator.h
diff --git a/blimp/net/input_message_generator.h b/blimp/net/input_message_generator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d92e83cc3ea2ef5b7370afb24d22e4219f220d20
--- /dev/null
+++ b/blimp/net/input_message_generator.h
@@ -0,0 +1,43 @@
+// Copyright 2015 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 BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_
+#define BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "blimp/net/blimp_net_export.h"
+#include "net/base/completion_callback.h"
+
+namespace blink {
+class WebInputEvent;
+}
+
+namespace blimp {
+
+class BlimpMessage;
+class BlimpMessageProcessor;
+
+// Handles creating serialized InputMessage protos from a stream of
+// WebInputEvents. This class may be stateful to optimize the size of the
+// serialized transmission data. See InputMessageProcessor for the deserialize
+// code.
+class BLIMP_NET_EXPORT InputMessageGenerator {
+ public:
+ InputMessageGenerator();
+ ~InputMessageGenerator();
+
+ // Builds a BlimpMessage from |event| that has the basic input event fields
+ // populated. It is up to the caller to populate the rest of the required
+ // fields and to send the BlimpMessage. This might make use of state sent
+ // from previous messages.
Wez 2015/11/25 23:52:02 nit: You want the "This might make use..." to foll
David Trainor- moved to gerrit 2015/11/30 04:29:26 Done.
+ scoped_ptr<BlimpMessage> GenerateMessage(const blink::WebInputEvent& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InputMessageGenerator);
+};
+
+} // namespace blimp
+
+#endif // BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_

Powered by Google App Engine
This is Rietveld 408576698