# we don't support trace_event on libchrome --- a/base/values.cc +++ b/base/values.cc @@ -18,7 +18,8 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "base/trace_event/memory_usage_estimator.h" +// Unsupported in libchrome +// #include "base/trace_event/memory_usage_estimator.h" namespace base { @@ -632,20 +633,21 @@ bool Value::Equals(const Value* other) const { return *this == *other; } -size_t Value::EstimateMemoryUsage() const { - switch (type_) { - case Type::STRING: - return base::trace_event::EstimateMemoryUsage(string_value_); - case Type::BINARY: - return base::trace_event::EstimateMemoryUsage(binary_value_); - case Type::DICTIONARY: - return base::trace_event::EstimateMemoryUsage(dict_); - case Type::LIST: - return base::trace_event::EstimateMemoryUsage(list_); - default: - return 0; - } -} +// Unsupported in libchrome +// size_t Value::EstimateMemoryUsage() const { +// switch (type_) { +// case Type::STRING: +// return base::trace_event::EstimateMemoryUsage(string_value_); +// case Type::BINARY: +// return base::trace_event::EstimateMemoryUsage(binary_value_); +// case Type::DICTIONARY: +// return base::trace_event::EstimateMemoryUsage(dict_); +// case Type::LIST: +// return base::trace_event::EstimateMemoryUsage(list_); +// default: +// return 0; +// } +// } void Value::InternalMoveConstructFrom(Value&& that) { type_ = that.type_; --- a/base/values.h +++ b/base/values.h @@ -352,7 +352,7 @@ class BASE_EXPORT Value { // Estimates dynamic memory usage. // See base/trace_event/memory_usage_estimator.h for more info. - size_t EstimateMemoryUsage() const; + // size_t EstimateMemoryUsage() const; protected: // TODO(crbug.com/646113): Make these private once DictionaryValue and