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

Unified Diff: ui/events/blink/input_handler_proxy.h

Issue 2265393002: Refactor compositor event handling path to be callback-based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: creis's review, rebase Created 4 years, 3 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 | « content/renderer/mus/render_widget_mus_connection.cc ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy.h
diff --git a/ui/events/blink/input_handler_proxy.h b/ui/events/blink/input_handler_proxy.h
index 6320b558470fbdbc6130692ac838e91b9a9b0058..a578c5c441cfcf4ffd5727de169aa2e7ce87239e 100644
--- a/ui/events/blink/input_handler_proxy.h
+++ b/ui/events/blink/input_handler_proxy.h
@@ -15,6 +15,7 @@
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebActiveWheelFlingParameters.h"
#include "ui/events/blink/input_scroll_elasticity_controller.h"
+#include "ui/events/blink/scoped_web_input_event.h"
#include "ui/events/blink/synchronous_input_handler_proxy.h"
namespace ui {
@@ -55,9 +56,15 @@ class InputHandlerProxy
DID_HANDLE_NON_BLOCKING,
DROP_EVENT
};
- EventDisposition HandleInputEventWithLatencyInfo(
- const blink::WebInputEvent& event,
- ui::LatencyInfo* latency_info);
+ using EventDispositionCallback =
+ base::Callback<void(EventDisposition,
+ ScopedWebInputEvent WebInputEvent,
+ const LatencyInfo&,
+ std::unique_ptr<ui::DidOverscrollParams>)>;
+ void HandleInputEventWithLatencyInfo(
+ ScopedWebInputEvent event,
+ const LatencyInfo& latency_info,
+ const EventDispositionCallback& callback);
EventDisposition HandleInputEvent(const blink::WebInputEvent& event);
// cc::InputHandlerClient implementation.
@@ -138,9 +145,11 @@ class InputHandlerProxy
void RequestAnimation();
// Used to send overscroll messages to the browser.
- void HandleOverscroll(
- const gfx::Point& causal_event_viewport_point,
- const cc::InputHandlerScrollResult& scroll_result);
+ // |bundle_overscroll_params_with_ack| means overscroll message should be
+ // bundled with triggering event response, and won't fire |DidOverscroll|.
+ void HandleOverscroll(const gfx::Point& causal_event_viewport_point,
+ const cc::InputHandlerScrollResult& scroll_result,
+ bool bundle_overscroll_params_with_ack);
// Whether to use a smooth scroll animation for this event.
bool ShouldAnimate(bool has_precise_scroll_deltas) const;
@@ -210,6 +219,12 @@ class InputHandlerProxy
base::TimeTicks last_fling_animate_time_;
+ // Used to record overscroll notifications while an event is being
+ // dispatched. If the event causes overscroll, the overscroll metadata can be
+ // bundled in the event ack, saving an IPC. Note that we must continue
+ // supporting overscroll IPC notifications due to fling animation updates.
+ std::unique_ptr<DidOverscrollParams> current_overscroll_params_;
+
DISALLOW_COPY_AND_ASSIGN(InputHandlerProxy);
};
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.cc ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698