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

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

Issue 2954473002: Record accuracy of expected queueing time metric. (Closed)
Patch Set: Set trace ID in test. Created 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/render_widget_input_handler.h" 5 #include "content/renderer/input/render_widget_input_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, 240 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
241 "step", "HandleInputEventMain"); 241 "step", "HandleInputEventMain");
242 242
243 // If we don't have a high res timer, these metrics won't be accurate enough 243 // If we don't have a high res timer, these metrics won't be accurate enough
244 // to be worth collecting. Note that this does introduce some sampling bias. 244 // to be worth collecting. Note that this does introduce some sampling bias.
245 if (!start_time.is_null()) 245 if (!start_time.is_null())
246 LogInputEventLatencyUma(input_event, start_time); 246 LogInputEventLatencyUma(input_event, start_time);
247 247
248 std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; 248 std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor;
249 ui::LatencyInfo swap_latency_info(latency_info); 249 ui::LatencyInfo swap_latency_info(latency_info);
250
251 if (RenderThreadImpl::current()) {
252 swap_latency_info.set_expected_queueing_time_on_dispatch(
253 RenderThreadImpl::current()
254 ->GetRendererScheduler()
255 ->MostRecentExpectedQueueingTime());
256 }
257
250 swap_latency_info.AddLatencyNumber( 258 swap_latency_info.AddLatencyNumber(
251 ui::LatencyComponentType::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, 259 ui::LatencyComponentType::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0,
252 0); 260 0);
253 if (widget_->compositor()) { 261 if (widget_->compositor()) {
254 latency_info_swap_promise_monitor = 262 latency_info_swap_promise_monitor =
255 widget_->compositor()->CreateLatencyInfoSwapPromiseMonitor( 263 widget_->compositor()->CreateLatencyInfoSwapPromiseMonitor(
256 &swap_latency_info); 264 &swap_latency_info);
257 } 265 }
258 266
259 bool prevent_default = false; 267 bool prevent_default = false;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // it can be bundled in the event ack. 448 // it can be bundled in the event ack.
441 if (handling_event_overscroll_) { 449 if (handling_event_overscroll_) {
442 *handling_event_overscroll_ = std::move(params); 450 *handling_event_overscroll_ = std::move(params);
443 return; 451 return;
444 } 452 }
445 453
446 delegate_->OnDidOverscroll(*params); 454 delegate_->OnDidOverscroll(*params);
447 } 455 }
448 456
449 } // namespace content 457 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698