| 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/common/input/event_with_latency_info.h" | 5 #include "content/common/input/event_with_latency_info.h" |
| 6 | 6 |
| 7 #include <bitset> | 7 #include <bitset> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include "content/common/input/web_input_event_traits.h" | 9 #include "content/common/input/web_input_event_traits.h" |
| 10 | 10 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 if (event_to_coalesce.type == blink::WebInputEvent::MouseWheel && | 247 if (event_to_coalesce.type == blink::WebInputEvent::MouseWheel && |
| 248 event->type == blink::WebInputEvent::MouseWheel) { | 248 event->type == blink::WebInputEvent::MouseWheel) { |
| 249 Coalesce(static_cast<const blink::WebMouseWheelEvent&>(event_to_coalesce), | 249 Coalesce(static_cast<const blink::WebMouseWheelEvent&>(event_to_coalesce), |
| 250 static_cast<blink::WebMouseWheelEvent*>(event)); | 250 static_cast<blink::WebMouseWheelEvent*>(event)); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace internal | 254 } // namespace internal |
| 255 | 255 |
| 256 ScopedWebInputEventWithLatencyInfo::ScopedWebInputEventWithLatencyInfo( | 256 ScopedWebInputEventWithLatencyInfo::ScopedWebInputEventWithLatencyInfo( |
| 257 const WebInputEvent& event, | 257 ScopedWebInputEvent event, |
| 258 const ui::LatencyInfo& latency_info) | 258 const ui::LatencyInfo& latency_info) |
| 259 : event_(WebInputEventTraits::Clone(event)), latency_(latency_info) {} | 259 : event_(std::move(event)), latency_(latency_info) { |
| 260 } |
| 260 | 261 |
| 261 ScopedWebInputEventWithLatencyInfo::~ScopedWebInputEventWithLatencyInfo() {} | 262 ScopedWebInputEventWithLatencyInfo::~ScopedWebInputEventWithLatencyInfo() {} |
| 262 | 263 |
| 263 bool ScopedWebInputEventWithLatencyInfo::CanCoalesceWith( | 264 bool ScopedWebInputEventWithLatencyInfo::CanCoalesceWith( |
| 264 const ScopedWebInputEventWithLatencyInfo& other) const { | 265 const ScopedWebInputEventWithLatencyInfo& other) const { |
| 265 return internal::CanCoalesce(other.event(), event()); | 266 return internal::CanCoalesce(other.event(), event()); |
| 266 } | 267 } |
| 267 | 268 |
| 268 void ScopedWebInputEventWithLatencyInfo::CoalesceWith( | 269 void ScopedWebInputEventWithLatencyInfo::CoalesceWith( |
| 269 const ScopedWebInputEventWithLatencyInfo& other) { | 270 const ScopedWebInputEventWithLatencyInfo& other) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 285 | 286 |
| 286 const blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() const { | 287 const blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() const { |
| 287 return *event_; | 288 return *event_; |
| 288 } | 289 } |
| 289 | 290 |
| 290 blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() { | 291 blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() { |
| 291 return *event_; | 292 return *event_; |
| 292 } | 293 } |
| 293 | 294 |
| 294 } // namespace content | 295 } // namespace content |
| OLD | NEW |