1 // Copyright 2021 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_TRACE_EVENT_BASE_TRACING_FORWARD_H_ 6 #define BASE_TRACE_EVENT_BASE_TRACING_FORWARD_H_ 7 8 // This header is a wrapper around perfetto's traced_value_forward.h that 9 // handles Chromium's ENABLE_BASE_TRACING buildflag. 10 11 #include "base/tracing_buildflags.h" 12 13 #if BUILDFLAG(ENABLE_BASE_TRACING) 14 #include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h" // nogncheck 15 #else 16 17 namespace perfetto { 18 19 class TracedValue; 20 21 template <typename T> 22 void WriteIntoTracedValue(TracedValue context, T&& value); 23 24 template <typename T, class = void> 25 struct TraceFormatTraits; 26 27 template <typename T, typename ResultType = void, class = void> 28 struct check_traced_value_support { 29 static constexpr bool value = true; 30 using type = ResultType; 31 }; 32 33 } // namespace perfetto 34 35 #endif // !BUILDFLAG(ENABLE_BASE_TRACING) 36 37 #endif // BASE_TRACE_EVENT_BASE_TRACING_FORWARD_H_ 38