Index: remoting/protocol/host_event_dispatcher.h |
diff --git a/remoting/protocol/host_event_dispatcher.h b/remoting/protocol/host_event_dispatcher.h |
index 4c9df5e31f0c127ad23a3eeb131694cd399d12d9..98186ddd2c28ea8ffc998f5b267342c1cdca40fe 100644 |
--- a/remoting/protocol/host_event_dispatcher.h |
+++ b/remoting/protocol/host_event_dispatcher.h |
@@ -9,6 +9,7 @@ |
#include "base/macros.h" |
#include "remoting/protocol/channel_dispatcher_base.h" |
+#include "remoting/protocol/input_event_timestamps.h" |
namespace remoting { |
namespace protocol { |
@@ -20,8 +21,6 @@ class InputStub; |
// channel to InputStub. |
class HostEventDispatcher : public ChannelDispatcherBase { |
public: |
- typedef base::Callback<void(int64_t)> OnInputEventCallback; |
- |
HostEventDispatcher(); |
~HostEventDispatcher() override; |
@@ -30,17 +29,24 @@ class HostEventDispatcher : public ChannelDispatcherBase { |
// the dispatcher. |
void set_input_stub(InputStub* input_stub) { input_stub_ = input_stub; } |
- // Set callback to notify of each message's sequence number. The |
- // callback cannot tear down this object. |
- void set_on_input_event_callback(const OnInputEventCallback& value) { |
- on_input_event_callback_ = value; |
+ // Returns InputEventTimestampsSource for events received on input channel. |
+ // |
+ // TODO(sergeyu): This timestamps source generates timestamps for input events |
+ // as they are received. This means that any potential delay in the input |
+ // injector is not accounted for. Consider moving this to InputInjector to |
+ // ensure that the timestamps source emits timestamps for each input event |
+ // only after it's injected. This would require updating InputStub to get |
+ // timestamps for each event. |
+ scoped_refptr<InputEventTimestampsSource> event_timestamps_source() { |
+ return event_timestamps_source_; |
} |
private: |
void OnIncomingMessage(std::unique_ptr<CompoundBuffer> buffer) override; |
+ scoped_refptr<InputEventTimestampsSourceImpl> event_timestamps_source_; |
+ |
InputStub* input_stub_ = nullptr; |
- OnInputEventCallback on_input_event_callback_; |
DISALLOW_COPY_AND_ASSIGN(HostEventDispatcher); |
}; |