| 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 #include "blimp/common/create_blimp_message.h" | 5 #include "blimp/common/create_blimp_message.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "blimp/common/proto/blimp_message.pb.h" | 10 #include "blimp/common/proto/blimp_message.pb.h" |
| 11 #include "blimp/common/proto/blob_channel.pb.h" |
| 11 #include "blimp/common/proto/compositor.pb.h" | 12 #include "blimp/common/proto/compositor.pb.h" |
| 12 #include "blimp/common/proto/input.pb.h" | 13 #include "blimp/common/proto/input.pb.h" |
| 13 #include "blimp/common/proto/render_widget.pb.h" | 14 #include "blimp/common/proto/render_widget.pb.h" |
| 14 #include "blimp/common/proto/settings.pb.h" | 15 #include "blimp/common/proto/settings.pb.h" |
| 15 #include "blimp/common/proto/tab_control.pb.h" | 16 #include "blimp/common/proto/tab_control.pb.h" |
| 16 | 17 |
| 17 namespace blimp { | 18 namespace blimp { |
| 18 | 19 |
| 19 std::unique_ptr<BlimpMessage> CreateBlimpMessage( | 20 std::unique_ptr<BlimpMessage> CreateBlimpMessage( |
| 20 CompositorMessage** compositor_message, | 21 CompositorMessage** compositor_message, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 return output; | 74 return output; |
| 74 } | 75 } |
| 75 | 76 |
| 76 std::unique_ptr<BlimpMessage> CreateBlimpMessage( | 77 std::unique_ptr<BlimpMessage> CreateBlimpMessage( |
| 77 EngineSettingsMessage** engine_settings) { | 78 EngineSettingsMessage** engine_settings) { |
| 78 std::unique_ptr<BlimpMessage> output(new BlimpMessage); | 79 std::unique_ptr<BlimpMessage> output(new BlimpMessage); |
| 79 *engine_settings = output->mutable_settings()->mutable_engine_settings(); | 80 *engine_settings = output->mutable_settings()->mutable_engine_settings(); |
| 80 return output; | 81 return output; |
| 81 } | 82 } |
| 82 | 83 |
| 84 std::unique_ptr<BlimpMessage> CreateBlimpMessage( |
| 85 BlobChannelMessage** blob_channel_message) { |
| 86 std::unique_ptr<BlimpMessage> output(new BlimpMessage); |
| 87 *blob_channel_message = output->mutable_blob_channel(); |
| 88 return output; |
| 89 } |
| 90 |
| 83 std::unique_ptr<BlimpMessage> CreateStartConnectionMessage( | 91 std::unique_ptr<BlimpMessage> CreateStartConnectionMessage( |
| 84 const std::string& client_token, | 92 const std::string& client_token, |
| 85 int protocol_version) { | 93 int protocol_version) { |
| 86 std::unique_ptr<BlimpMessage> output(new BlimpMessage); | 94 std::unique_ptr<BlimpMessage> output(new BlimpMessage); |
| 87 | 95 |
| 88 ProtocolControlMessage* control_message = output->mutable_protocol_control(); | 96 ProtocolControlMessage* control_message = output->mutable_protocol_control(); |
| 89 control_message->mutable_start_connection(); | 97 control_message->mutable_start_connection(); |
| 90 | 98 |
| 91 StartConnectionMessage* start_connection_message = | 99 StartConnectionMessage* start_connection_message = |
| 92 control_message->mutable_start_connection(); | 100 control_message->mutable_start_connection(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 104 control_message->mutable_checkpoint_ack(); | 112 control_message->mutable_checkpoint_ack(); |
| 105 | 113 |
| 106 CheckpointAckMessage* checkpoint_ack_message = | 114 CheckpointAckMessage* checkpoint_ack_message = |
| 107 control_message->mutable_checkpoint_ack(); | 115 control_message->mutable_checkpoint_ack(); |
| 108 checkpoint_ack_message->set_checkpoint_id(checkpoint_id); | 116 checkpoint_ack_message->set_checkpoint_id(checkpoint_id); |
| 109 | 117 |
| 110 return output; | 118 return output; |
| 111 } | 119 } |
| 112 | 120 |
| 113 } // namespace blimp | 121 } // namespace blimp |
| OLD | NEW |