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

Side by Side Diff: content/renderer/input/input_event_filter.cc

Issue 2166703003: Implement Main Thread RAF Aligned Input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_main_thread_queue
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/input/input_event_filter.h" 5 #include "content/renderer/input/input_event_filter.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 base::AutoLock locked(routes_lock_); 111 base::AutoLock locked(routes_lock_);
112 RouteQueueMap::iterator iter = route_queues_.find(routing_id); 112 RouteQueueMap::iterator iter = route_queues_.find(routing_id);
113 if (iter == route_queues_.end() || !iter->second) 113 if (iter == route_queues_.end() || !iter->second)
114 return; 114 return;
115 queue = iter->second; 115 queue = iter->second;
116 } 116 }
117 117
118 queue->EventHandled(type, ack_result); 118 queue->EventHandled(type, ack_result);
119 } 119 }
120 120
121 void InputEventFilter::ProcessVSyncAlignedInput(int routing_id) {
122 DCHECK(main_task_runner_->BelongsToCurrentThread());
123 scoped_refptr<MainThreadEventQueue> queue;
124 {
125 base::AutoLock locked(routes_lock_);
126 RouteQueueMap::iterator iter = route_queues_.find(routing_id);
127 if (iter == route_queues_.end() || !iter->second)
128 return;
129 queue = iter->second;
130 }
131
132 queue->DispatchVSyncAlignedInput();
133 }
134
121 void InputEventFilter::OnFilterAdded(IPC::Sender* sender) { 135 void InputEventFilter::OnFilterAdded(IPC::Sender* sender) {
122 io_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 136 io_task_runner_ = base::ThreadTaskRunnerHandle::Get();
123 sender_ = sender; 137 sender_ = sender;
124 } 138 }
125 139
126 void InputEventFilter::OnFilterRemoved() { 140 void InputEventFilter::OnFilterRemoved() {
127 sender_ = NULL; 141 sender_ = NULL;
128 } 142 }
129 143
130 void InputEventFilter::OnChannelClosing() { 144 void InputEventFilter::OnChannelClosing() {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 void InputEventFilter::SendInputEventAck(int routing_id, 265 void InputEventFilter::SendInputEventAck(int routing_id,
252 blink::WebInputEvent::Type type, 266 blink::WebInputEvent::Type type,
253 InputEventAckState ack_result, 267 InputEventAckState ack_result,
254 uint32_t touch_event_id) { 268 uint32_t touch_event_id) {
255 InputEventAck ack(type, ack_result, touch_event_id); 269 InputEventAck ack(type, ack_result, touch_event_id);
256 SendMessage(std::unique_ptr<IPC::Message>( 270 SendMessage(std::unique_ptr<IPC::Message>(
257 new InputHostMsg_HandleInputEvent_ACK(routing_id, ack))); 271 new InputHostMsg_HandleInputEvent_ACK(routing_id, ack)));
258 } 272 }
259 273
260 } // namespace content 274 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698