OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/gl/gl_image_shared_memory.h" | 5 #include "ui/gl/gl_image_shared_memory.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/memory/shared_memory_dump_provider.h" |
9 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
10 #include "base/process/process_handle.h" | 11 #include "base/process/process_handle.h" |
11 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
12 #include "base/trace_event/memory_allocator_dump.h" | 13 #include "base/trace_event/memory_allocator_dump.h" |
13 #include "base/trace_event/memory_dump_manager.h" | 14 #include "base/trace_event/memory_dump_manager.h" |
14 #include "base/trace_event/process_memory_dump.h" | 15 #include "base/trace_event/process_memory_dump.h" |
15 #include "ui/gfx/buffer_format_util.h" | 16 #include "ui/gfx/buffer_format_util.h" |
16 | 17 |
17 namespace gl { | 18 namespace gl { |
18 | 19 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 base::trace_event::MemoryAllocatorDump* dump = | 85 base::trace_event::MemoryAllocatorDump* dump = |
85 pmd->CreateAllocatorDump(dump_name + "/shared_memory"); | 86 pmd->CreateAllocatorDump(dump_name + "/shared_memory"); |
86 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 87 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
87 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 88 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
88 static_cast<uint64_t>(size_in_bytes)); | 89 static_cast<uint64_t>(size_in_bytes)); |
89 | 90 |
90 auto guid = GetGenericSharedMemoryGUIDForTracing(process_tracing_id, | 91 auto guid = GetGenericSharedMemoryGUIDForTracing(process_tracing_id, |
91 shared_memory_id_); | 92 shared_memory_id_); |
92 pmd->CreateSharedGlobalAllocatorDump(guid); | 93 pmd->CreateSharedGlobalAllocatorDump(guid); |
93 pmd->AddOwnershipEdge(dump->guid(), guid); | 94 pmd->AddOwnershipEdge(dump->guid(), guid); |
| 95 base::SharedMemoryDumpProvider::GetInstance()->AddSuballocation(pmd, |
| 96 dump->guid()); |
94 } | 97 } |
95 | 98 |
96 } // namespace gl | 99 } // namespace gl |
OLD | NEW |