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

Unified Diff: base/memory/shared_memory_tracker.h

Issue 2775423003: Add ownership edges between HostSharedBitmap and shared memory
Patch Set: Fix comments Created 3 years, 9 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/memory/shared_memory_posix.cc ('k') | base/memory/shared_memory_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_tracker.h
diff --git a/base/memory/shared_memory_tracker.h b/base/memory/shared_memory_tracker.h
index fe1a3dd392177b0c20bb5b2daf6498d85eae7e0b..547c61589bc51ec5a4cd8d5420b0155d0f90f291 100644
--- a/base/memory/shared_memory_tracker.h
+++ b/base/memory/shared_memory_tracker.h
@@ -12,6 +12,7 @@
namespace base {
namespace trace_event {
+class MemoryAllocatorDumpGuid;
class ProcessMemoryDump;
}
@@ -22,6 +23,19 @@ class BASE_EXPORT SharedMemoryTracker
// Returns a singleton instance.
static SharedMemoryTracker* GetInstance();
+ // Adds two ownership edges between the given guid |source| and its global
+ // shared memory dump. This helps to get accurate effective size of modules
+ // that backend is shared memory.
+ static bool AddOwnershipEdges(
+ trace_event::ProcessMemoryDump* pmd,
+ const trace_event::MemoryAllocatorDumpGuid& source,
+ const SharedMemoryHandle& shared_memory_handle);
+ static bool AddOwnershipEdges(
+ trace_event::ProcessMemoryDump* pmd,
+ const trace_event::MemoryAllocatorDumpGuid& source,
+ const SharedMemoryHandle& shared_memory_handle,
+ int importance);
+
// Records shared memory usage on mapping.
void IncrementMemoryUsage(const SharedMemory& shared_memory);
@@ -41,8 +55,8 @@ class BASE_EXPORT SharedMemoryTracker
~SharedMemoryTracker() override;
// base::trace_event::MemoryDumpProvider implementation.
- bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
- base::trace_event::ProcessMemoryDump* pmd) override;
+ bool OnMemoryDump(const trace_event::MemoryDumpArgs& args,
+ trace_event::ProcessMemoryDump* pmd) override;
// Used to lock when |usages_| is modified or read.
Lock usages_lock_;
« no previous file with comments | « base/memory/shared_memory_posix.cc ('k') | base/memory/shared_memory_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698