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

Unified Diff: base/trace_event/memory_profiler_allocation_context.cc

Issue 1427953002: [Tracing] Remove fields from AllocationContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add initializers to test to make MSVC happy Created 5 years, 2 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
Index: base/trace_event/memory_profiler_allocation_context.cc
diff --git a/base/trace_event/memory_profiler_allocation_context.cc b/base/trace_event/memory_profiler_allocation_context.cc
index c7b8549895b8a6d50d08efdf0acbe530b0ad35b4..bafbf7fa0f6ccedde81b7b799e62e50b09e6fd7e 100644
--- a/base/trace_event/memory_profiler_allocation_context.cc
+++ b/base/trace_event/memory_profiler_allocation_context.cc
@@ -153,19 +153,6 @@ void AllocationContextTracker::PopPseudoStackFrame(StackFrame frame) {
tracker->pseudo_stack_.pop(frame);
}
-// static
-void AllocationContextTracker::SetContextField(const char* key,
- const char* value) {
- auto tracker = AllocationContextTracker::GetThreadLocalTracker();
- tracker->context_[key] = value;
-}
-
-// static
-void AllocationContextTracker::UnsetContextField(const char* key) {
- auto tracker = AllocationContextTracker::GetThreadLocalTracker();
- tracker->context_.erase(key);
-}
-
// Returns a pointer past the end of the fixed-size array |array| of |T| of
// length |N|, identical to C++11 |std::end|.
template <typename T, int N>
@@ -194,22 +181,6 @@ AllocationContext AllocationContextTracker::GetContextSnapshot() {
std::fill(dst, dst_end, nullptr);
}
- // Fill the context fields.
- {
- auto src = tracker->context_.begin();
- auto dst = ctx.fields;
- auto src_end = tracker->context_.end();
- auto dst_end = End(ctx.fields);
-
- // Copy as much (key, value) pairs as possible.
- for (; src != src_end && dst != dst_end; src++, dst++)
- *dst = *src;
-
- // If there is room for more, fill the remaining slots with nullptr keys.
- for (; dst != dst_end; dst++)
- dst->first = nullptr;
- }
-
return ctx;
}

Powered by Google App Engine
This is Rietveld 408576698