| 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> |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 namespace trace_event { | 13 namespace trace_event { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // The names of dump providers whitelisted for background tracing. Dump | 16 // The names of dump providers whitelisted for background tracing. Dump |
| 17 // providers can be added here only if the background mode dump has very | 17 // providers can be added here only if the background mode dump has very |
| 18 // less performance and memory overhead. | 18 // less performance and memory overhead. |
| 19 const char* const kDumpProviderWhitelist[] = { | 19 const char* const kDumpProviderWhitelist[] = { |
| 20 "BlinkGC", | 20 "BlinkGC", |
| 21 "ChildDiscardableSharedMemoryManager", | 21 "ChildDiscardableSharedMemoryManager", |
| 22 "DOMStorage", | 22 "DOMStorage", |
| 23 "HostDiscardableSharedMemoryManager", | 23 "HostDiscardableSharedMemoryManager", |
| 24 "IndexedDBBackingStore", | 24 "IndexedDBBackingStore", |
| 25 "JavaHeap", | 25 "JavaHeap", |
| 26 "LevelDB", |
| 26 "LeveldbValueStore", | 27 "LeveldbValueStore", |
| 27 "Malloc", | 28 "Malloc", |
| 29 "MemoryCache", |
| 28 "PartitionAlloc", | 30 "PartitionAlloc", |
| 29 "ProcessMemoryMetrics", | 31 "ProcessMemoryMetrics", |
| 30 "Skia", | 32 "Skia", |
| 31 "Sql", | 33 "Sql", |
| 32 "V8Isolate", | 34 "V8Isolate", |
| 33 "WinHeap", | 35 "WinHeap", |
| 34 nullptr // End of list marker. | 36 nullptr // End of list marker. |
| 35 }; | 37 }; |
| 36 | 38 |
| 37 // A list of string names that are allowed for the memory allocator dumps in | 39 // A list of string names that are allowed for the memory allocator dumps in |
| 38 // background mode. | 40 // background mode. |
| 39 const char* const kAllocatorDumpNameWhitelist[] = { | 41 const char* const kAllocatorDumpNameWhitelist[] = { |
| 40 "blink_gc", | 42 "blink_gc", |
| 41 "blink_gc/allocated_objects", | 43 "blink_gc/allocated_objects", |
| 42 "discardable", | 44 "discardable", |
| 43 "discardable/child_0x?", | 45 "discardable/child_0x?", |
| 44 "dom_storage/0x?/cache_size", | 46 "dom_storage/0x?/cache_size", |
| 45 "dom_storage/session_storage_0x?", | 47 "dom_storage/session_storage_0x?", |
| 46 "java_heap", | 48 "java_heap", |
| 47 "java_heap/allocated_objects", | 49 "java_heap/allocated_objects", |
| 48 "leveldb/index_db/0x?", | 50 "leveldb/index_db/0x?", |
| 51 "leveldb/leveldb_proto/0x?", |
| 49 "leveldb/value_store/Extensions.Database.Open.Settings/0x?", | 52 "leveldb/value_store/Extensions.Database.Open.Settings/0x?", |
| 50 "leveldb/value_store/Extensions.Database.Open.Rules/0x?", | 53 "leveldb/value_store/Extensions.Database.Open.Rules/0x?", |
| 51 "leveldb/value_store/Extensions.Database.Open.State/0x?", | 54 "leveldb/value_store/Extensions.Database.Open.State/0x?", |
| 52 "leveldb/value_store/Extensions.Database.Open/0x?", | 55 "leveldb/value_store/Extensions.Database.Open/0x?", |
| 53 "leveldb/value_store/Extensions.Database.Restore/0x?", | 56 "leveldb/value_store/Extensions.Database.Restore/0x?", |
| 54 "leveldb/value_store/Extensions.Database.Value.Restore/0x?", | 57 "leveldb/value_store/Extensions.Database.Value.Restore/0x?", |
| 55 "malloc", | 58 "malloc", |
| 56 "malloc/allocated_objects", | 59 "malloc/allocated_objects", |
| 57 "malloc/metadata_fragmentation_caches", | 60 "malloc/metadata_fragmentation_caches", |
| 61 "web_cache/Image_resources", |
| 62 "web_cache/CSS stylesheet_resources", |
| 63 "web_cache/Script_resources", |
| 64 "web_cache/XSL stylesheet_resources", |
| 65 "web_cache/Font_resources", |
| 66 "web_cache/Other_resources", |
| 58 "partition_alloc/allocated_objects", | 67 "partition_alloc/allocated_objects", |
| 59 "partition_alloc/partitions", | 68 "partition_alloc/partitions", |
| 60 "partition_alloc/partitions/buffer", | 69 "partition_alloc/partitions/buffer", |
| 61 "partition_alloc/partitions/fast_malloc", | 70 "partition_alloc/partitions/fast_malloc", |
| 62 "partition_alloc/partitions/layout", | 71 "partition_alloc/partitions/layout", |
| 63 "skia/sk_glyph_cache", | 72 "skia/sk_glyph_cache", |
| 64 "skia/sk_resource_cache", | 73 "skia/sk_resource_cache", |
| 65 "sqlite", | 74 "sqlite", |
| 66 "v8/isolate_0x?/heap_spaces", | 75 "v8/isolate_0x?/heap_spaces", |
| 67 "v8/isolate_0x?/heap_spaces/code_space", | 76 "v8/isolate_0x?/heap_spaces/code_space", |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void SetDumpProviderWhitelistForTesting(const char* const* list) { | 131 void SetDumpProviderWhitelistForTesting(const char* const* list) { |
| 123 g_dump_provider_whitelist = list; | 132 g_dump_provider_whitelist = list; |
| 124 } | 133 } |
| 125 | 134 |
| 126 void SetAllocatorDumpNameWhitelistForTesting(const char* const* list) { | 135 void SetAllocatorDumpNameWhitelistForTesting(const char* const* list) { |
| 127 g_allocator_dump_name_whitelist = list; | 136 g_allocator_dump_name_whitelist = list; |
| 128 } | 137 } |
| 129 | 138 |
| 130 } // namespace trace_event | 139 } // namespace trace_event |
| 131 } // namespace base | 140 } // namespace base |
| OLD | NEW |