From 2a8eb1038bd73913198cec9171898899aa89de8a Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Mon, 8 Nov 2021 23:59:36 +0000 Subject: [PATCH] Bug 1738627 - profiler_thread_is_being_profiled's ThreadProfilingFeatures is now compulsory - r=canaltinova Now that most calls to `profiler_thread_is_being_profiled` have been updated, the `ThreadProfilingFeatures` can be made compulsory, to force callers to think about what they really want to know about the current profiling state. Differential Revision: https://phabricator.services.mozilla.com/D130010 --- gfx/layers/wr/WebRenderBridgeParent.cpp | 2 +- tools/profiler/public/ProfilerThreadState.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index b409bd1fcab2..988db8951bae 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -66,7 +66,7 @@ bool is_in_render_thread() { } bool gecko_profiler_thread_is_being_profiled() { - return profiler_thread_is_being_profiled(); + return profiler_thread_is_being_profiled(ThreadProfilingFeatures::Any); } bool is_glcontext_gles(void* const glcontext_ptr) { diff --git a/tools/profiler/public/ProfilerThreadState.h b/tools/profiler/public/ProfilerThreadState.h index 349770a367a8..1d25447bad6b 100644 --- a/tools/profiler/public/ProfilerThreadState.h +++ b/tools/profiler/public/ProfilerThreadState.h @@ -26,8 +26,7 @@ // profiled for any of the given features? (Same caveats and recommended usage // as profiler_is_active().) [[nodiscard]] inline bool profiler_thread_is_being_profiled( - ThreadProfilingFeatures aThreadProfilingFeatures = - ThreadProfilingFeatures::Any) { + ThreadProfilingFeatures aThreadProfilingFeatures) { return profiler_is_active_and_unpaused() && mozilla::profiler::ThreadRegistration::WithOnThreadRefOr( [aThreadProfilingFeatures]( @@ -45,8 +44,7 @@ // as current thread id). [[nodiscard]] inline bool profiler_thread_is_being_profiled( const ProfilerThreadId& aThreadId, - ThreadProfilingFeatures aThreadProfilingFeatures = - ThreadProfilingFeatures::Any) { + ThreadProfilingFeatures aThreadProfilingFeatures) { if (!profiler_is_active_and_unpaused()) { return false; }