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" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ProtocolControlMessage* control_message = output->mutable_protocol_control(); | 119 ProtocolControlMessage* control_message = output->mutable_protocol_control(); |
120 control_message->set_type(ProtocolControlMessage::CHECKPOINT_ACK); | 120 control_message->set_type(ProtocolControlMessage::CHECKPOINT_ACK); |
121 | 121 |
122 CheckpointAckMessage* checkpoint_ack_message = | 122 CheckpointAckMessage* checkpoint_ack_message = |
123 control_message->mutable_checkpoint_ack(); | 123 control_message->mutable_checkpoint_ack(); |
124 checkpoint_ack_message->set_checkpoint_id(checkpoint_id); | 124 checkpoint_ack_message->set_checkpoint_id(checkpoint_id); |
125 | 125 |
126 return output; | 126 return output; |
127 } | 127 } |
128 | 128 |
| 129 std::unique_ptr<BlimpMessage> CreateEndConnectionMessage( |
| 130 EndConnectionMessage::Reason reason) { |
| 131 std::unique_ptr<BlimpMessage> output(new BlimpMessage); |
| 132 output->set_type(BlimpMessage::PROTOCOL_CONTROL); |
| 133 |
| 134 ProtocolControlMessage* control_message = output->mutable_protocol_control(); |
| 135 control_message->set_type(ProtocolControlMessage::END_CONNECTION); |
| 136 |
| 137 EndConnectionMessage* end_connection_message = |
| 138 control_message->mutable_end_connection(); |
| 139 end_connection_message->set_reason(reason); |
| 140 |
| 141 return output; |
| 142 } |
| 143 |
129 } // namespace blimp | 144 } // namespace blimp |
OLD | NEW |