diff options
author | miletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-18 23:48:31 +0000 |
---|---|---|
committer | miletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-18 23:48:31 +0000 |
commit | de860e038998941c597c729d7812497a3b841574 (patch) | |
tree | 65205b79666d829bdb5c855f66cc0b9d57617b6a /content/port | |
parent | 0f7e0f99d14bf437dba6fbc497ea66b5aea92001 (diff) | |
download | chromium_src-de860e038998941c597c729d7812497a3b841574.zip chromium_src-de860e038998941c597c729d7812497a3b841574.tar.gz chromium_src-de860e038998941c597c729d7812497a3b841574.tar.bz2 |
Let ui::TouchEvent carry LatencyInfo
With this patch, ui::Event will carry the LatencyInfo. And we specifically
track key timestamps in LatencyInfo for ui::TouchEvent when the event is
passed around:
When ui::TouchEvent is created we put 2 timestamps:
INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT : The original timestamp the
event carries from the OS (e.g. kernel timestamp in CrOS case)
INPUT_EVENT_LATENCY_UI_COMPONENT : The timestamp when the ui::TouchEvent
is created.
Also when ui::TouchEvent is recreated from WebInputEvent (when touch
event queue pops the touch event to view), we set a timestamp in component
INPUT_EVENT_LATENCY_ACKED_COMPONENT.
Also move
"content/browser/renderer_host/event_with_latency_info.h"
to
"content/port/browser/event_with_latency_info.h"
BUG=chromium:246034
TEST=it compiles. content_unittests pass.
Review URL: https://chromiumcodereview.appspot.com/16911002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/port')
-rw-r--r-- | content/port/browser/event_with_latency_info.h | 42 | ||||
-rw-r--r-- | content/port/browser/render_widget_host_view_port.h | 3 |
2 files changed, 44 insertions, 1 deletions
diff --git a/content/port/browser/event_with_latency_info.h b/content/port/browser/event_with_latency_info.h new file mode 100644 index 0000000..70788f9 --- /dev/null +++ b/content/port/browser/event_with_latency_info.h @@ -0,0 +1,42 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_ +#define CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_ + +#include "ui/base/latency_info.h" + +namespace WebKit { +class WebGestureEvent; +class WebMouseEvent; +class WebMouseWheelEvent; +class WebTouchEvent; +} + +namespace content { + +template <typename T> +class EventWithLatencyInfo { + public: + T event; + ui::LatencyInfo latency; + + EventWithLatencyInfo(const T& e, const ui::LatencyInfo& l) + : event(e), latency(l) {} + + EventWithLatencyInfo() {} +}; + +typedef EventWithLatencyInfo<WebKit::WebGestureEvent> + GestureEventWithLatencyInfo; +typedef EventWithLatencyInfo<WebKit::WebMouseWheelEvent> + MouseWheelEventWithLatencyInfo; +typedef EventWithLatencyInfo<WebKit::WebMouseEvent> + MouseEventWithLatencyInfo; +typedef EventWithLatencyInfo<WebKit::WebTouchEvent> + TouchEventWithLatencyInfo; + +} // namespace content + +#endif // CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_ diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h index ddfaffb..9b1f7fc 100644 --- a/content/port/browser/render_widget_host_view_port.h +++ b/content/port/browser/render_widget_host_view_port.h @@ -10,6 +10,7 @@ #include "base/strings/string16.h" #include "cc/output/compositor_frame.h" #include "content/common/content_export.h" +#include "content/port/browser/event_with_latency_info.h" #include "content/port/common/input_event_ack_state.h" #include "content/public/browser/render_widget_host_view.h" #include "ipc/ipc_listener.h" @@ -258,7 +259,7 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView, // the GestureRecognizer until invocation of ProcessAckedTouchEvent releases // it to be consumed (when |ack_result| is NOT_CONSUMED OR NO_CONSUMER_EXISTS) // or ignored (when |ack_result| is CONSUMED). - virtual void ProcessAckedTouchEvent(const WebKit::WebTouchEvent& touch, + virtual void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) = 0; // Asks the view to create a smooth scroll gesture that will be used to |