[tracing] Move logic to defer task posting into the scheduler

The current implementation of DISALLOW_POSTTASK sometimes leads to
losing data from traces. Move it inside the scheduler and make it more
precise.

Also remove DISALLOW_POSTTASK from tracing queue size: there we can
compute the value under the lock and emit trace event outside of the
lock scope.

R=skyostil@chromium.org,gab@chromium.org
CC=eseckler@chromium.org,oysteine@chromium.org,nuskos@chromium.org

Change-Id: I8d7302dbe3ca4ac5543cf3dfcc79202cf8b4ca49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594756
Commit-Queue: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#657886}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 93b4813518647de4dd50159ae123ed82f1bef9db
1 file changed
tree: 6bc3ae6fb48e34ae5ad148c03b7c39a5e73650ba
  1. trace_event_common.h