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

Side by Side Diff: base/trace_event/heap_profiler_serialization_state.h

Issue 2861133002: memory-infra: Move dump level check to observer and rename session state (Closed)
Patch Set: move comment Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_SESSION_STATE_H_ 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H_
6 #define BASE_TRACE_EVENT_MEMORY_DUMP_SESSION_STATE_H_ 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
11 #include "base/base_export.h" 11 #include "base/base_export.h"
12 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h" 12 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
13 #include "base/trace_event/heap_profiler_type_name_deduplicator.h" 13 #include "base/trace_event/heap_profiler_type_name_deduplicator.h"
14 #include "base/trace_event/memory_dump_request_args.h" 14 #include "base/trace_event/memory_dump_request_args.h"
15 15
16 namespace base { 16 namespace base {
17 namespace trace_event { 17 namespace trace_event {
18 18
19 // Container for state variables that should be shared across all the memory 19 // Container for state variables that should be shared across all the memory
20 // dumps in a tracing session. 20 // dumps in a tracing session.
21 class BASE_EXPORT MemoryDumpSessionState 21 class BASE_EXPORT HeapProfilerSerializationState
22 : public RefCountedThreadSafe<MemoryDumpSessionState> { 22 : public RefCountedThreadSafe<HeapProfilerSerializationState> {
23 public: 23 public:
24 MemoryDumpSessionState(); 24 HeapProfilerSerializationState();
25 25
26 // Returns the stack frame deduplicator that should be used by memory dump 26 // Returns the stack frame deduplicator that should be used by memory dump
27 // providers when doing a heap dump. 27 // providers when doing a heap dump.
28 StackFrameDeduplicator* stack_frame_deduplicator() const { 28 StackFrameDeduplicator* stack_frame_deduplicator() const {
29 return stack_frame_deduplicator_.get(); 29 return stack_frame_deduplicator_.get();
30 } 30 }
31 31
32 void SetStackFrameDeduplicator( 32 void SetStackFrameDeduplicator(
33 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator); 33 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator);
34 34
(...skipping 13 matching lines...) Expand all
48 48
49 void set_heap_profiler_breakdown_threshold_bytes(uint32_t value) { 49 void set_heap_profiler_breakdown_threshold_bytes(uint32_t value) {
50 heap_profiler_breakdown_threshold_bytes_ = value; 50 heap_profiler_breakdown_threshold_bytes_ = value;
51 } 51 }
52 52
53 uint32_t heap_profiler_breakdown_threshold_bytes() const { 53 uint32_t heap_profiler_breakdown_threshold_bytes() const {
54 return heap_profiler_breakdown_threshold_bytes_; 54 return heap_profiler_breakdown_threshold_bytes_;
55 } 55 }
56 56
57 private: 57 private:
58 friend class RefCountedThreadSafe<MemoryDumpSessionState>; 58 friend class RefCountedThreadSafe<HeapProfilerSerializationState>;
59 ~MemoryDumpSessionState(); 59 ~HeapProfilerSerializationState();
60 60
61 // Deduplicates backtraces in heap dumps so they can be written once when the 61 // Deduplicates backtraces in heap dumps so they can be written once when the
62 // trace is finalized. 62 // trace is finalized.
63 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator_; 63 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator_;
64 64
65 // Deduplicates type names in heap dumps so they can be written once when the 65 // Deduplicates type names in heap dumps so they can be written once when the
66 // trace is finalized. 66 // trace is finalized.
67 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator_; 67 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator_;
68 68
69 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes_;
70
71 uint32_t heap_profiler_breakdown_threshold_bytes_; 69 uint32_t heap_profiler_breakdown_threshold_bytes_;
72 }; 70 };
73 71
74 } // namespace trace_event 72 } // namespace trace_event
75 } // namespace base 73 } // namespace base
76 74
77 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_SESSION_STATE_H_ 75 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698