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

Side by Side Diff: content/browser/renderer_host/input/touch_event_queue.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/touch_event_queue.h" 5 #include "content/browser/renderer_host/input/touch_event_queue.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 const ui::LatencyInfo& renderer_latency_info) { 187 const ui::LatencyInfo& renderer_latency_info) {
188 if (touch_queue_.empty()) 188 if (touch_queue_.empty())
189 return; 189 return;
190 scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); 190 scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front());
191 touch_queue_.pop_front(); 191 touch_queue_.pop_front();
192 192
193 // Note that acking the touch-event may result in multiple gestures being sent 193 // Note that acking the touch-event may result in multiple gestures being sent
194 // to the renderer, or touch-events being queued. 194 // to the renderer, or touch-events being queued.
195 base::AutoReset<bool> dispatching_touch_ack(&dispatching_touch_ack_, true); 195 base::AutoReset<bool> dispatching_touch_ack(&dispatching_touch_ack_, true);
196 196
197 base::TimeTicks now = base::TimeTicks::HighResNow();
198 for (WebTouchEventWithLatencyList::const_iterator iter = acked_event->begin(), 197 for (WebTouchEventWithLatencyList::const_iterator iter = acked_event->begin(),
199 end = acked_event->end(); 198 end = acked_event->end();
200 iter != end; ++iter) { 199 iter != end; ++iter) {
201 ui::LatencyInfo* latency = const_cast<ui::LatencyInfo*>(&(iter->latency)); 200 ui::LatencyInfo* latency = const_cast<ui::LatencyInfo*>(&(iter->latency));
jdduke (slow) 2013/10/01 23:45:31 Sorry, this isn't directly related to your patch,
Yufeng Shen (Slow to review) 2013/10/04 00:29:51 Done.
202 latency->AddNewLatencyFrom(renderer_latency_info); 201 latency->AddNewLatencyFrom(renderer_latency_info);
203 latency->AddLatencyNumberWithTimestamp(
204 ui::INPUT_EVENT_LATENCY_ACKED_COMPONENT, 0, 0, now, 1);
205 client_->OnTouchEventAck((*iter), ack_result); 202 client_->OnTouchEventAck((*iter), ack_result);
206 } 203 }
207 } 204 }
208 205
209 bool TouchEventQueue::ShouldForwardToRenderer( 206 bool TouchEventQueue::ShouldForwardToRenderer(
210 const WebKit::WebTouchEvent& event) const { 207 const WebKit::WebTouchEvent& event) const {
211 // Touch press events should always be forwarded to the renderer. 208 // Touch press events should always be forwarded to the renderer.
212 if (event.type == WebKit::WebInputEvent::TouchStart) 209 if (event.type == WebKit::WebInputEvent::TouchStart)
213 return true; 210 return true;
214 211
(...skipping 15 matching lines...) Expand all
230 // If the ACK status of a point is unknown, then the event should be 227 // If the ACK status of a point is unknown, then the event should be
231 // forwarded to the renderer. 228 // forwarded to the renderer.
232 return true; 229 return true;
233 } 230 }
234 } 231 }
235 232
236 return false; 233 return false;
237 } 234 }
238 235
239 } // namespace content 236 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698