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

Unified Diff: content/common/input/event_with_latency_info.cc

Issue 2621303004: Keep track of coalesced events in main thread event queue (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/input/event_with_latency_info.h ('k') | content/common/input_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d4ea6731bc9e04f671cf0dc6b32c1762ac0d4f5b 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))),
+ 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::coalesced_event() const {
return *event_;
}
« no previous file with comments | « content/common/input/event_with_latency_info.h ('k') | content/common/input_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698