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

Side by Side Diff: content/browser/renderer_host/input/buffered_input_router.cc

Issue 25022003: Report LatencyInfo through trace buffer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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/browser/renderer_host/input/buffered_input_router.h" 5 #include "content/browser/renderer_host/input/buffered_input_router.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "content/browser/renderer_host/input/browser_input_event.h" 8 #include "content/browser/renderer_host/input/browser_input_event.h"
9 #include "content/browser/renderer_host/input/input_ack_handler.h" 9 #include "content/browser/renderer_host/input/input_ack_handler.h"
10 #include "content/browser/renderer_host/input/input_queue.h" 10 #include "content/browser/renderer_host/input/input_queue.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } else { 221 } else {
222 DCHECK_EQ(0, event_id); 222 DCHECK_EQ(0, event_id);
223 ack_handler_->OnKeyboardEventAck( 223 ack_handler_->OnKeyboardEventAck(
224 static_cast<const NativeWebKeyboardEvent&>(web_event), acked_result); 224 static_cast<const NativeWebKeyboardEvent&>(web_event), acked_result);
225 } 225 }
226 // WARNING: This BufferedInputRouter can be deallocated at this point 226 // WARNING: This BufferedInputRouter can be deallocated at this point
227 // (i.e. in the case of Ctrl+W, where the call to 227 // (i.e. in the case of Ctrl+W, where the call to
228 // HandleKeyboardEvent destroys this BufferedInputRouter). 228 // HandleKeyboardEvent destroys this BufferedInputRouter).
229 } else if (web_event.type == WebInputEvent::MouseWheel) { 229 } else if (web_event.type == WebInputEvent::MouseWheel) {
230 ack_handler_->OnWheelEventAck( 230 ack_handler_->OnWheelEventAck(
231 static_cast<const WebMouseWheelEvent&>(web_event), acked_result); 231 MouseWheelEventWithLatencyInfo(
232 static_cast<const WebMouseWheelEvent&>(web_event), latency_info),
233 acked_result);
232 } else if (WebInputEvent::isTouchEventType(web_event.type)) { 234 } else if (WebInputEvent::isTouchEventType(web_event.type)) {
233 if (ack_from_input_queue) { 235 if (ack_from_input_queue) {
234 DCHECK_GT(queued_touch_count_, 0); 236 DCHECK_GT(queued_touch_count_, 0);
235 --queued_touch_count_; 237 --queued_touch_count_;
236 } 238 }
237 ack_handler_->OnTouchEventAck( 239 ack_handler_->OnTouchEventAck(
238 TouchEventWithLatencyInfo(static_cast<const WebTouchEvent&>(web_event), 240 TouchEventWithLatencyInfo(static_cast<const WebTouchEvent&>(web_event),
239 latency_info), 241 latency_info),
240 acked_result); 242 acked_result);
241 } else if (WebInputEvent::isGestureEventType(web_event.type)) { 243 } else if (WebInputEvent::isGestureEventType(web_event.type)) {
242 ack_handler_->OnGestureEventAck( 244 ack_handler_->OnGestureEventAck(
243 static_cast<const WebGestureEvent&>(web_event), acked_result); 245 GestureEventWithLatencyInfo(
246 static_cast<const WebGestureEvent&>(web_event), latency_info),
247 acked_result);
244 } else 248 } else
245 NOTREACHED() << "Unexpected WebInputEvent in OnWebInputEventAck"; 249 NOTREACHED() << "Unexpected WebInputEvent in OnWebInputEventAck";
246 } 250 }
247 251
248 void BufferedInputRouter::OnEventPacketAck( 252 void BufferedInputRouter::OnEventPacketAck(
249 int64 packet_id, 253 int64 packet_id,
250 const InputEventDispositions& dispositions) { 254 const InputEventDispositions& dispositions) {
251 TRACE_EVENT2("input", "BufferedInputRouter::OnEventPacketAck", 255 TRACE_EVENT2("input", "BufferedInputRouter::OnEventPacketAck",
252 "id", packet_id, 256 "id", packet_id,
253 "dispositions", dispositions.size()); 257 "dispositions", dispositions.size());
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 default: 331 default:
328 break; 332 break;
329 }; 333 };
330 334
331 return false; 335 return false;
332 } 336 }
333 337
334 int64 BufferedInputRouter::NextInputID() { return next_input_id_++; } 338 int64 BufferedInputRouter::NextInputID() { return next_input_id_++; }
335 339
336 } // namespace content 340 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698