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

Unified Diff: base/trace_event/trace_event_memory_overhead.cc

Issue 1251203003: [tracing] Fix, simplify and speed up accounting of TraceEvent memory overhead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Get rid of rendundant check Created 5 years, 5 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/trace_event_memory_overhead.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_memory_overhead.cc
diff --git a/base/trace_event/trace_event_memory_overhead.cc b/base/trace_event/trace_event_memory_overhead.cc
index 0cc3d59890c57884e8fe035d1afba7f6600528b1..5ece315c00f30485ee0dce9c997b83de6007f3ee 100644
--- a/base/trace_event/trace_event_memory_overhead.cc
+++ b/base/trace_event/trace_event_memory_overhead.cc
@@ -127,6 +127,13 @@ void TraceEventMemoryOverhead::AddSelf() {
Add("TraceEventMemoryOverhead", estimated_size);
}
+size_t TraceEventMemoryOverhead::GetCount(const char* object_type) const {
+ const auto& it = allocated_objects_.find(object_type);
+ if (it == allocated_objects_.end())
+ return 0u;
+ return it->second.count;
+}
+
void TraceEventMemoryOverhead::Update(const TraceEventMemoryOverhead& other) {
for (const auto& it : other.allocated_objects_) {
AddOrCreateInternal(it.first, it.second.count,
« no previous file with comments | « base/trace_event/trace_event_memory_overhead.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698