Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: remoting/protocol/host_event_dispatcher.h

Issue 2413553003: Add InputEventTimestampSource interface. (Closed)
Patch Set: msvc compilation Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/fake_connection_to_client.cc ('k') | remoting/protocol/host_event_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « remoting/protocol/fake_connection_to_client.cc ('k') | remoting/protocol/host_event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698