OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BlinkGCMemoryDumpProvider_h | 5 #ifndef BlinkGCMemoryDumpProvider_h |
6 #define BlinkGCMemoryDumpProvider_h | 6 #define BlinkGCMemoryDumpProvider_h |
7 | 7 |
8 #include "base/trace_event/memory_dump_provider.h" | 8 #include "base/trace_event/memory_dump_provider.h" |
| 9 #include "base/trace_event/sharded_allocation_register.h" |
9 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
10 #include "platform/heap/BlinkGC.h" | 11 #include "platform/heap/BlinkGC.h" |
11 #include "platform/wtf/Allocator.h" | 12 #include "platform/wtf/Allocator.h" |
12 #include "platform/wtf/ThreadingPrimitives.h" | |
13 #include "platform/wtf/text/WTFString.h" | 13 #include "platform/wtf/text/WTFString.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 namespace trace_event { | 16 namespace trace_event { |
17 | 17 |
18 class AllocationRegister; | |
19 class MemoryAllocatorDump; | 18 class MemoryAllocatorDump; |
20 | 19 |
21 } // namespace trace_event | 20 } // namespace trace_event |
22 } // namespace base | 21 } // namespace base |
23 | 22 |
24 namespace blink { | 23 namespace blink { |
25 class WebMemoryAllocatorDump; | 24 class WebMemoryAllocatorDump; |
26 | 25 |
27 class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final | 26 class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final |
28 : public base::trace_event::MemoryDumpProvider { | 27 : public base::trace_event::MemoryDumpProvider { |
(...skipping 21 matching lines...) Expand all Loading... |
50 base::trace_event::ProcessMemoryDump* CurrentProcessMemoryDump() { | 49 base::trace_event::ProcessMemoryDump* CurrentProcessMemoryDump() { |
51 return current_process_memory_dump_.get(); | 50 return current_process_memory_dump_.get(); |
52 } | 51 } |
53 | 52 |
54 void insert(Address, size_t, const char*); | 53 void insert(Address, size_t, const char*); |
55 void Remove(Address); | 54 void Remove(Address); |
56 | 55 |
57 private: | 56 private: |
58 BlinkGCMemoryDumpProvider(); | 57 BlinkGCMemoryDumpProvider(); |
59 | 58 |
60 Mutex allocation_register_mutex_; | 59 base::trace_event::ShardedAllocationRegister allocation_register_; |
61 std::unique_ptr<base::trace_event::AllocationRegister> allocation_register_; | |
62 std::unique_ptr<base::trace_event::ProcessMemoryDump> | 60 std::unique_ptr<base::trace_event::ProcessMemoryDump> |
63 current_process_memory_dump_; | 61 current_process_memory_dump_; |
64 bool is_heap_profiling_enabled_; | |
65 }; | 62 }; |
66 | 63 |
67 } // namespace blink | 64 } // namespace blink |
68 | 65 |
69 #endif | 66 #endif |
OLD | NEW |