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

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

Issue 2835193002: Get rid of the in_flight_event. (Closed)
Patch Set: Created 3 years, 8 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/renderer/input/main_thread_event_queue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/main_thread_event_queue.cc
diff --git a/content/renderer/input/main_thread_event_queue.cc b/content/renderer/input/main_thread_event_queue.cc
index 45e12e3efbdd72400d2eed6d41c77d13327b5c3d..94d1d49ea111c0c446852a4f64f44468014625ba 100644
--- a/content/renderer/input/main_thread_event_queue.cc
+++ b/content/renderer/input/main_thread_event_queue.cc
@@ -344,13 +344,6 @@ void MainThreadEventQueue::QueueClosure(const base::Closure& closure) {
PostTaskToMainThread();
}
-void MainThreadEventQueue::DispatchInFlightEvent() {
- if (in_flight_event_) {
- in_flight_event_->Dispatch(this);
- in_flight_event_.reset();
- }
-}
-
void MainThreadEventQueue::PossiblyScheduleMainFrame() {
if (IsRafAlignedInputDisabled())
return;
@@ -386,15 +379,16 @@ void MainThreadEventQueue::DispatchEvents() {
}
while (events_to_process--) {
+ std::unique_ptr<MainThreadEventQueueTask> task;
{
base::AutoLock lock(shared_state_lock_);
if (shared_state_.events_.empty())
return;
- in_flight_event_ = shared_state_.events_.Pop();
+ task = shared_state_.events_.Pop();
}
// Dispatching the event is outside of critical section.
- DispatchInFlightEvent();
+ task->Dispatch(this);
}
PossiblyScheduleMainFrame();
}
@@ -427,6 +421,7 @@ void MainThreadEventQueue::DispatchRafAlignedInput(base::TimeTicks frame_time) {
}
while (queue_size_at_start--) {
+ std::unique_ptr<MainThreadEventQueueTask> task;
{
base::AutoLock lock(shared_state_lock_);
@@ -445,11 +440,10 @@ void MainThreadEventQueue::DispatchRafAlignedInput(base::TimeTicks frame_time) {
shared_state_.last_async_touch_move_timestamp_ = frame_time;
}
}
- in_flight_event_ = shared_state_.events_.Pop();
+ task = shared_state_.events_.Pop();
}
-
// Dispatching the event is outside of critical section.
- DispatchInFlightEvent();
+ task->Dispatch(this);
}
PossiblyScheduleMainFrame();
« no previous file with comments | « content/renderer/input/main_thread_event_queue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698