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

Side by Side Diff: blimp/common/create_blimp_message.cc

Issue 1876983002: Use Chromium BUILD to approximate Blimp protocol version, and check it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add disconnection message and unit-tests Created 4 years, 8 months 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698