Skip to content

Commit

Permalink
(#1110) Removed user data metric data generation. This data is not us…
Browse files Browse the repository at this point in the history
…eful to Supermium and was not used by Supermium.
  • Loading branch information
win32ss committed Jan 8, 2025
1 parent 81d95d6 commit 43f56f1
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions base/metrics/user_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,20 @@ LazyInstance<scoped_refptr<SingleThreadTaskRunner>>::DestructorAtExit
} // namespace

void RecordAction(const UserMetricsAction& action) {
RecordComputedAction(action.str_);
//RecordComputedAction(action.str_);
}

void RecordComputedAction(const std::string& action) {
RecordComputedActionAt(action, TimeTicks::Now());
//RecordComputedActionAt(action, TimeTicks::Now());
}

void RecordComputedActionSince(const std::string& action,
TimeDelta time_since) {
RecordComputedActionAt(action, TimeTicks::Now() - time_since);
//RecordComputedActionAt(action, TimeTicks::Now() - time_since);
}

void RecordComputedActionAt(const std::string& action, TimeTicks action_time) {
TRACE_EVENT_INSTANT1("ui", "UserEvent", TRACE_EVENT_SCOPE_GLOBAL, "action",
action);
if (!g_task_runner.Get()) {
DCHECK(g_callbacks.Get().empty());
return;
}

if (!g_task_runner.Get()->BelongsToCurrentThread()) {
g_task_runner.Get()->PostTask(
FROM_HERE, BindOnce(&RecordComputedActionAt, action, action_time));
return;
}

for (const ActionCallback& callback : g_callbacks.Get()) {
callback.Run(action, action_time);
}
;
}

void AddActionCallback(const ActionCallback& callback) {
Expand Down

0 comments on commit 43f56f1

Please sign in to comment.