Commit b1c3f2d0 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Add a trace event for ScopedNestableTaskAllower

This will help identify intentional nested loops in traces.

R=fdoray@chromium.org

Bug: 899897, 1074019
Change-Id: Ie8d7522c66b00a7b7f2e94e8143a980afd48f47a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220631Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773311}
parent 1b9e0184
......@@ -93,11 +93,13 @@ bool MessageLoopCurrent::NestableTasksAllowed() const {
MessageLoopCurrent::ScopedNestableTaskAllower::ScopedNestableTaskAllower()
: sequence_manager_(GetCurrentSequenceManagerImpl()),
old_state_(sequence_manager_->IsTaskExecutionAllowed()) {
TRACE_EVENT_BEGIN0("base", "ScopedNestableTaskAllower");
sequence_manager_->SetTaskExecutionAllowed(true);
}
MessageLoopCurrent::ScopedNestableTaskAllower::~ScopedNestableTaskAllower() {
sequence_manager_->SetTaskExecutionAllowed(old_state_);
TRACE_EVENT_END0("base", "ScopedNestableTaskAllower");
}
bool MessageLoopCurrent::operator==(const MessageLoopCurrent& other) const {
......
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