From 87c9a2657e3298852023b64aedfa31e203fc392c Mon Sep 17 00:00:00 2001 From: Stephen Nusko Date: Thu, 7 Feb 2019 17:42:41 +0000 Subject: [PATCH] Remove the workaround to perfetto calling CommitData on the wrong sequence. The fix was submitted in https://android-review.googlesource.com/c/platform/external/perfetto/+/874695 So we no longer need to special case this instead we can just delegate the call directly. Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=839074 Change-Id: Ie6d6ee8d94b00f73b59dd95a90d2c29dd3f9a383 Reviewed-on: https://chromium-review.googlesource.com/c/1451942 Commit-Queue: Stephen Nusko Commit-Queue: Eric Seckler Auto-Submit: Stephen Nusko Reviewed-by: Eric Seckler Cr-Commit-Position: refs/heads/master@{#629999} --- .../tracing/public/cpp/perfetto/producer_client.cc | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/services/tracing/public/cpp/perfetto/producer_client.cc b/services/tracing/public/cpp/perfetto/producer_client.cc index 7653756e066311..0a9132515c805f 100644 --- a/services/tracing/public/cpp/perfetto/producer_client.cc +++ b/services/tracing/public/cpp/perfetto/producer_client.cc @@ -241,19 +241,7 @@ void ProducerClient::NotifyDataSourceStopped( void ProducerClient::CommitData(const perfetto::CommitDataRequest& commit, CommitDataCallback callback) { - // TODO(oysteine): Remove the PostTask once Perfetto is fixed to always call - // CommitData on its provided TaskRunner, right now it'll call it on whatever - // thread is requesting a new chunk when the SharedMemoryBuffer is full. Until - // then this is technically not threadsafe on shutdown (when the - // ProducerClient gets destroyed) but should be okay while the Perfetto - // integration is behind a flag. - if (GetTaskRunner()->RunsTasksInCurrentSequence()) { - producer_host_->CommitData(commit); - } else { - GetTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(&ProducerClient::CommitDataOnSequence, - base::Unretained(this), commit)); - } + producer_host_->CommitData(commit); } void ProducerClient::CommitDataOnSequence(