Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / remoting / protocol / message_serialization.h
blobc550fbeba8c75efeb52056fd6ce77a7fbd5749ee
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file defines utility methods used for encoding and decoding the protocol
6 // used in Chromoting.
8 #ifndef REMOTING_PROTOCOL_MESSAGE_SERIALIZATION_H_
9 #define REMOTING_PROTOCOL_MESSAGE_SERIALIZATION_H_
11 #include "net/base/io_buffer.h"
13 #if defined(USE_SYSTEM_PROTOBUF)
14 #include <google/protobuf/message_lite.h>
15 #else
16 #include "third_party/protobuf/src/google/protobuf/message_lite.h"
17 #endif
19 namespace remoting {
20 namespace protocol {
22 // Serialize the Protocol Buffer message and provide sufficient framing for
23 // sending it over the wire.
24 // This will provide sufficient prefix and suffix for the receiver side to
25 // decode the message.
26 scoped_refptr<net::IOBufferWithSize> SerializeAndFrameMessage(
27 const google::protobuf::MessageLite& msg);
29 } // namespace protocol
30 } // namespace remoting
32 #endif // REMOTING_PROTOCOL_MESSAGE_SERIALIZATION_H_