Skip to content

Commit

Permalink
Remove the workaround to perfetto calling CommitData on the wrong seq…
Browse files Browse the repository at this point in the history
…uence.

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 <nuskos@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Auto-Submit: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629999}
  • Loading branch information
Stephen Nusko authored and Commit Bot committed Feb 7, 2019
1 parent 2cfd593 commit 87c9a26
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions services/tracing/public/cpp/perfetto/producer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 87c9a26

Please sign in to comment.