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

Side by Side Diff: content/renderer/input/main_thread_event_queue.cc

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Fix a few DCHECK hits Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/renderer/input/main_thread_event_queue.h" 5 #include "content/renderer/input/main_thread_event_queue.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "content/common/input/event_with_latency_info.h" 8 #include "content/common/input/event_with_latency_info.h"
9 #include "content/common/input_messages.h" 9 #include "content/common/input_messages.h"
10 10
(...skipping 15 matching lines...) Expand all
26 return static_cast<const blink::WebTouchEvent&>(event->event()) 26 return static_cast<const blink::WebTouchEvent&>(event->event())
27 .dispatchType != blink::WebInputEvent::Blocking; 27 .dispatchType != blink::WebInputEvent::Blocking;
28 default: 28 default:
29 return false; 29 return false;
30 } 30 }
31 } 31 }
32 32
33 } // namespace 33 } // namespace
34 34
35 EventWithDispatchType::EventWithDispatchType( 35 EventWithDispatchType::EventWithDispatchType(
36 ui::ScopedWebInputEvent event, 36 blink::WebScopedInputEvent event,
37 const ui::LatencyInfo& latency, 37 const ui::LatencyInfo& latency,
38 InputEventDispatchType dispatch_type) 38 InputEventDispatchType dispatch_type)
39 : ScopedWebInputEventWithLatencyInfo(std::move(event), latency), 39 : ScopedWebInputEventWithLatencyInfo(std::move(event), latency),
40 dispatch_type_(dispatch_type), 40 dispatch_type_(dispatch_type),
41 non_blocking_coalesced_count_(0), 41 non_blocking_coalesced_count_(0),
42 creation_timestamp_(base::TimeTicks::Now()), 42 creation_timestamp_(base::TimeTicks::Now()),
43 last_coalesced_timestamp_(creation_timestamp_) {} 43 last_coalesced_timestamp_(creation_timestamp_) {}
44 44
45 EventWithDispatchType::~EventWithDispatchType() {} 45 EventWithDispatchType::~EventWithDispatchType() {}
46 46
(...skipping 29 matching lines...) Expand all
76 handle_raf_aligned_touch_input_( 76 handle_raf_aligned_touch_input_(
77 base::FeatureList::IsEnabled(features::kRafAlignedTouchInputEvents)), 77 base::FeatureList::IsEnabled(features::kRafAlignedTouchInputEvents)),
78 handle_raf_aligned_mouse_input_( 78 handle_raf_aligned_mouse_input_(
79 base::FeatureList::IsEnabled(features::kRafAlignedMouseInputEvents)), 79 base::FeatureList::IsEnabled(features::kRafAlignedMouseInputEvents)),
80 main_task_runner_(main_task_runner), 80 main_task_runner_(main_task_runner),
81 renderer_scheduler_(renderer_scheduler) {} 81 renderer_scheduler_(renderer_scheduler) {}
82 82
83 MainThreadEventQueue::~MainThreadEventQueue() {} 83 MainThreadEventQueue::~MainThreadEventQueue() {}
84 84
85 bool MainThreadEventQueue::HandleEvent( 85 bool MainThreadEventQueue::HandleEvent(
86 ui::ScopedWebInputEvent event, 86 blink::WebScopedInputEvent event,
87 const ui::LatencyInfo& latency, 87 const ui::LatencyInfo& latency,
88 InputEventDispatchType original_dispatch_type, 88 InputEventDispatchType original_dispatch_type,
89 InputEventAckState ack_result) { 89 InputEventAckState ack_result) {
90 DCHECK(original_dispatch_type == DISPATCH_TYPE_BLOCKING || 90 DCHECK(original_dispatch_type == DISPATCH_TYPE_BLOCKING ||
91 original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING); 91 original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING);
92 DCHECK(ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING || 92 DCHECK(ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING ||
93 ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING_DUE_TO_FLING || 93 ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING_DUE_TO_FLING ||
94 ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 94 ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
95 95
96 bool non_blocking = original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING || 96 bool non_blocking = original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING ||
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // additional frame. 345 // additional frame.
346 return static_cast<const blink::WebTouchEvent&>(event).dispatchType != 346 return static_cast<const blink::WebTouchEvent&>(event).dispatchType !=
347 blink::WebInputEvent::Blocking && 347 blink::WebInputEvent::Blocking &&
348 handle_raf_aligned_touch_input_; 348 handle_raf_aligned_touch_input_;
349 default: 349 default:
350 return false; 350 return false;
351 } 351 }
352 } 352 }
353 353
354 } // namespace content 354 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698