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

Unified Diff: ui/events/latency_info.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/device_data_manager.h ('k') | ui/events/platform/platform_event_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/latency_info.cc
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc
index 02586d69347bc5d69c0abbefa9fc628d07bf6079..f3c38589cc6aea4f1985a700cd24471e68306c41 100644
--- a/ui/events/latency_info.cc
+++ b/ui/events/latency_info.cc
@@ -101,7 +101,7 @@ LatencyInfoTracedValue::~LatencyInfoTracedValue() {
void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const {
std::string tmp;
- base::JSONWriter::Write(value_.get(), &tmp);
+ base::JSONWriter::Write(*value_, &tmp);
*out += tmp;
}
@@ -228,25 +228,25 @@ void LatencyInfo::AddLatencyNumberWithTimestamp(LatencyComponentType component,
// for an input event, we want to draw the beginning as when the event is
// originally created, e.g. the timestamp of its ORIGINAL/UI_COMPONENT,
// not when we actually issue the ASYNC_BEGIN trace event.
- LatencyComponent component;
+ LatencyComponent begin_component;
int64 ts = 0;
if (FindLatency(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
0,
- &component) ||
+ &begin_component) ||
FindLatency(INPUT_EVENT_LATENCY_UI_COMPONENT,
0,
- &component)) {
+ &begin_component)) {
// The timestamp stored in ORIGINAL/UI_COMPONENT is using clock
// CLOCK_MONOTONIC while TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0
// expects timestamp using CLOCK_MONOTONIC or CLOCK_SYSTEM_TRACE (on
// CrOS). So we need to adjust the diff between in CLOCK_MONOTONIC and
// CLOCK_SYSTEM_TRACE. Note that the diff is drifting overtime so we
// can't use a static value.
- int64 diff = base::TimeTicks::Now().ToInternalValue() -
- base::TimeTicks::NowFromSystemTraceTime().ToInternalValue();
- ts = component.event_time.ToInternalValue() - diff;
+ base::TimeDelta diff = (base::TimeTicks::Now() - base::TimeTicks()) -
+ (base::TraceTicks::Now() - base::TraceTicks());
+ ts = (begin_component.event_time - diff).ToInternalValue();
} else {
- ts = base::TimeTicks::NowFromSystemTraceTime().ToInternalValue();
+ ts = base::TraceTicks::Now().ToInternalValue();
}
TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(
"benchmark",
« no previous file with comments | « ui/events/device_data_manager.h ('k') | ui/events/platform/platform_event_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698