Commit fa22a78c authored by Sahel Sharify's avatar Sahel Sharify Committed by Commit Bot

Revert "Clean up DidStopFlinging IPC"

This reverts commit 7cb247dd.

Reason for revert: Check to see if the crash report in crbug.com/868849 goes away or not.

Original change's description:
> Clean up DidStopFlinging IPC
> 
> This cl also removes TouchscreenFlingInProgress function that is no
> longer needed.
> 
> Bug: 249063
> Change-Id: Icc939d654cdfe0cf38c843933f2fd469f843b74c
> Reviewed-on: https://chromium-review.googlesource.com/1145784
> Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
> Reviewed-by: Ken Buchanan <kenrb@chromium.org>
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Commit-Queue: Sahel Sharify <sahel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#578410}

TBR=kenrb@chromium.org,pdr@chromium.org,dtapuska@chromium.org,sahel@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 249063
Change-Id: Iee7200d3c4e388fccbc2dc6b86997a07a3a03f0a
Reviewed-on: https://chromium-review.googlesource.com/1155169Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Commit-Queue: Sahel Sharify <sahel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579166}
parent 629985b0
...@@ -449,6 +449,11 @@ bool FlingController::FlingCancellationIsDeferred() const { ...@@ -449,6 +449,11 @@ bool FlingController::FlingCancellationIsDeferred() const {
return fling_booster_ && fling_booster_->fling_cancellation_is_deferred(); return fling_booster_ && fling_booster_->fling_cancellation_is_deferred();
} }
bool FlingController::TouchscreenFlingInProgress() const {
return fling_in_progress_ && current_fling_parameters_.source_device ==
blink::kWebGestureDeviceTouchscreen;
}
gfx::Vector2dF FlingController::CurrentFlingVelocity() const { gfx::Vector2dF FlingController::CurrentFlingVelocity() const {
return current_fling_parameters_.velocity; return current_fling_parameters_.velocity;
} }
......
...@@ -99,6 +99,8 @@ class CONTENT_EXPORT FlingController { ...@@ -99,6 +99,8 @@ class CONTENT_EXPORT FlingController {
bool FlingCancellationIsDeferred() const; bool FlingCancellationIsDeferred() const;
bool TouchscreenFlingInProgress() const;
gfx::Vector2dF CurrentFlingVelocity() const; gfx::Vector2dF CurrentFlingVelocity() const;
// Returns the |TouchpadTapSuppressionController| instance. // Returns the |TouchpadTapSuppressionController| instance.
......
...@@ -94,6 +94,9 @@ bool GestureEventQueue::FlingCancellationIsDeferred() const { ...@@ -94,6 +94,9 @@ bool GestureEventQueue::FlingCancellationIsDeferred() const {
return fling_controller_.FlingCancellationIsDeferred(); return fling_controller_.FlingCancellationIsDeferred();
} }
bool GestureEventQueue::TouchscreenFlingInProgress() const {
return fling_controller_.TouchscreenFlingInProgress();
}
gfx::Vector2dF GestureEventQueue::CurrentFlingVelocity() const { gfx::Vector2dF GestureEventQueue::CurrentFlingVelocity() const {
return fling_controller_.CurrentFlingVelocity(); return fling_controller_.CurrentFlingVelocity();
} }
......
...@@ -117,6 +117,8 @@ class CONTENT_EXPORT GestureEventQueue { ...@@ -117,6 +117,8 @@ class CONTENT_EXPORT GestureEventQueue {
bool FlingCancellationIsDeferred() const; bool FlingCancellationIsDeferred() const;
bool TouchscreenFlingInProgress() const;
gfx::Vector2dF CurrentFlingVelocity() const; gfx::Vector2dF CurrentFlingVelocity() const;
void set_debounce_interval_time_ms_for_testing(int interval_ms) { void set_debounce_interval_time_ms_for_testing(int interval_ms) {
......
...@@ -51,6 +51,9 @@ class CONTENT_EXPORT InputRouterClient { ...@@ -51,6 +51,9 @@ class CONTENT_EXPORT InputRouterClient {
// from the renderer. // from the renderer.
virtual void OnSetWhiteListedTouchAction(cc::TouchAction touch_action) = 0; virtual void OnSetWhiteListedTouchAction(cc::TouchAction touch_action) = 0;
// Called when a renderer fling has terminated.
virtual void DidStopFlinging() = 0;
// Called when a GSB has started scrolling a viewport. // Called when a GSB has started scrolling a viewport.
virtual void DidStartScrollingViewport() = 0; virtual void DidStartScrollingViewport() = 0;
......
...@@ -257,6 +257,15 @@ void InputRouterImpl::DidOverscroll(const ui::DidOverscrollParams& params) { ...@@ -257,6 +257,15 @@ void InputRouterImpl::DidOverscroll(const ui::DidOverscrollParams& params) {
client_->DidOverscroll(fling_updated_params); client_->DidOverscroll(fling_updated_params);
} }
void InputRouterImpl::DidStopFlinging() {
DCHECK_GT(active_renderer_fling_count_, 0);
// Note that we're only guaranteed to get a fling end notification from the
// renderer, not from any other consumers. Consequently, the GestureEventQueue
// cannot use this bookkeeping for logic like tap suppression.
--active_renderer_fling_count_;
client_->DidStopFlinging();
}
void InputRouterImpl::DidStartScrollingViewport() { void InputRouterImpl::DidStartScrollingViewport() {
client_->DidStartScrollingViewport(); client_->DidStartScrollingViewport();
} }
...@@ -363,6 +372,10 @@ void InputRouterImpl::OnFilteringTouchEvent(const WebTouchEvent& touch_event) { ...@@ -363,6 +372,10 @@ void InputRouterImpl::OnFilteringTouchEvent(const WebTouchEvent& touch_event) {
output_stream_validator_.Validate(touch_event); output_stream_validator_.Validate(touch_event);
} }
bool InputRouterImpl::TouchscreenFlingInProgress() {
return gesture_event_queue_.TouchscreenFlingInProgress();
}
void InputRouterImpl::SendGestureEventImmediately( void InputRouterImpl::SendGestureEventImmediately(
const GestureEventWithLatencyInfo& gesture_event) { const GestureEventWithLatencyInfo& gesture_event) {
mojom::WidgetInputHandler::DispatchEventCallback callback = base::BindOnce( mojom::WidgetInputHandler::DispatchEventCallback callback = base::BindOnce(
...@@ -548,6 +561,11 @@ void InputRouterImpl::GestureEventHandled( ...@@ -548,6 +561,11 @@ void InputRouterImpl::GestureEventHandled(
InputEventAckStateToString(state)); InputEventAckStateToString(state));
if (source != InputEventAckSource::BROWSER) if (source != InputEventAckSource::BROWSER)
client_->DecrementInFlightEventCount(source); client_->DecrementInFlightEventCount(source);
if (gesture_event.event.GetType() ==
blink::WebInputEvent::kGestureFlingStart &&
state == INPUT_EVENT_ACK_STATE_CONSUMED) {
++active_renderer_fling_count_;
}
if (overscroll) { if (overscroll) {
DCHECK_EQ(WebInputEvent::kGestureScrollUpdate, DCHECK_EQ(WebInputEvent::kGestureScrollUpdate,
......
...@@ -93,6 +93,7 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter, ...@@ -93,6 +93,7 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter,
uint32_t unique_touch_event_id, uint32_t unique_touch_event_id,
InputEventAckState state) override; InputEventAckState state) override;
void DidOverscroll(const ui::DidOverscrollParams& params) override; void DidOverscroll(const ui::DidOverscrollParams& params) override;
void DidStopFlinging() override;
void ImeCancelComposition() override; void ImeCancelComposition() override;
void DidStartScrollingViewport() override; void DidStartScrollingViewport() override;
void ImeCompositionRangeChanged( void ImeCompositionRangeChanged(
...@@ -126,6 +127,7 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter, ...@@ -126,6 +127,7 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter,
InputEventAckSource ack_source, InputEventAckSource ack_source,
InputEventAckState ack_result) override; InputEventAckState ack_result) override;
void OnFilteringTouchEvent(const blink::WebTouchEvent& touch_event) override; void OnFilteringTouchEvent(const blink::WebTouchEvent& touch_event) override;
bool TouchscreenFlingInProgress() override;
// GestureEventFilterClient // GestureEventFilterClient
void SendGestureEventImmediately( void SendGestureEventImmediately(
......
...@@ -134,6 +134,8 @@ class MockInputRouterImplClient : public InputRouterImplClient { ...@@ -134,6 +134,8 @@ class MockInputRouterImplClient : public InputRouterImplClient {
input_router_client_.DidOverscroll(params); input_router_client_.DidOverscroll(params);
} }
void DidStopFlinging() override { input_router_client_.DidStopFlinging(); }
void DidStartScrollingViewport() override { void DidStartScrollingViewport() override {
input_router_client_.DidStartScrollingViewport(); input_router_client_.DidStartScrollingViewport();
} }
......
...@@ -60,6 +60,9 @@ void MockInputRouterClient::OnSetWhiteListedTouchAction( ...@@ -60,6 +60,9 @@ void MockInputRouterClient::OnSetWhiteListedTouchAction(
white_listed_touch_action_ = white_listed_touch_action; white_listed_touch_action_ = white_listed_touch_action;
} }
void MockInputRouterClient::DidStopFlinging() {
}
void MockInputRouterClient::DidStartScrollingViewport() {} void MockInputRouterClient::DidStartScrollingViewport() {}
void MockInputRouterClient::ForwardGestureEventWithLatencyInfo( void MockInputRouterClient::ForwardGestureEventWithLatencyInfo(
......
...@@ -33,6 +33,7 @@ class MockInputRouterClient : public InputRouterClient, ...@@ -33,6 +33,7 @@ class MockInputRouterClient : public InputRouterClient,
void OnHasTouchEventHandlers(bool has_handlers) override; void OnHasTouchEventHandlers(bool has_handlers) override;
void DidOverscroll(const ui::DidOverscrollParams& params) override; void DidOverscroll(const ui::DidOverscrollParams& params) override;
void OnSetWhiteListedTouchAction(cc::TouchAction touch_action) override; void OnSetWhiteListedTouchAction(cc::TouchAction touch_action) override;
void DidStopFlinging() override;
void DidStartScrollingViewport() override; void DidStartScrollingViewport() override;
void ForwardWheelEventWithLatencyInfo( void ForwardWheelEventWithLatencyInfo(
const blink::WebMouseWheelEvent& wheel_event, const blink::WebMouseWheelEvent& wheel_event,
......
...@@ -33,6 +33,8 @@ class CONTENT_EXPORT PassthroughTouchEventQueueClient { ...@@ -33,6 +33,8 @@ class CONTENT_EXPORT PassthroughTouchEventQueueClient {
virtual void OnFilteringTouchEvent( virtual void OnFilteringTouchEvent(
const blink::WebTouchEvent& touch_event) = 0; const blink::WebTouchEvent& touch_event) = 0;
virtual bool TouchscreenFlingInProgress() = 0;
}; };
// A queue that processes a touch-event and forwards it on to the // A queue that processes a touch-event and forwards it on to the
......
...@@ -94,6 +94,8 @@ class PassthroughTouchEventQueueTest : public testing::Test, ...@@ -94,6 +94,8 @@ class PassthroughTouchEventQueueTest : public testing::Test,
void OnFilteringTouchEvent(const blink::WebTouchEvent& touch_event) override { void OnFilteringTouchEvent(const blink::WebTouchEvent& touch_event) override {
} }
bool TouchscreenFlingInProgress() override { return false; }
protected: protected:
void SetUpForTouchMoveSlopTesting(double slop_length_dips) { void SetUpForTouchMoveSlopTesting(double slop_length_dips) {
slop_length_dips_ = slop_length_dips; slop_length_dips_ = slop_length_dips;
......
...@@ -713,7 +713,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl ...@@ -713,7 +713,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// Returns the keyboard layout mapping. // Returns the keyboard layout mapping.
base::flat_map<std::string, std::string> GetKeyboardLayoutMap(); base::flat_map<std::string, std::string> GetKeyboardLayoutMap();
void DidStopFlinging(); void DidStopFlinging() override;
void GetContentRenderingTimeoutFrom(RenderWidgetHostImpl* other); void GetContentRenderingTimeoutFrom(RenderWidgetHostImpl* other);
......
...@@ -174,6 +174,9 @@ interface WidgetInputHandlerHost { ...@@ -174,6 +174,9 @@ interface WidgetInputHandlerHost {
// restrictions on the root scroll offset. // restrictions on the root scroll offset.
DidOverscroll(DidOverscrollParams params); DidOverscroll(DidOverscrollParams params);
// Sent by the compositor when a fling animation is stopped.
DidStopFlinging();
// Sent by the compositor when a GSB has started scrolling the viewport. // Sent by the compositor when a GSB has started scrolling the viewport.
DidStartScrollingViewport(); DidStartScrollingViewport();
......
...@@ -49,6 +49,7 @@ class CONTENT_EXPORT InputHandlerManagerClient { ...@@ -49,6 +49,7 @@ class CONTENT_EXPORT InputHandlerManagerClient {
// Otherwise |DidOverscroll| will be fired. // Otherwise |DidOverscroll| will be fired.
virtual void DidOverscroll(int routing_id, virtual void DidOverscroll(int routing_id,
const ui::DidOverscrollParams& params) = 0; const ui::DidOverscrollParams& params) = 0;
virtual void DidStopFlinging(int routing_id) = 0;
virtual void DidStartScrollingViewport(int routing_id) = 0; virtual void DidStartScrollingViewport(int routing_id) = 0;
virtual void DispatchNonBlockingEventToMainThread( virtual void DispatchNonBlockingEventToMainThread(
int routing_id, int routing_id,
......
...@@ -145,6 +145,9 @@ class WebLayerTreeView { ...@@ -145,6 +145,9 @@ class WebLayerTreeView {
// dirty. // dirty.
virtual void SetNeedsBeginFrame() {} virtual void SetNeedsBeginFrame() {}
// Relays the end of a fling animation.
virtual void DidStopFlinging() {}
// Run layout and paint of all pending document changes asynchronously. // Run layout and paint of all pending document changes asynchronously.
virtual void LayoutAndPaintAsync(base::OnceClosure callback) {} virtual void LayoutAndPaintAsync(base::OnceClosure callback) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment