OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef REMOTING_PROTOCOL_MESSAGE_DECODER_H_ | 5 #ifndef REMOTING_PROTOCOL_MESSAGE_DECODER_H_ |
6 #define REMOTING_PROTOCOL_MESSAGE_DECODER_H_ | 6 #define REMOTING_PROTOCOL_MESSAGE_DECODER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
13 #include "remoting/base/compound_buffer.h" | 13 #include "remoting/base/compound_buffer.h" |
14 | |
15 #if defined(USE_SYSTEM_PROTOBUF) | |
16 #include <google/protobuf/message_lite.h> | |
17 #else | |
18 #include "third_party/protobuf/src/google/protobuf/message_lite.h" | 14 #include "third_party/protobuf/src/google/protobuf/message_lite.h" |
19 #endif | |
20 | 15 |
21 namespace remoting { | 16 namespace remoting { |
22 namespace protocol { | 17 namespace protocol { |
23 | 18 |
24 // MessageDecoder uses CompoundBuffer to split the data received from | 19 // MessageDecoder uses CompoundBuffer to split the data received from |
25 // the network into separate messages. Each message is expected to be | 20 // the network into separate messages. Each message is expected to be |
26 // decoded in the stream as follows: | 21 // decoded in the stream as follows: |
27 // +--------------+--------------+ | 22 // +--------------+--------------+ |
28 // | message_size | message_data | | 23 // | message_size | message_data | |
29 // +--------------+--------------+ | 24 // +--------------+--------------+ |
(...skipping 27 matching lines...) Expand all Loading... |
57 // |next_payload_known_| is true if the size of the next payload is known. | 52 // |next_payload_known_| is true if the size of the next payload is known. |
58 // After one payload is read this is reset to false. | 53 // After one payload is read this is reset to false. |
59 int next_payload_; | 54 int next_payload_; |
60 bool next_payload_known_; | 55 bool next_payload_known_; |
61 }; | 56 }; |
62 | 57 |
63 } // namespace protocol | 58 } // namespace protocol |
64 } // namespace remoting | 59 } // namespace remoting |
65 | 60 |
66 #endif // REMOTING_PROTOCOL_MESSAGE_DECODER_H_ | 61 #endif // REMOTING_PROTOCOL_MESSAGE_DECODER_H_ |
OLD | NEW |