From 3555c20a1e82dc9c112b142dc558fbbb13a828f0 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sat, 6 Aug 2022 13:05:21 +0800 Subject: [PATCH] Wrap base::Value::{Dict,List}}:WriteIntoTrace() with correct #ifs. --- src/base/values.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/base/values.cc b/src/base/values.cc index 62e55cd837..42857ccc2e 100644 --- a/src/base/values.cc +++ b/src/base/values.cc @@ -789,12 +789,14 @@ std::string Value::Dict::DebugString() const { return DebugStringImpl(*this); } +#if BUILDFLAG(ENABLE_BASE_TRACING) void Value::Dict::WriteIntoTrace(perfetto::TracedValue context) const { perfetto::TracedDictionary dict = std::move(context).WriteDictionary(); for (auto kv : *this) { dict.Add(perfetto::DynamicString(kv.first), kv.second); } } +#endif // BUILDFLAG(ENABLE_BASE_TRACING) Value::Dict::Dict( const flat_map>& storage) { @@ -999,12 +1001,14 @@ std::string Value::List::DebugString() const { return DebugStringImpl(*this); } +#if BUILDFLAG(ENABLE_BASE_TRACING) void Value::List::WriteIntoTrace(perfetto::TracedValue context) const { perfetto::TracedArray array = std::move(context).WriteArray(); for (const auto& item : *this) { array.Append(item); } } +#endif // BUILDFLAG(ENABLE_BASE_TRACING) Value::List::List(const std::vector& storage) { storage_.reserve(storage.size());