Index: remoting/protocol/message_decoder.h |
diff --git a/remoting/protocol/message_decoder.h b/remoting/protocol/message_decoder.h |
index fc42871ddee5dacc6bc5477509f35b002fc324d5..2bcf9d285363524c027f96ad433208449b932ac2 100644 |
--- a/remoting/protocol/message_decoder.h |
+++ b/remoting/protocol/message_decoder.h |
@@ -35,6 +35,10 @@ class MessageDecoder { |
MessageDecoder(); |
virtual ~MessageDecoder(); |
+ // True if the buffer is empty. If the buffer is empty and GetNextMessage() |
+ // returns nullptr it means that the buffer contains incomplete messages. |
+ bool is_buffer_empty() { return buffer_.total_bytes() == 0; } |
+ |
// Add next chunk of data. MessageDecoder retains |data| until all |
// its bytes are consumed. |
void AddData(scoped_refptr<net::IOBuffer> data, int data_size); |