OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_READER_H_ | 5 #ifndef REMOTING_PROTOCOL_MESSAGE_READER_H_ |
6 #define REMOTING_PROTOCOL_MESSAGE_READER_H_ | 6 #define REMOTING_PROTOCOL_MESSAGE_READER_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // OnRead() to be called when new data is received. | 66 // OnRead() to be called when new data is received. |
67 bool read_pending_; | 67 bool read_pending_; |
68 | 68 |
69 // Number of messages that we received, but haven't finished | 69 // Number of messages that we received, but haven't finished |
70 // processing yet, i.e. |done_task| hasn't been called for these | 70 // processing yet, i.e. |done_task| hasn't been called for these |
71 // messages. | 71 // messages. |
72 int pending_messages_; | 72 int pending_messages_; |
73 | 73 |
74 bool closed_; | 74 bool closed_; |
75 scoped_refptr<net::IOBuffer> read_buffer_; | 75 scoped_refptr<net::IOBuffer> read_buffer_; |
76 net::OldCompletionCallbackImpl<MessageReader> read_callback_; | |
77 | 76 |
78 MessageDecoder message_decoder_; | 77 MessageDecoder message_decoder_; |
79 | 78 |
80 // Callback is called when a message is received. | 79 // Callback is called when a message is received. |
81 MessageReceivedCallback message_received_callback_; | 80 MessageReceivedCallback message_received_callback_; |
82 }; | 81 }; |
83 | 82 |
84 // Version of MessageReader for protocol buffer messages, that parses | 83 // Version of MessageReader for protocol buffer messages, that parses |
85 // each incoming message. | 84 // each incoming message. |
86 template <class T> | 85 template <class T> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 121 } |
123 | 122 |
124 scoped_refptr<MessageReader> message_reader_; | 123 scoped_refptr<MessageReader> message_reader_; |
125 MessageReceivedCallback message_received_callback_; | 124 MessageReceivedCallback message_received_callback_; |
126 }; | 125 }; |
127 | 126 |
128 } // namespace protocol | 127 } // namespace protocol |
129 } // namespace remoting | 128 } // namespace remoting |
130 | 129 |
131 #endif // REMOTING_PROTOCOL_MESSAGE_READER_H_ | 130 #endif // REMOTING_PROTOCOL_MESSAGE_READER_H_ |
OLD | NEW |