| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_ | 5 #ifndef BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_ |
| 6 #define BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_ | 6 #define BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "blimp/net/blimp_net_export.h" | 11 #include "blimp/net/blimp_net_export.h" |
| 12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 class WebGestureEvent; | 15 class WebGestureEvent; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace blimp { | 18 namespace blimp { |
| 19 | 19 |
| 20 class BlimpMessage; | 20 class BlimpMessage; |
| 21 class BlimpMessageProcessor; | |
| 22 | 21 |
| 23 // Handles creating serialized InputMessage protos from a stream of | 22 // Handles creating serialized InputMessage protos from a stream of |
| 24 // WebGestureEvents. This class may be stateful to optimize the size of the | 23 // WebGestureEvents. This class may be stateful to optimize the size of the |
| 25 // serialized transmission data. See InputMessageConverter for the deserialize | 24 // serialized transmission data. See InputMessageConverter for the deserialize |
| 26 // code. | 25 // code. |
| 27 class BLIMP_NET_EXPORT InputMessageGenerator { | 26 class BLIMP_NET_EXPORT InputMessageGenerator { |
| 28 public: | 27 public: |
| 29 InputMessageGenerator(); | 28 InputMessageGenerator(); |
| 30 ~InputMessageGenerator(); | 29 ~InputMessageGenerator(); |
| 31 | 30 |
| 32 // Builds a BlimpMessage from |event| that has the basic input event fields | 31 // Builds a BlimpMessage from |event| that has the basic input event fields |
| 33 // populated. This might make use of state sent from previous | 32 // populated. This might make use of state sent from previous |
| 34 // BlimpMessage::INPUT messages. It is up to the caller to populate the | 33 // BlimpMessage::INPUT messages. It is up to the caller to populate the |
| 35 // non-input fields and to send the BlimpMessage. | 34 // non-input fields and to send the BlimpMessage. |
| 36 std::unique_ptr<BlimpMessage> GenerateMessage( | 35 std::unique_ptr<BlimpMessage> GenerateMessage( |
| 37 const blink::WebGestureEvent& event); | 36 const blink::WebGestureEvent& event); |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 DISALLOW_COPY_AND_ASSIGN(InputMessageGenerator); | 39 DISALLOW_COPY_AND_ASSIGN(InputMessageGenerator); |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 } // namespace blimp | 42 } // namespace blimp |
| 44 | 43 |
| 45 #endif // BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_ | 44 #endif // BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_ |
| OLD | NEW |