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

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

Issue 1955643002: Add UMA metric to track the time saved on making events passive during fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set dispatch type to forcepassive Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/main_thread_event_queue.h" 5 #include "content/renderer/input/main_thread_event_queue.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 MainThreadEventQueue::MainThreadEventQueue(int routing_id, 9 MainThreadEventQueue::MainThreadEventQueue(int routing_id,
10 MainThreadEventQueueClient* client) 10 MainThreadEventQueueClient* client)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 PendingTouchEvent modified_dispatch_type_event = 64 PendingTouchEvent modified_dispatch_type_event =
65 PendingTouchEvent(*static_cast<const blink::WebTouchEvent*>(event), 65 PendingTouchEvent(*static_cast<const blink::WebTouchEvent*>(event),
66 latency, dispatch_type); 66 latency, dispatch_type);
67 modified_dispatch_type_event.event.shouldForceBePassive = is_flinging; 67 modified_dispatch_type_event.event.shouldForceBePassive = is_flinging;
68 68
69 // Adjust the |dispatchType| on the event since the compositor 69 // Adjust the |dispatchType| on the event since the compositor
70 // determined all event listeners are passive. 70 // determined all event listeners are passive.
71 if (non_blocking) { 71 if (non_blocking) {
72 modified_dispatch_type_event.event.dispatchType = 72 modified_dispatch_type_event.event.dispatchType =
73 blink::WebInputEvent::ListenersNonBlockingPassive; 73 blink::WebInputEvent::ListenersNonBlockingPassive;
74 } else {
75 if (modified_dispatch_type_event.event.type ==
76 blink::WebInputEvent::TouchStart &&
77 modified_dispatch_type_event.event.shouldForceBePassive)
78 modified_dispatch_type_event.event.dispatchType =
79 blink::WebInputEvent::ListenersForcedNonBlockingPassive;
dtapuska 2016/05/05 19:58:27 If you set this then you need to make sure an ack
74 } 80 }
75 81
76 if (touch_events_.state() == WebInputEventQueueState::ITEM_PENDING) { 82 if (touch_events_.state() == WebInputEventQueueState::ITEM_PENDING) {
77 touch_events_.Queue(modified_dispatch_type_event); 83 touch_events_.Queue(modified_dispatch_type_event);
78 } else { 84 } else {
79 if (non_blocking) { 85 if (non_blocking) {
80 touch_events_.set_state(WebInputEventQueueState::ITEM_PENDING); 86 touch_events_.set_state(WebInputEventQueueState::ITEM_PENDING);
81 client_->SendEventToMainThread(routing_id_, 87 client_->SendEventToMainThread(routing_id_,
82 &modified_dispatch_type_event.event, 88 &modified_dispatch_type_event.event,
83 latency, dispatch_type); 89 latency, dispatch_type);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 event->type); 121 event->type);
116 } else { 122 } else {
117 touch_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING); 123 touch_events_.set_state(WebInputEventQueueState::ITEM_NOT_PENDING);
118 } 124 }
119 } else { 125 } else {
120 NOTREACHED() << "Invalid passive event type"; 126 NOTREACHED() << "Invalid passive event type";
121 } 127 }
122 } 128 }
123 129
124 } // namespace content 130 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698