Commit 5a32579e authored by Joe Mason's avatar Joe Mason Committed by Commit Bot

Fix nesting of trace events in ScopedMayLoadLibraryAtBackgroundPriority

The nested "Priority Increased" event must end before the parent event
so that it doesn't appear to outlive the parent.

R=fdoray

Change-Id: I673d7c9b364e5ac3321fabcb0a3fc6ddd5cdad88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993802
Commit-Queue: Joe Mason <joenotcharles@chromium.org>
Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730014}
parent caafa91a
...@@ -37,7 +37,8 @@ bool ScopedMayLoadLibraryAtBackgroundPriority::OnScopeFirstEntered() { ...@@ -37,7 +37,8 @@ bool ScopedMayLoadLibraryAtBackgroundPriority::OnScopeFirstEntered() {
ScopedMayLoadLibraryAtBackgroundPriority:: ScopedMayLoadLibraryAtBackgroundPriority::
~ScopedMayLoadLibraryAtBackgroundPriority() { ~ScopedMayLoadLibraryAtBackgroundPriority() {
TRACE_EVENT_END0("base", "ScopedMayLoadLibraryAtBackgroundPriority"); // Trace events must be closed in reverse order of opening so that they nest
// correctly.
#if defined(OS_WIN) #if defined(OS_WIN)
if (original_thread_priority_) { if (original_thread_priority_) {
TRACE_EVENT_END0( TRACE_EVENT_END0(
...@@ -46,6 +47,7 @@ ScopedMayLoadLibraryAtBackgroundPriority:: ...@@ -46,6 +47,7 @@ ScopedMayLoadLibraryAtBackgroundPriority::
PlatformThread::SetCurrentThreadPriority(original_thread_priority_.value()); PlatformThread::SetCurrentThreadPriority(original_thread_priority_.value());
} }
#endif // OS_WIN #endif // OS_WIN
TRACE_EVENT_END0("base", "ScopedMayLoadLibraryAtBackgroundPriority");
} }
} // namespace internal } // namespace internal
......
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