Chromium Code Reviews| Index: base/trace_event/process_memory_dump.h |
| diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h |
| index ec82c10cede08db528e050e8b1c58e6f4c41c427..7fdb2dd23a19f9bb9b29adc0b5cee368480d8a61 100644 |
| --- a/base/trace_event/process_memory_dump.h |
| +++ b/base/trace_event/process_memory_dump.h |
| @@ -30,6 +30,9 @@ |
| #endif |
| namespace base { |
| + |
| +class UnguessableToken; |
| + |
| namespace trace_event { |
| class HeapProfilerSerializationState; |
| @@ -150,6 +153,32 @@ class BASE_EXPORT ProcessMemoryDump { |
| const MemoryAllocatorDumpGuid& target, |
| int importance); |
| + // Creates ownership edges for memory backed by base::SharedMemory. Handles |
| + // the case of cross process sharing and importnace of ownership for the case |
| + // with and without the base::SharedMemory dump provider. The new version |
| + // should just use global dumps created by SharedMemoryTracker and this |
| + // function handles the transition until we get SharedMemory IDs through mojo |
| + // channel crbug.com/713763. The weak version creates a weak global dump. |
| + // |client_local_dump_guid| The guid of the local dump created by the client |
| + // of base::SharedMemory. |
| + // |client_global_dump_guid| The global guid given by the clients to create |
| + // ownership edges of their own. These global dumps will no longer be required |
| + // after the transition. |
| + // |shared_memory_guid| The ID of the base::SharedMemory that is assigned |
| + // globally, used to create global dump edges in the new model. |
| + // |importance| Importance of the global dump edges to say if the current |
| + // process owns the memory segment. |
|
dcheng
2017/06/08 19:28:30
I'm not sure what "importance" means still based o
ssid
2017/06/08 19:43:16
what importance means is explained in the comment
dcheng
2017/06/08 20:40:52
I see; I didn't see it because that section was co
ssid
2017/06/08 20:43:35
Or maybe memory-infra is too complicated :P
|
| + void CreateSharedMemoryOwnershipEdge( |
| + const MemoryAllocatorDumpGuid& client_local_dump_guid, |
| + const MemoryAllocatorDumpGuid& client_global_dump_guid, |
| + const UnguessableToken& shared_memory_guid, |
| + int importance); |
| + void CreateWeakSharedMemoryOwnershipEdge( |
| + const MemoryAllocatorDumpGuid& client_local_dump_guid, |
| + const MemoryAllocatorDumpGuid& client_global_dump_guid, |
| + const UnguessableToken& shared_memory_guid, |
| + int importance); |
| + |
| const AllocatorDumpEdgesMap& allocator_dumps_edges_for_testing() const { |
| return allocator_dumps_edges_; |
| } |
| @@ -201,6 +230,13 @@ class BASE_EXPORT ProcessMemoryDump { |
| MemoryAllocatorDump* AddAllocatorDumpInternal( |
| std::unique_ptr<MemoryAllocatorDump> mad); |
| + void CreateSharedMemoryOwnershipEdgeInternal( |
| + const MemoryAllocatorDumpGuid& client_local_dump_guid, |
| + const MemoryAllocatorDumpGuid& client_global_dump_guid, |
| + const UnguessableToken& shared_memory_guid, |
| + int importance, |
| + bool is_weak); |
|
dcheng
2017/06/08 19:28:30
Normally I would suggest using an enum, the bool i
ssid
2017/06/08 19:43:16
Yeah, i feel enum is not required for an internal
|
| + |
| MemoryAllocatorDump* GetBlackHoleMad(); |
| ProcessMemoryTotals process_totals_; |