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 WebProcessMemoryDump_h | 5 #ifndef WebProcessMemoryDump_h |
6 #define WebProcessMemoryDump_h | 6 #define WebProcessMemoryDump_h |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/trace_event/heap_profiler_allocation_context.h" | 10 #include "base/trace_event/heap_profiler_allocation_context.h" |
11 #include "base/trace_event/memory_dump_request_args.h" | 11 #include "base/trace_event/memory_dump_request_args.h" |
12 #include "platform/PlatformExport.h" | 12 #include "platform/PlatformExport.h" |
13 #include "platform/web_memory_allocator_dump.h" | 13 #include "platform/web_memory_allocator_dump.h" |
14 #include "wtf/HashMap.h" | 14 #include "wtf/HashMap.h" |
| 15 #include "wtf/OwnPtr.h" |
15 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 17 |
16 #include <map> | 18 #include <map> |
17 #include <memory> | 19 #include <memory> |
18 #include <vector> | 20 #include <vector> |
19 | 21 |
20 class SkTraceMemoryDump; | 22 class SkTraceMemoryDump; |
21 | 23 |
22 namespace base { | 24 namespace base { |
23 class DiscardableMemory; | 25 class DiscardableMemory; |
24 namespace trace_event { | 26 namespace trace_event { |
25 class MemoryAllocatorDump; | 27 class MemoryAllocatorDump; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 151 |
150 // TODO(ssid): Remove it once this information is added to ProcessMemoryDump. | 152 // TODO(ssid): Remove it once this information is added to ProcessMemoryDump. |
151 base::trace_event::MemoryDumpLevelOfDetail level_of_detail_; | 153 base::trace_event::MemoryDumpLevelOfDetail level_of_detail_; |
152 | 154 |
153 // Reverse index of MemoryAllocatorDump -> WebMemoryAllocatorDump wrapper. | 155 // Reverse index of MemoryAllocatorDump -> WebMemoryAllocatorDump wrapper. |
154 // By design WebMemoryDumpProvider(s) are not supposed to hold the pointer | 156 // By design WebMemoryDumpProvider(s) are not supposed to hold the pointer |
155 // to the WebProcessMemoryDump passed as argument of the onMemoryDump() call. | 157 // to the WebProcessMemoryDump passed as argument of the onMemoryDump() call. |
156 // Those pointers are valid only within the scope of the call and can be | 158 // Those pointers are valid only within the scope of the call and can be |
157 // safely torn down once the WebProcessMemoryDump itself is destroyed. | 159 // safely torn down once the WebProcessMemoryDump itself is destroyed. |
158 HashMap<base::trace_event::MemoryAllocatorDump*, | 160 HashMap<base::trace_event::MemoryAllocatorDump*, |
159 std::unique_ptr<WebMemoryAllocatorDump>> memory_allocator_dumps_; | 161 OwnPtr<WebMemoryAllocatorDump>> memory_allocator_dumps_; |
160 | 162 |
161 // Stores SkTraceMemoryDump for the current ProcessMemoryDump. | 163 // Stores SkTraceMemoryDump for the current ProcessMemoryDump. |
162 std::vector<std::unique_ptr<skia::SkiaTraceMemoryDumpImpl>> sk_trace_dump_list
_; | 164 std::vector<std::unique_ptr<skia::SkiaTraceMemoryDumpImpl>> sk_trace_dump_list
_; |
163 | 165 |
164 DISALLOW_COPY_AND_ASSIGN(WebProcessMemoryDump); | 166 DISALLOW_COPY_AND_ASSIGN(WebProcessMemoryDump); |
165 }; | 167 }; |
166 | 168 |
167 } // namespace blink | 169 } // namespace blink |
168 | 170 |
169 #endif // WebProcessMemoryDump_h | 171 #endif // WebProcessMemoryDump_h |
OLD | NEW |