Chromium Code Reviews| Index: content/common/input/event_with_latency_info.cc |
| diff --git a/content/common/input/event_with_latency_info.cc b/content/common/input/event_with_latency_info.cc |
| index 79084e5aa128bc67706f566581f503bb56748337..2d6dddc1dde0d36ec0b58d13c9a6f5cf61e39351 100644 |
| --- a/content/common/input/event_with_latency_info.cc |
| +++ b/content/common/input/event_with_latency_info.cc |
| @@ -11,7 +11,8 @@ namespace content { |
| ScopedWebInputEventWithLatencyInfo::ScopedWebInputEventWithLatencyInfo( |
| blink::WebScopedInputEvent event, |
| const ui::LatencyInfo& latency_info) |
| - : event_(std::move(event)), latency_(latency_info) {} |
| + : event_(new blink::WebCoalescedInputEvent(std::move(event))), |
|
dcheng
2017/01/23 19:38:58
Not required in this CL, but maybe WebCoalescedInp
Navid Zolghadr
2017/01/23 21:42:04
Acknowledged.
|
| + latency_(latency_info) {} |
| ScopedWebInputEventWithLatencyInfo::~ScopedWebInputEventWithLatencyInfo() {} |
| @@ -29,8 +30,9 @@ void ScopedWebInputEventWithLatencyInfo::CoalesceWith( |
| // New events get coalesced into older events, and the newer timestamp |
| // should always be preserved. |
| const double time_stamp_seconds = other.event().timeStampSeconds(); |
| - ui::Coalesce(other.event(), event_.get()); |
| - event_->setTimeStampSeconds(time_stamp_seconds); |
| + ui::Coalesce(other.event(), event_->eventPointer()); |
| + event_->eventPointer()->setTimeStampSeconds(time_stamp_seconds); |
| + event_->addCoalescedEvent(other.event()); |
| // When coalescing two input events, we keep the oldest LatencyInfo |
| // since it will represent the longest latency. |
| @@ -39,10 +41,15 @@ void ScopedWebInputEventWithLatencyInfo::CoalesceWith( |
| } |
| const blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() const { |
| - return *event_; |
| + return event_->event(); |
| } |
| blink::WebInputEvent& ScopedWebInputEventWithLatencyInfo::event() { |
| + return *event_->eventPointer(); |
| +} |
| + |
| +const blink::WebCoalescedInputEvent& |
| +ScopedWebInputEventWithLatencyInfo::coalescedEvent() const { |
| return *event_; |
| } |