Index: remoting/protocol/message_reader.h |
diff --git a/remoting/protocol/message_reader.h b/remoting/protocol/message_reader.h |
index 65d52d0a8bbe5cfb34965be2ef64eb982e8220e9..720f99bf6903040279265fd8bce3c257a4b975d2 100644 |
--- a/remoting/protocol/message_reader.h |
+++ b/remoting/protocol/message_reader.h |
@@ -9,6 +9,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "base/threading/non_thread_safe.h" |
+#include "base/time/time.h" |
#include "remoting/base/compound_buffer.h" |
#include "remoting/protocol/message_decoder.h" |
@@ -45,12 +46,17 @@ class MessageReader : public base::NonThreadSafe { |
// Starts reading from |socket|. |
void StartReading(net::Socket* socket); |
+ base::TimeDelta last_message_read_delay() { |
Wez
2015/01/21 01:35:40
nit: Add a brief comment to explain what this mean
Sergey Ulanov
2015/01/29 01:33:29
Done.
|
+ return last_message_read_delay_; |
+ } |
+ |
private: |
void DoRead(); |
void OnRead(int result); |
void HandleReadResult(int result); |
void OnDataReceived(net::IOBuffer* data, int data_size); |
- void RunCallback(scoped_ptr<CompoundBuffer> message); |
+ void RunCallback(scoped_ptr<CompoundBuffer> message, |
+ base::TimeDelta read_delay); |
void OnMessageDone(); |
net::Socket* socket_; |
@@ -72,6 +78,9 @@ class MessageReader : public base::NonThreadSafe { |
// Callback is called when a message is received. |
MessageReceivedCallback message_received_callback_; |
+ base::TimeTicks last_message_started_time_; |
+ base::TimeDelta last_message_read_delay_; |
Wez
2015/01/21 01:35:40
nit: Suggest adding a block comment e.g. "Used to
Sergey Ulanov
2015/01/29 01:33:29
Done.
|
+ |
base::WeakPtrFactory<MessageReader> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(MessageReader); |