OLD | NEW |
---|---|
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_PROCESS_MEMORY_DUMP_H_ | 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/containers/small_map.h" | 10 #include "base/containers/small_map.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 // MemoryAllocatorDump instances. | 34 // MemoryAllocatorDump instances. |
35 using AllocatorDumpsMap = | 35 using AllocatorDumpsMap = |
36 SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; | 36 SmallMap<hash_map<std::string, MemoryAllocatorDump*>>; |
37 | 37 |
38 ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); | 38 ProcessMemoryDump(const scoped_refptr<MemoryDumpSessionState>& session_state); |
39 ~ProcessMemoryDump(); | 39 ~ProcessMemoryDump(); |
40 | 40 |
41 // Called at trace generation time to populate the TracedValue. | 41 // Called at trace generation time to populate the TracedValue. |
42 void AsValueInto(TracedValue* value) const; | 42 void AsValueInto(TracedValue* value) const; |
43 | 43 |
44 // Merges all the MemoryAllocatorDump(s) contained in |other| inside this | |
petrcermak
2015/05/21 08:17:38
I don't think you need "the" in front of "MemoryAl
Primiano Tucci (use gerrit)
2015/05/21 08:33:46
Done.
| |
45 // ProcessMemoryDump, moving their ownership to this instance. |other| will | |
petrcermak
2015/05/21 08:17:38
"transfer ownership" seems to be used much more of
Primiano Tucci (use gerrit)
2015/05/21 08:33:46
Done.
| |
46 // be an empty ProcessMemoryDump after this method returns. | |
47 // This is to allow dump providers to create and populate out-of-band | |
petrcermak
2015/05/21 08:17:38
nit: I know what you mean, but "out-of-band" is no
Primiano Tucci (use gerrit)
2015/05/21 08:33:46
reworded
| |
48 // instances of ProcessMemoryDump and later move them into the | |
petrcermak
2015/05/21 08:17:38
nit: The *contents* of the PMD instances are moved
Primiano Tucci (use gerrit)
2015/05/21 08:33:46
reworded
| |
49 // ProcessMemoryDump passed as argument of the | |
50 // MemoryDumpProvider.OnMemoryDump(ProcessMemoryDump*) callback. | |
51 void TakeAllDumpsFrom(ProcessMemoryDump* other); | |
52 | |
44 ProcessMemoryTotals* process_totals() { return &process_totals_; } | 53 ProcessMemoryTotals* process_totals() { return &process_totals_; } |
45 bool has_process_totals() const { return has_process_totals_; } | 54 bool has_process_totals() const { return has_process_totals_; } |
46 void set_has_process_totals() { has_process_totals_ = true; } | 55 void set_has_process_totals() { has_process_totals_ = true; } |
47 | 56 |
48 ProcessMemoryMaps* process_mmaps() { return &process_mmaps_; } | 57 ProcessMemoryMaps* process_mmaps() { return &process_mmaps_; } |
49 bool has_process_mmaps() const { return has_process_mmaps_; } | 58 bool has_process_mmaps() const { return has_process_mmaps_; } |
50 void set_has_process_mmaps() { has_process_mmaps_ = true; } | 59 void set_has_process_mmaps() { has_process_mmaps_ = true; } |
51 | 60 |
52 // Creates a new MemoryAllocatorDump with the given name and returns the | 61 // Creates a new MemoryAllocatorDump with the given name and returns the |
53 // empty object back to the caller. | 62 // empty object back to the caller. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 // State shared among all PMDs instances created in a given trace session. | 94 // State shared among all PMDs instances created in a given trace session. |
86 scoped_refptr<MemoryDumpSessionState> session_state_; | 95 scoped_refptr<MemoryDumpSessionState> session_state_; |
87 | 96 |
88 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 97 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
89 }; | 98 }; |
90 | 99 |
91 } // namespace trace_event | 100 } // namespace trace_event |
92 } // namespace base | 101 } // namespace base |
93 | 102 |
94 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 103 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
OLD | NEW |