Commit 2236d52e authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

[runtime-call-stats] Allow null stats object in RuntimeCallStats::CorrectCurrentCounterId

This happens when RCS are enabled dynamically and the callsite is inside
the background parser.

BUG=chromium:760649

Change-Id: I216b955ed91d9c663ce3027aaa8ffb515bfe13ab
Reviewed-on: https://chromium-review.googlesource.com/740911Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49010}
parent ecd3a2ea
......@@ -514,8 +514,9 @@ void RuntimeCallStats::Add(RuntimeCallStats* other) {
// static
void RuntimeCallStats::CorrectCurrentCounterId(RuntimeCallStats* stats,
CounterId counter_id) {
// When RCS are enabled dynamically there might be no stats or timer set up.
if (stats == nullptr) return;
RuntimeCallTimer* timer = stats->current_timer_.Value();
// When RCS are enabled dynamically there might be no current timer set up.
if (timer == nullptr) return;
RuntimeCallCounter* counter = &(stats->*counter_id);
timer->set_counter(counter);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment