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 |
14 #include "third_party/protobuf/src/google/protobuf/message_lite.h" | 18 #include "third_party/protobuf/src/google/protobuf/message_lite.h" |
| 19 #endif |
15 | 20 |
16 namespace remoting { | 21 namespace remoting { |
17 namespace protocol { | 22 namespace protocol { |
18 | 23 |
19 // MessageDecoder uses CompoundBuffer to split the data received from | 24 // MessageDecoder uses CompoundBuffer to split the data received from |
20 // the network into separate messages. Each message is expected to be | 25 // the network into separate messages. Each message is expected to be |
21 // decoded in the stream as follows: | 26 // decoded in the stream as follows: |
22 // +--------------+--------------+ | 27 // +--------------+--------------+ |
23 // | message_size | message_data | | 28 // | message_size | message_data | |
24 // +--------------+--------------+ | 29 // +--------------+--------------+ |
(...skipping 27 matching lines...) Expand all Loading... |
52 // |next_payload_known_| is true if the size of the next payload is known. | 57 // |next_payload_known_| is true if the size of the next payload is known. |
53 // After one payload is read this is reset to false. | 58 // After one payload is read this is reset to false. |
54 int next_payload_; | 59 int next_payload_; |
55 bool next_payload_known_; | 60 bool next_payload_known_; |
56 }; | 61 }; |
57 | 62 |
58 } // namespace protocol | 63 } // namespace protocol |
59 } // namespace remoting | 64 } // namespace remoting |
60 | 65 |
61 #endif // REMOTING_PROTOCOL_MESSAGE_DECODER_H_ | 66 #endif // REMOTING_PROTOCOL_MESSAGE_DECODER_H_ |
OLD | NEW |