From 054aa096cbb16453fe41d7045799fd9e2c14c10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Thu, 11 Jan 2024 15:28:58 +0000 Subject: [PATCH] Bug 1874108 - Only declare the ProfilerBandwidthCounter class when MOZ_GECKO_PROFILER is defined, r=canaltinova,profiler-reviewers. Differential Revision: https://phabricator.services.mozilla.com/D198263 --- .../public/ProfilerBandwidthCounter.h | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/profiler/public/ProfilerBandwidthCounter.h b/tools/profiler/public/ProfilerBandwidthCounter.h index dca27d553d7e..c83fd02f325e 100644 --- a/tools/profiler/public/ProfilerBandwidthCounter.h +++ b/tools/profiler/public/ProfilerBandwidthCounter.h @@ -2,8 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "mozilla/ProfilerMarkers.h" -#include "mozilla/ProfilerCounts.h" +#ifndef ProfilerBandwidthCounter_h +#define ProfilerBandwidthCounter_h + +#ifndef MOZ_GECKO_PROFILER + +namespace mozilla { + +inline void profiler_count_bandwidth_read_bytes(int64_t aCount) {} +inline void profiler_count_bandwidth_written_bytes(int64_t aCount) {} + +} // namespace mozilla + +#else + +# include "mozilla/ProfilerMarkers.h" +# include "mozilla/ProfilerCounts.h" class ProfilerBandwidthCounter final : public BaseProfilerCount { public: @@ -86,3 +100,7 @@ inline void profiler_count_bandwidth_written_bytes(int64_t aCount) { } } // namespace mozilla + +#endif // !MOZ_GECKO_PROFILER + +#endif // ProfilerBandwidthCounter_h