| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/trace_event/memory_infra_background_whitelist.h" | 5 #include "base/trace_event/memory_infra_background_whitelist.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 "LevelDB", | 27 "LevelDB", |
| 28 "LeveldbValueStore", | 28 "LeveldbValueStore", |
| 29 "Malloc", | 29 "Malloc", |
| 30 "MemoryCache", | 30 "MemoryCache", |
| 31 "PartitionAlloc", | 31 "PartitionAlloc", |
| 32 "ProcessMemoryMetrics", | 32 "ProcessMemoryMetrics", |
| 33 "Skia", | 33 "Skia", |
| 34 "Sql", | 34 "Sql", |
| 35 "V8Isolate", | 35 "V8Isolate", |
| 36 "WinHeap", | 36 "WinHeap", |
| 37 "SyncDirectory", |
| 37 nullptr // End of list marker. | 38 nullptr // End of list marker. |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 // A list of string names that are allowed for the memory allocator dumps in | 41 // A list of string names that are allowed for the memory allocator dumps in |
| 41 // background mode. | 42 // background mode. |
| 42 const char* const kAllocatorDumpNameWhitelist[] = { | 43 const char* const kAllocatorDumpNameWhitelist[] = { |
| 43 "blink_gc", | 44 "blink_gc", |
| 44 "blink_gc/allocated_objects", | 45 "blink_gc/allocated_objects", |
| 45 "discardable", | 46 "discardable", |
| 46 "discardable/child_0x?", | 47 "discardable/child_0x?", |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 "v8/isolate_0x?/heap_spaces/code_space", | 85 "v8/isolate_0x?/heap_spaces/code_space", |
| 85 "v8/isolate_0x?/heap_spaces/large_object_space", | 86 "v8/isolate_0x?/heap_spaces/large_object_space", |
| 86 "v8/isolate_0x?/heap_spaces/map_space", | 87 "v8/isolate_0x?/heap_spaces/map_space", |
| 87 "v8/isolate_0x?/heap_spaces/new_space", | 88 "v8/isolate_0x?/heap_spaces/new_space", |
| 88 "v8/isolate_0x?/heap_spaces/old_space", | 89 "v8/isolate_0x?/heap_spaces/old_space", |
| 89 "v8/isolate_0x?/heap_spaces/other_spaces", | 90 "v8/isolate_0x?/heap_spaces/other_spaces", |
| 90 "v8/isolate_0x?/malloc", | 91 "v8/isolate_0x?/malloc", |
| 91 "v8/isolate_0x?/zapped_for_debug", | 92 "v8/isolate_0x?/zapped_for_debug", |
| 92 "winheap", | 93 "winheap", |
| 93 "winheap/allocated_objects", | 94 "winheap/allocated_objects", |
| 95 "sync/0x?/kernel", |
| 96 "sync/0x?/store", |
| 94 nullptr // End of list marker. | 97 nullptr // End of list marker. |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 const char* const* g_dump_provider_whitelist = kDumpProviderWhitelist; | 100 const char* const* g_dump_provider_whitelist = kDumpProviderWhitelist; |
| 98 const char* const* g_allocator_dump_name_whitelist = | 101 const char* const* g_allocator_dump_name_whitelist = |
| 99 kAllocatorDumpNameWhitelist; | 102 kAllocatorDumpNameWhitelist; |
| 100 | 103 |
| 101 } // namespace | 104 } // namespace |
| 102 | 105 |
| 103 bool IsMemoryDumpProviderWhitelisted(const char* mdp_name) { | 106 bool IsMemoryDumpProviderWhitelisted(const char* mdp_name) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 void SetDumpProviderWhitelistForTesting(const char* const* list) { | 142 void SetDumpProviderWhitelistForTesting(const char* const* list) { |
| 140 g_dump_provider_whitelist = list; | 143 g_dump_provider_whitelist = list; |
| 141 } | 144 } |
| 142 | 145 |
| 143 void SetAllocatorDumpNameWhitelistForTesting(const char* const* list) { | 146 void SetAllocatorDumpNameWhitelistForTesting(const char* const* list) { |
| 144 g_allocator_dump_name_whitelist = list; | 147 g_allocator_dump_name_whitelist = list; |
| 145 } | 148 } |
| 146 | 149 |
| 147 } // namespace trace_event | 150 } // namespace trace_event |
| 148 } // namespace base | 151 } // namespace base |
| OLD | NEW |