Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/renderer/input/scoped_web_input_event_with_latency_info.h" |
| 6 | 6 |
| 7 using blink::WebInputEvent; | 7 using blink::WebInputEvent; |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 ScopedWebInputEventWithLatencyInfo::ScopedWebInputEventWithLatencyInfo( | 11 ScopedWebInputEventWithLatencyInfo::ScopedWebInputEventWithLatencyInfo( |
| 12 blink::WebScopedInputEvent event, | 12 ui::WebScopedInputEvent event, |
| 13 const ui::LatencyInfo& latency_info) | 13 const ui::LatencyInfo& latency_info) |
| 14 : event_(new blink::WebCoalescedInputEvent(std::move(event))), | 14 : event_(new blink::WebCoalescedInputEvent(*(event.get()))), |
|
dcheng
2017/02/10 10:17:25
Nit: I think *event should suffice here.
jam
2017/02/10 15:48:58
Done.
| |
| 15 latency_(latency_info) {} | 15 latency_(latency_info) {} |
| 16 | 16 |
| 17 ScopedWebInputEventWithLatencyInfo::~ScopedWebInputEventWithLatencyInfo() {} | 17 ScopedWebInputEventWithLatencyInfo::~ScopedWebInputEventWithLatencyInfo() {} |
| 18 | 18 |
| 19 bool ScopedWebInputEventWithLatencyInfo::CanCoalesceWith( | 19 bool ScopedWebInputEventWithLatencyInfo::CanCoalesceWith( |
| 20 const ScopedWebInputEventWithLatencyInfo& other) const { | 20 const ScopedWebInputEventWithLatencyInfo& other) const { |
| 21 return ui::CanCoalesce(other.event(), event()); | 21 return ui::CanCoalesce(other.event(), event()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ScopedWebInputEventWithLatencyInfo::CoalesceWith( | 24 void ScopedWebInputEventWithLatencyInfo::CoalesceWith( |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 47 blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() { | 47 blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() { |
| 48 return *event_->eventPointer(); | 48 return *event_->eventPointer(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 const blink::WebCoalescedInputEvent& | 51 const blink::WebCoalescedInputEvent& |
| 52 ScopedWebInputEventWithLatencyInfo::coalesced_event() const { | 52 ScopedWebInputEventWithLatencyInfo::coalesced_event() const { |
| 53 return *event_; | 53 return *event_; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace content | 56 } // namespace content |
| OLD | NEW |