Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: base/trace_event/memory_allocator_dump.cc

Issue 1104413002: [tracing] Get rid of MemoryAllocatorAttributesTypeInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplif_1
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/memory_allocator_dump.h ('k') | base/trace_event/memory_dump_session_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_allocator_dump.cc
diff --git a/base/trace_event/memory_allocator_dump.cc b/base/trace_event/memory_allocator_dump.cc
index 1d2fb3f67ad08914d513f41a9bcb52a7675ad63e..6be2cca6a317b1c103e15fbde29578e2a514f006 100644
--- a/base/trace_event/memory_allocator_dump.cc
+++ b/base/trace_event/memory_allocator_dump.cc
@@ -53,9 +53,6 @@ MemoryAllocatorDump::~MemoryAllocatorDump() {
}
void MemoryAllocatorDump::SetAttribute(const std::string& name, int value) {
- DCHECK(GetAttributesTypeInfo().Exists(allocator_name_, name))
- << "attribute '" << name << "' not declared."
- << "See MemoryDumpProvider.DeclareAllocatorAttribute()";
attributes_values_.SetInteger(name, value);
}
@@ -98,31 +95,9 @@ void MemoryAllocatorDump::AsValueInto(TracedValue* value) const {
value->SetString("value", StringPrintf(kHexFmt, allocated_objects_count_));
value->EndDictionary();
- // Copy all the extra attributes.
- for (DictionaryValue::Iterator it(attributes_values_); !it.IsAtEnd();
- it.Advance()) {
- const std::string& attr_name = it.key();
- const Value& attr_value = it.value();
- value->BeginDictionary(attr_name.c_str());
- value->SetValue("value", attr_value.DeepCopy());
-
- const std::string& attr_type =
- GetAttributesTypeInfo().Get(allocator_name_, attr_name);
- DCHECK(!attr_type.empty());
- value->SetString("type", "scalar");
- value->SetString("units", attr_type);
-
- value->EndDictionary(); // "arg_name": { "type": "...", "value": "..." }
- }
-
value->EndDictionary(); // "attrs": { ... }
value->EndDictionary(); // "allocator_name/heap_subheap": { ... }
}
-const MemoryAllocatorAttributesTypeInfo&
-MemoryAllocatorDump::GetAttributesTypeInfo() const {
- return process_memory_dump_->session_state()->allocators_attributes_type_info;
-}
-
} // namespace trace_event
} // namespace base
« no previous file with comments | « base/trace_event/memory_allocator_dump.h ('k') | base/trace_event/memory_dump_session_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698