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

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: Split serialization and deserialization to message generators/processors. 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..bebad40c127a4caf9110dd333108ebda38a7606e
--- /dev/null
+++ b/blimp/net/input_message_generator.h
@@ -0,0 +1,36 @@
+// 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/memory/scoped_ptr.h"
+#include "blimp/net/blimp_net_export.h"
+
+namespace blink {
+class WebInputEvent;
+}
+
+namespace blimp {
+
+class InputMessage;
+
+// 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();
+ virtual ~InputMessageGenerator();
Wez 2015/11/17 01:37:40 nit: Does this need to be virtual? Will we ever su
David Trainor- moved to gerrit 2015/11/17 05:33:14 Good point it doesn't. I should also add DISALLOW
+
+ // Create an InputMessage that represents the WebInputEvent |event|. This
+ // might make use of state from previous messages.
+ void GenerateMessage(const blink::WebInputEvent& event,
+ InputMessage* message);
Wez 2015/11/17 01:37:40 Kevin's latest MessageProcessor API takes BlimpMes
David Trainor- moved to gerrit 2015/11/17 05:33:14 Ah yeah I saw that. I wasn't quite sure I could d
Wez 2015/11/18 02:18:32 It's feasible to have two distinct MessageProcesso
David Trainor- moved to gerrit 2015/11/18 08:26:30 Oh sorry I misread your comment! Will add.
David Trainor- moved to gerrit 2015/11/19 00:49:43 Looked into adding it and I think it would be clea
Wez 2015/11/23 22:41:41 There's no requirement for this object to set thos
+};
+
+} // namespace blimp
+
+#endif // BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_

Powered by Google App Engine
This is Rietveld 408576698