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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 2917713002: Teach input_handler_proxy about once callbacks. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/events/blink/input_handler_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 void InputHandlerProxy::WillShutdown() { 291 void InputHandlerProxy::WillShutdown() {
292 scroll_elasticity_controller_.reset(); 292 scroll_elasticity_controller_.reset();
293 input_handler_ = NULL; 293 input_handler_ = NULL;
294 client_->WillShutdown(); 294 client_->WillShutdown();
295 } 295 }
296 296
297 void InputHandlerProxy::HandleInputEventWithLatencyInfo( 297 void InputHandlerProxy::HandleInputEventWithLatencyInfo(
298 WebScopedInputEvent event, 298 WebScopedInputEvent event,
299 const LatencyInfo& latency_info, 299 const LatencyInfo& latency_info,
300 const EventDispositionCallback& callback) { 300 EventDispositionCallback callback) {
301 DCHECK(input_handler_); 301 DCHECK(input_handler_);
302 302
303 if (uma_latency_reporting_enabled_) 303 if (uma_latency_reporting_enabled_)
304 ReportInputEventLatencyUma(*event, latency_info); 304 ReportInputEventLatencyUma(*event, latency_info);
305 305
306 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", 306 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow",
307 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), 307 TRACE_ID_DONT_MANGLE(latency_info.trace_id()),
308 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, 308 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
309 "step", "HandleInputEventImpl"); 309 "step", "HandleInputEventImpl");
310 310
311 std::unique_ptr<EventWithCallback> event_with_callback = 311 std::unique_ptr<EventWithCallback> event_with_callback =
312 base::MakeUnique<EventWithCallback>(std::move(event), latency_info, 312 base::MakeUnique<EventWithCallback>(std::move(event), latency_info,
313 tick_clock_->NowTicks(), callback); 313 tick_clock_->NowTicks(),
314 std::move(callback));
314 315
315 // Note: Other input can race ahead of gesture input as they don't have to go 316 // Note: Other input can race ahead of gesture input as they don't have to go
316 // through the queue, but we believe it's OK to do so. 317 // through the queue, but we believe it's OK to do so.
317 if (!compositor_event_queue_ || 318 if (!compositor_event_queue_ ||
318 !IsGestureScrollOrFlingOrPinch(event_with_callback->event().GetType())) { 319 !IsGestureScrollOrFlingOrPinch(event_with_callback->event().GetType())) {
319 DispatchSingleInputEvent(std::move(event_with_callback), 320 DispatchSingleInputEvent(std::move(event_with_callback),
320 tick_clock_->NowTicks()); 321 tick_clock_->NowTicks());
321 return; 322 return;
322 } 323 }
323 324
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1645 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1645 scroll_result)); 1646 scroll_result));
1646 } 1647 }
1647 1648
1648 void InputHandlerProxy::SetTickClockForTesting( 1649 void InputHandlerProxy::SetTickClockForTesting(
1649 std::unique_ptr<base::TickClock> tick_clock) { 1650 std::unique_ptr<base::TickClock> tick_clock) {
1650 tick_clock_ = std::move(tick_clock); 1651 tick_clock_ = std::move(tick_clock);
1651 } 1652 }
1652 1653
1653 } // namespace ui 1654 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/input_handler_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698