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

Unified Diff: base/trace_event/process_memory_dump.h

Issue 2923123004: [memory-infra] Add API to ProcessMemoryDump to create ownership edges for base::SharedMemory (Closed)
Patch Set: fix typo. Created 3 years, 6 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 | « base/trace_event/memory_allocator_dump_guid.cc ('k') | base/trace_event/process_memory_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
+ 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);
+
MemoryAllocatorDump* GetBlackHoleMad();
ProcessMemoryTotals process_totals_;
« no previous file with comments | « base/trace_event/memory_allocator_dump_guid.cc ('k') | base/trace_event/process_memory_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698