Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_impl.h |
| diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h |
| index 9f809db8ff5cd87f6515ac352ab6e1fd64cc9bfd..5c9f91625ab113e4d68c5937f29f006cf4a19ce4 100644 |
| --- a/content/browser/renderer_host/render_widget_host_impl.h |
| +++ b/content/browser/renderer_host/render_widget_host_impl.h |
| @@ -23,6 +23,7 @@ |
| #include "base/time.h" |
| #include "base/timer.h" |
| #include "build/build_config.h" |
| +#include "cc/debug/latency_info.h" |
| #include "content/common/view_message_enums.h" |
| #include "content/port/common/input_event_ack_state.h" |
| #include "content/public/browser/render_widget_host.h" |
| @@ -67,6 +68,7 @@ class WebLayer; |
| namespace content { |
| class BackingStore; |
| class GestureEventFilter; |
| +class GestureEventLatency; |
| class MockRenderWidgetHost; |
| class OverscrollController; |
| class RenderWidgetHostDelegate; |
| @@ -253,7 +255,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| virtual void ForwardTouchEvent(const WebKit::WebTouchEvent& touch_event); |
| // Forwards the given event immediately to the renderer. |
| - void ForwardMouseEventImmediately(const WebKit::WebMouseEvent& mouse_event); |
| + void ForwardMouseEventImmediately(const WebKit::WebMouseEvent& mouse_event, |
| + const cc::LatencyInfo& latency_info); |
| void ForwardTouchEventImmediately(const WebKit::WebTouchEvent& touch_event); |
| void ForwardGestureEventImmediately( |
| const WebKit::WebGestureEvent& gesture_event); |
| @@ -459,17 +462,45 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| // suppress_next_char_events_. |
| void SuppressNextCharEvents(); |
| + void FrameSwapped(const cc::LatencyInfo& latency_info); |
| + |
| + // Returns the ID that uniquely describes this component to the latency |
| + // subsystem. |
| + int64 GetLatencyComponentId(); |
| + |
| + class FrameSwappedObserver { |
|
piman
2013/04/22 20:46:38
There doesn't seem to be any implementation of thi
|
| + public: |
| + virtual void OnFrameSwapped(RenderWidgetHostImpl* rwhi, |
| + const cc::LatencyInfo& latency_info) = 0; |
| + }; |
| + |
| + void AddFrameSwappedObserver(FrameSwappedObserver* observer); |
| + void RemoveFrameSwappedObserver(FrameSwappedObserver* observer); |
| + |
| protected: |
| virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
| // Transmits the given input event. This is an internal helper for |
| // |ForwardInputEvent()| and should not be used directly from elsewhere. |
| void SendInputEvent(const WebKit::WebInputEvent& input_event, |
| - int event_size, bool is_keyboard_shortcut); |
| + int event_size, const cc::LatencyInfo& latency_info, |
| + bool is_keyboard_shortcut); |
| // Internal implementation of the public Forward*Event() methods. |
| void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
| - int event_size, bool is_keyboard_shortcut); |
| + int event_size, const cc::LatencyInfo& latency_info, |
| + bool is_keyboard_shortcut); |
| + |
| + // Internal forwarding implementations that take a LatencyInfo. |
| + virtual void ForwardMouseEventWithLatencyInfo( |
| + const WebKit::WebMouseEvent& mouse_event, |
| + const cc::LatencyInfo& latency_info); |
| + virtual void ForwardWheelEventWithLatencyInfo( |
| + const WebKit::WebMouseWheelEvent& wheel_event, |
| + const cc::LatencyInfo& latency_info); |
| + |
| + // Create a LatencyInfo struct for a new input event that was just received. |
| + cc::LatencyInfo NewInputLatencyInfo(); |
| // Called when we receive a notification indicating that the renderer |
| // process has gone. This will reset our state so that our state will be |
| @@ -740,13 +771,15 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| // The next mouse move event to send (only non-null while mouse_move_pending_ |
| // is true). |
| scoped_ptr<WebKit::WebMouseEvent> next_mouse_move_; |
| + cc::LatencyInfo next_mouse_move_latency_info_; |
| // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent |
| // and we are waiting for a corresponding ack. |
| bool mouse_wheel_pending_; |
| WebKit::WebMouseWheelEvent current_wheel_event_; |
| - typedef std::deque<WebKit::WebMouseWheelEvent> WheelEventQueue; |
| + typedef std::deque<std::pair<WebKit::WebMouseWheelEvent, cc::LatencyInfo> > |
|
piman
2013/04/22 20:46:38
nit: rather than a std::pair, an explicit struct i
|
| + WheelEventQueue; |
| // (Similar to |next_mouse_move_|.) The next mouse wheel events to send. |
| // Unlike mouse moves, mouse wheel events received while one is pending are |
| @@ -878,6 +911,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, |
| // List of callbacks for pending snapshot requests to the renderer. |
| std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; |
| + int64 last_input_number_; |
| + |
| + ObserverList<FrameSwappedObserver> frame_swapped_observer_list_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| }; |