Commit 34cfe3d9 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

DevTools: Fix race in TracingHandler::OnBufferUsage

The OnBufferUsage is called through double async chain and by that time
the tracing can already be stopped. Do not report usage in this case.

The bug caused several tests to flake, e.g.
http/tests/devtools/tracing/timeline-style/timeline-style-recalc-all-invalidator-types.js

BUG=846920

Change-Id: I94259e38e49e35f21974faf9aef69f96d118c36b
Reviewed-on: https://chromium-review.googlesource.com/1125213
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572436}
parent 4e4521b8
...@@ -499,6 +499,8 @@ void TracingHandler::OnRecordingEnabled( ...@@ -499,6 +499,8 @@ void TracingHandler::OnRecordingEnabled(
void TracingHandler::OnBufferUsage(float percent_full, void TracingHandler::OnBufferUsage(float percent_full,
size_t approximate_event_count) { size_t approximate_event_count) {
if (!did_initiate_recording_)
return;
// TODO(crbug426117): remove set_value once all clients have switched to // TODO(crbug426117): remove set_value once all clients have switched to
// the new interface of the event. // the new interface of the event.
frontend_->BufferUsage(percent_full, approximate_event_count, percent_full); frontend_->BufferUsage(percent_full, approximate_event_count, percent_full);
......
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