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

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

Issue 2166703003: Implement Main Thread RAF Aligned Input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_main_thread_queue
Patch Set: Clean prototype up Created 4 years, 4 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
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 3e9ab9c94b8989aecb31b56643b4e8b9d92cc222..b4c5728bc8213eb745bf8ebe488dbdd53145ccbb 100644
--- a/content/renderer/input/main_thread_event_queue.h
+++ b/content/renderer/input/main_thread_event_queue.h
@@ -30,17 +30,23 @@ class EventWithDispatchType : public ScopedWebInputEventWithLatencyInfo {
WARN_UNUSED_RESULT;
void CoalesceWith(const EventWithDispatchType& other);
- const std::deque<uint32_t>& eventsToAck() const { return eventsToAck_; }
+ const std::deque<uint32_t>& coalescedEventIds() const {
+ return coalesced_event_ids_;
+ }
InputEventDispatchType dispatchType() const { return dispatch_type_; }
+ base::TimeTicks creationTimestamp() const { return creation_timestamp_; }
+ base::TimeTicks coalescedTimestamp() const { return coalesced_timestamp_; }
private:
InputEventDispatchType dispatch_type_;
- // |eventsToAck_| contains the unique touch event id to be acked. If
+ // |coalesced_event_ids_| contains the unique touch event id to be acked. If
tdresser 2016/08/24 13:43:00 event id -> event ids
dtapuska 2016/08/24 17:10:06 done.
// the events are TouchEvents the value will be 0. More importantly for
tdresser 2016/08/24 13:43:00 Is this comment correct? Should it be "If the even
dtapuska 2016/08/24 17:10:06 done.
// those cases the deque ends up containing how many additional ACKs
// need to be sent.
- std::deque<uint32_t> eventsToAck_;
+ std::deque<uint32_t> coalesced_event_ids_;
+ base::TimeTicks creation_timestamp_;
+ base::TimeTicks coalesced_timestamp_;
tdresser 2016/08/24 13:43:00 Maybe: last_coalesced_timestamp_ or most_recent_co
dtapuska 2016/08/24 17:10:06 done
};
class CONTENT_EXPORT MainThreadEventQueueClient {
@@ -58,6 +64,7 @@ class CONTENT_EXPORT MainThreadEventQueueClient {
blink::WebInputEvent::Type type,
InputEventAckState ack_result,
uint32_t touch_event_id) = 0;
+ virtual void NeedsMainFrame(int routing_id) = 0;
};
// MainThreadEventQueue implements a queue for events that need to be
@@ -103,7 +110,8 @@ class CONTENT_EXPORT MainThreadEventQueue
int routing_id,
MainThreadEventQueueClient* client,
const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
- blink::scheduler::RendererScheduler* renderer_scheduler);
+ blink::scheduler::RendererScheduler* renderer_scheduler,
+ bool handle_raf_aligned_input);
// Called once the compositor has handled |event| and indicated that it is
// a non-blocking event to be queued to the main thread.
@@ -111,6 +119,7 @@ class CONTENT_EXPORT MainThreadEventQueue
const ui::LatencyInfo& latency,
InputEventDispatchType dispatch_type,
InputEventAckState ack_result);
+ void DispatchRafAlignedInput();
// Call once the main thread has handled an outstanding |type| event
// in flight.
@@ -124,7 +133,10 @@ class CONTENT_EXPORT MainThreadEventQueue
~MainThreadEventQueue();
void QueueEvent(std::unique_ptr<EventWithDispatchType> event);
void SendEventNotificationToMainThread();
- void PopEventOnMainThread();
+ void DispatchSingleEvent();
+ void DispatchInFlightEvent();
+ void PossiblyScheduleMainFrame();
+
void SendEventToMainThread(const blink::WebInputEvent* event,
const ui::LatencyInfo& latency,
InputEventDispatchType original_dispatch_type);
@@ -137,6 +149,8 @@ class CONTENT_EXPORT MainThreadEventQueue
bool is_flinging_;
bool last_touch_start_forced_nonblocking_due_to_fling_;
bool enable_fling_passive_listener_flag_;
+ bool handle_raf_aligned_input_;
+ bool sent_main_frame_request_;
tdresser 2016/08/24 13:42:59 We should indicate which members should only be ac
dtapuska 2016/08/24 17:10:06 done
base::Lock event_queue_lock_;
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698