| Index: components/pairing/proto_decoder.cc
|
| diff --git a/components/pairing/proto_decoder.cc b/components/pairing/proto_decoder.cc
|
| index 52853d30cb9113958e588d9bfad82f05b109989f..c0e01a6c049234b33d1550cb6b34f9110960998f 100644
|
| --- a/components/pairing/proto_decoder.cc
|
| +++ b/components/pairing/proto_decoder.cc
|
| @@ -16,6 +16,7 @@ enum {
|
| MESSAGE_COMPLETE_SETUP,
|
| MESSAGE_ERROR,
|
| MESSAGE_ADD_NETWORK,
|
| + MESSAGE_REBOOT,
|
| NUM_MESSAGES,
|
| };
|
| }
|
| @@ -112,6 +113,12 @@ bool ProtoDecoder::DecodeIOBuffer(int size,
|
| observer_->OnAddNetworkMessage(message);
|
| }
|
| break;
|
| + case MESSAGE_REBOOT: {
|
| + pairing_api::Reboot message;
|
| + message.ParseFromArray(&buffer[0], buffer.size());
|
| + observer_->OnRebootMessage(message);
|
| + }
|
| + break;
|
|
|
| default:
|
| LOG(WARNING) << "Skipping unknown message type: " << next_message_type_;
|
| @@ -180,6 +187,16 @@ ProtoDecoder::IOBufferRefPtr ProtoDecoder::SendError(
|
| return SendMessage(MESSAGE_ERROR, serialized_proto, size);
|
| }
|
|
|
| +ProtoDecoder::IOBufferRefPtr ProtoDecoder::SendRebootHost(
|
| + const pairing_api::Reboot& message,
|
| + int* size) {
|
| + std::string serialized_proto;
|
| + if (!message.SerializeToString(&serialized_proto))
|
| + NOTREACHED();
|
| +
|
| + return SendMessage(MESSAGE_REBOOT, serialized_proto, size);
|
| +}
|
| +
|
| ProtoDecoder::IOBufferRefPtr ProtoDecoder::SendMessage(
|
| uint8_t message_type,
|
| const std::string& message,
|
|
|