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

Unified Diff: content/renderer/input/main_thread_event_queue.h

Issue 2557153002: Fix issues related to a continuous event getting coalesced with a discrete event. (Closed)
Patch Set: Fix nits Created 4 years 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/input_event_dispatch_type.h ('k') | content/renderer/input/main_thread_event_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/main_thread_event_queue.h
diff --git a/content/renderer/input/main_thread_event_queue.h b/content/renderer/input/main_thread_event_queue.h
index 3e256b1bb350d6bb004ea8c4153011d6f33e4bac..2df1388612bb3ba277af3bf022826b6d4d5e2506 100644
--- a/content/renderer/input/main_thread_event_queue.h
+++ b/content/renderer/input/main_thread_event_queue.h
@@ -26,12 +26,10 @@ class EventWithDispatchType : public ScopedWebInputEventWithLatencyInfo {
const ui::LatencyInfo& latency,
InputEventDispatchType dispatch_type);
~EventWithDispatchType();
- bool CanCoalesceWith(const EventWithDispatchType& other) const
- WARN_UNUSED_RESULT;
void CoalesceWith(const EventWithDispatchType& other);
- const std::deque<uint32_t>& coalescedEventIds() const {
- return coalesced_event_ids_;
+ const std::deque<uint32_t>& blockingCoalescedEventIds() const {
+ return blocking_coalesced_event_ids_;
}
InputEventDispatchType dispatchType() const { return dispatch_type_; }
base::TimeTicks creationTimestamp() const { return creation_timestamp_; }
@@ -39,14 +37,20 @@ class EventWithDispatchType : public ScopedWebInputEventWithLatencyInfo {
return last_coalesced_timestamp_;
}
+ size_t coalescedCount() const {
+ return non_blocking_coalesced_count_ + blocking_coalesced_event_ids_.size();
+ }
+
private:
InputEventDispatchType dispatch_type_;
- // |coalesced_event_ids_| contains the unique touch event ids to be acked. If
+ // Contains the unique touch event ids to be acked. If
// the events are not TouchEvents the values will be 0. More importantly for
// those cases the deque ends up containing how many additional ACKs
// need to be sent.
- std::deque<uint32_t> coalesced_event_ids_;
+ std::deque<uint32_t> blocking_coalesced_event_ids_;
+ // Contains the number of non-blocking events coalesced.
+ size_t non_blocking_coalesced_count_;
base::TimeTicks creation_timestamp_;
base::TimeTicks last_coalesced_timestamp_;
};
@@ -141,7 +145,7 @@ class CONTENT_EXPORT MainThreadEventQueue
InputEventDispatchType original_dispatch_type);
bool IsRafAlignedInputDisabled();
- bool IsRafAlignedEvent(const std::unique_ptr<EventWithDispatchType>& event);
+ bool IsRafAlignedEvent(const blink::WebInputEvent& event);
friend class MainThreadEventQueueTest;
int routing_id_;
« no previous file with comments | « content/common/input/input_event_dispatch_type.h ('k') | content/renderer/input/main_thread_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698