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

Unified Diff: base/memory/shared_memory_handle.cc

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: (rebase) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_handle.cc
diff --git a/base/memory/shared_memory_handle.cc b/base/memory/shared_memory_handle.cc
index 085bde46c295d502f6bc78012923308ba1c3045c..4420cf4f271332bdbde09fe3f10032beed131da1 100644
--- a/base/memory/shared_memory_handle.cc
+++ b/base/memory/shared_memory_handle.cc
@@ -20,4 +20,16 @@ size_t SharedMemoryHandle::GetSize() const {
return size_;
}
+std::string SharedMemoryHandle::GetGUIDNameForTracing() const {
+ return "shared_memory/" + GetGUID().ToString();
+}
+
+trace_event::MemoryAllocatorDumpGuid SharedMemoryHandle::GetGUIDForTracing()
+ const {
+ auto name = GetGUIDNameForTracing();
+ if (name.empty())
+ return base::trace_event::MemoryAllocatorDumpGuid();
+ return base::trace_event::MemoryAllocatorDumpGuid(name);
+}
+
} // namespace base
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698