OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_MESSAGES_DECODER_H_ | 5 #ifndef REMOTING_PROTOCOL_MESSAGES_DECODER_H_ |
6 #define REMOTING_PROTOCOL_MESSAGES_DECODER_H_ | 6 #define REMOTING_PROTOCOL_MESSAGES_DECODER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 | 10 |
11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
13 #include "google/protobuf/message_lite.h" | 13 #include "google/protobuf/message_lite.h" |
| 14 #include "remoting/base/multiple_array_input_stream.h" |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 class DrainableIOBuffer; | 17 class DrainableIOBuffer; |
17 class IOBuffer; | 18 class IOBuffer; |
18 } // namespace net | 19 } // namespace net |
19 | 20 |
20 namespace remoting { | 21 namespace remoting { |
21 | 22 |
22 class ChromotingClientMessage; | 23 class ChromotingClientMessage; |
23 class ChromotingHostMessage; | 24 class ChromotingHostMessage; |
24 class ClientControlMessage; | 25 class ClientControlMessage; |
25 class ClientEventMessage; | 26 class ClientEventMessage; |
26 class HostControlMessage; | 27 class HostControlMessage; |
27 class HostEventMessage; | 28 class HostEventMessage; |
28 class MultipleArrayInputStream; | |
29 | 29 |
30 // MessageDecoder uses MultipleArrayInputStream to decode bytes into | 30 // MessageDecoder uses MultipleArrayInputStream to decode bytes into |
31 // protocol buffer messages. This can be used to decode bytes received from | 31 // protocol buffer messages. This can be used to decode bytes received from |
32 // the network. | 32 // the network. |
33 // | 33 // |
34 // It provides ParseMessages() which accepts an IOBuffer. If enough bytes | 34 // It provides ParseMessages() which accepts an IOBuffer. If enough bytes |
35 // are collected to produce protocol buffer messages then the bytes will be | 35 // are collected to produce protocol buffer messages then the bytes will be |
36 // consumed and the generated protocol buffer messages are added to the output | 36 // consumed and the generated protocol buffer messages are added to the output |
37 // list. | 37 // list. |
38 // | 38 // |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // |next_payload_| stores the size of the next payload if known. | 101 // |next_payload_| stores the size of the next payload if known. |
102 // |next_payload_known_| is true if the size of the next payload is known. | 102 // |next_payload_known_| is true if the size of the next payload is known. |
103 // After one payload is read this is reset to false. | 103 // After one payload is read this is reset to false. |
104 int next_payload_; | 104 int next_payload_; |
105 bool next_payload_known_; | 105 bool next_payload_known_; |
106 }; | 106 }; |
107 | 107 |
108 } // namespace remoting | 108 } // namespace remoting |
109 | 109 |
110 #endif // REMOTING_PROTOCOL_MESSAGES_DECODER_H_ | 110 #endif // REMOTING_PROTOCOL_MESSAGES_DECODER_H_ |
OLD | NEW |