| OLD | NEW |
| 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/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "content/common/input/event_with_latency_info.h" | 10 #include "content/common/input/event_with_latency_info.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 case blink::WebInputEvent::TouchMove: | 23 case blink::WebInputEvent::TouchMove: |
| 24 return true; | 24 return true; |
| 25 default: | 25 default: |
| 26 return false; | 26 return false; |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 EventWithDispatchType::EventWithDispatchType( | 32 EventWithDispatchType::EventWithDispatchType( |
| 33 blink::WebScopedInputEvent event, | 33 ui::WebScopedInputEvent event, |
| 34 const ui::LatencyInfo& latency, | 34 const ui::LatencyInfo& latency, |
| 35 InputEventDispatchType dispatch_type) | 35 InputEventDispatchType dispatch_type) |
| 36 : ScopedWebInputEventWithLatencyInfo(std::move(event), latency), | 36 : ScopedWebInputEventWithLatencyInfo(std::move(event), latency), |
| 37 dispatch_type_(dispatch_type), | 37 dispatch_type_(dispatch_type), |
| 38 non_blocking_coalesced_count_(0), | 38 non_blocking_coalesced_count_(0), |
| 39 creation_timestamp_(base::TimeTicks::Now()), | 39 creation_timestamp_(base::TimeTicks::Now()), |
| 40 last_coalesced_timestamp_(creation_timestamp_) {} | 40 last_coalesced_timestamp_(creation_timestamp_) {} |
| 41 | 41 |
| 42 EventWithDispatchType::~EventWithDispatchType() {} | 42 EventWithDispatchType::~EventWithDispatchType() {} |
| 43 | 43 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } else { | 92 } else { |
| 93 main_thread_responsiveness_threshold_ = | 93 main_thread_responsiveness_threshold_ = |
| 94 base::TimeDelta::FromMilliseconds(threshold_ms); | 94 base::TimeDelta::FromMilliseconds(threshold_ms); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 MainThreadEventQueue::~MainThreadEventQueue() {} | 99 MainThreadEventQueue::~MainThreadEventQueue() {} |
| 100 | 100 |
| 101 bool MainThreadEventQueue::HandleEvent( | 101 bool MainThreadEventQueue::HandleEvent( |
| 102 blink::WebScopedInputEvent event, | 102 ui::WebScopedInputEvent event, |
| 103 const ui::LatencyInfo& latency, | 103 const ui::LatencyInfo& latency, |
| 104 InputEventDispatchType original_dispatch_type, | 104 InputEventDispatchType original_dispatch_type, |
| 105 InputEventAckState ack_result) { | 105 InputEventAckState ack_result) { |
| 106 DCHECK(original_dispatch_type == DISPATCH_TYPE_BLOCKING || | 106 DCHECK(original_dispatch_type == DISPATCH_TYPE_BLOCKING || |
| 107 original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING); | 107 original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING); |
| 108 DCHECK(ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING || | 108 DCHECK(ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING || |
| 109 ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING_DUE_TO_FLING || | 109 ack_result == INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING_DUE_TO_FLING || |
| 110 ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 110 ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 111 | 111 |
| 112 bool non_blocking = original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING || | 112 bool non_blocking = original_dispatch_type == DISPATCH_TYPE_NON_BLOCKING || |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 case blink::WebInputEvent::MouseWheel: | 358 case blink::WebInputEvent::MouseWheel: |
| 359 return handle_raf_aligned_mouse_input_; | 359 return handle_raf_aligned_mouse_input_; |
| 360 case blink::WebInputEvent::TouchMove: | 360 case blink::WebInputEvent::TouchMove: |
| 361 return handle_raf_aligned_touch_input_; | 361 return handle_raf_aligned_touch_input_; |
| 362 default: | 362 default: |
| 363 return false; | 363 return false; |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace content | 367 } // namespace content |
| OLD | NEW |