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

Unified Diff: remoting/protocol/host_event_dispatcher.cc

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/host_event_dispatcher.h ('k') | remoting/protocol/ice_connection_to_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/host_event_dispatcher.cc
diff --git a/remoting/protocol/host_event_dispatcher.cc b/remoting/protocol/host_event_dispatcher.cc
index 0ee78d0d59185dc0d63728b826c913bbba6b60cd..5d3269a0ddc639788c0d0ee2fb7f1f850bc8f35a 100644
--- a/remoting/protocol/host_event_dispatcher.cc
+++ b/remoting/protocol/host_event_dispatcher.cc
@@ -4,6 +4,7 @@
#include "remoting/protocol/host_event_dispatcher.h"
+#include "base/memory/ref_counted.h"
#include "net/socket/stream_socket.h"
#include "remoting/base/compound_buffer.h"
#include "remoting/base/constants.h"
@@ -16,7 +17,9 @@ namespace remoting {
namespace protocol {
HostEventDispatcher::HostEventDispatcher()
- : ChannelDispatcherBase(kEventChannelName) {}
+ : ChannelDispatcherBase(kEventChannelName),
+ event_timestamps_source_(new InputEventTimestampsSourceImpl()) {}
+
HostEventDispatcher::~HostEventDispatcher() {}
void HostEventDispatcher::OnIncomingMessage(
@@ -28,8 +31,9 @@ void HostEventDispatcher::OnIncomingMessage(
if (!message)
return;
- if (!on_input_event_callback_.is_null())
- on_input_event_callback_.Run(message->timestamp());
+ event_timestamps_source_->OnEventReceived(InputEventTimestamps{
+ base::TimeTicks::FromInternalValue(message->timestamp()),
+ base::TimeTicks::Now()});
if (message->has_key_event()) {
const KeyEvent& event = message->key_event();
« no previous file with comments | « remoting/protocol/host_event_dispatcher.h ('k') | remoting/protocol/ice_connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698