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

Unified Diff: base/trace_event/memory_profiler_allocation_context.h

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
« no previous file with comments | « no previous file | base/trace_event/memory_profiler_allocation_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_profiler_allocation_context.h
diff --git a/base/trace_event/memory_profiler_allocation_context.h b/base/trace_event/memory_profiler_allocation_context.h
index ef68283c16f55bb9ac0a308cce8ad4710f17216c..4e08c50d587e00a16bcef837c032273f6a52c9e1 100644
--- a/base/trace_event/memory_profiler_allocation_context.h
+++ b/base/trace_event/memory_profiler_allocation_context.h
@@ -5,12 +5,12 @@
#ifndef BASE_TRACE_EVENT_MEMORY_PROFILER_ALLOCATION_CONTEXT_H_
#define BASE_TRACE_EVENT_MEMORY_PROFILER_ALLOCATION_CONTEXT_H_
+#include <map>
#include <string>
#include <vector>
#include "base/atomicops.h"
#include "base/base_export.h"
-#include "base/containers/small_map.h"
#include "base/trace_event/trace_event_impl.h"
namespace base {
@@ -141,18 +141,13 @@ class BASE_EXPORT StackFrameDeduplicator : public ConvertableToTraceFormat {
// must have static lifetime.
struct BASE_EXPORT AllocationContext {
Backtrace backtrace;
-
- // There is room for two arbitrary context fields, which can be set by the
- // |TRACE_ALLOCATION_CONTEXT| macro. A nullptr key indicates that the field is
- // unused.
- std::pair<const char*, const char*> fields[2];
};
// The allocation context tracker keeps track of thread-local context for heap
-// profiling. It includes a pseudo stack of trace events, and it might contain
-// arbitrary (key, value) context. On every allocation the tracker provides a
-// snapshot of its context in the form of an |AllocationContext| that is to be
-// stored together with the allocation details.
+// profiling. It includes a pseudo stack of trace events. On every allocation
+// the tracker provides a snapshot of its context in the form of an
+// |AllocationContext| that is to be stored together with the allocation
+// details.
class BASE_EXPORT AllocationContextTracker {
public:
// Globally enables capturing allocation context.
@@ -181,13 +176,6 @@ class BASE_EXPORT AllocationContextTracker {
// Pops a frame from the thread-local pseudo stack.
static void PopPseudoStackFrame(StackFrame frame);
- // Sets a thread-local (key, value) pair.
- static void SetContextField(const char* key, const char* value);
-
- // Removes the (key, value) pair with the specified key from the thread-local
- // context.
- static void UnsetContextField(const char* key);
-
// Returns a snapshot of the current thread-local context.
static AllocationContext GetContextSnapshot();
@@ -203,9 +191,6 @@ class BASE_EXPORT AllocationContextTracker {
// The pseudo stack where frames are |TRACE_EVENT| names.
AllocationStack pseudo_stack_;
- // A dictionary of arbitrary context.
- SmallMap<std::map<const char*, const char*>> context_;
-
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker);
};
« no previous file with comments | « no previous file | base/trace_event/memory_profiler_allocation_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698