Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_TRACE_EVENT_MEMORY_INFRA_BACKGROUND_WHITELIST_H_ | |
| 6 #define BASE_TRACE_EVENT_MEMORY_INFRA_BACKGROUND_WHITELIST_H_ | |
| 7 | |
| 8 // This file contains the whitelists for background mode to limit the tracing | |
| 9 // overhead and remove sensitive information from traces. | |
| 10 | |
| 11 #include <string> | |
| 12 | |
| 13 namespace base { | |
| 14 namespace trace_event { | |
| 15 | |
| 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 | |
| 18 // less performance and memory overhead. | |
| 19 const char* const kDumpProviderWhitelist[] = { | |
|
Primiano Tucci (use gerrit)
2016/06/02 20:24:04
These should be moved to an anonymous namespace in
ssid
2016/06/03 01:59:46
Sorry, fixed.
| |
| 20 // TODO(ssid): Fill this list with dump provider names which support | |
| 21 // background mode, crbug.com/613198. | |
| 22 nullptr // End of list marker. | |
| 23 }; | |
| 24 | |
| 25 // A list of string names that are allowed for the memory allocator dumps in | |
| 26 // background mode. | |
| 27 const char* const kAllocatorDumpNameWhitelist[] = { | |
|
Primiano Tucci (use gerrit)
2016/06/02 20:24:04
ditto for this.
ssid
2016/06/03 01:59:46
Done.
| |
| 28 // TODO(ssid): Fill this list with dump names, crbug.com/613198. | |
| 29 nullptr // End of list marker. | |
| 30 }; | |
| 31 | |
| 32 // Checks if the given |mdp_name| is in the whitelist. | |
| 33 bool IsMemoryDumpProviderWhitelisted(const char* mdp_name); | |
| 34 | |
| 35 // Checks if the given |mad_name| matches any of the whitelisted patterns. | |
| 36 bool IsMemoryAllocatorDumpNameWhitelisted(const std::string& mad_name); | |
| 37 | |
| 38 // The whitelist is replaced with the given list for tests: | |
| 39 void SetDumpProviderWhitelistForTesting(const char* const* list); | |
| 40 void SetAllocatorDumpNameWhitelistForTesting(const char* const* list); | |
| 41 | |
| 42 } // namespace trace_event | |
| 43 } // namespace base | |
| 44 | |
| 45 #endif // BASE_TRACE_EVENT_MEMORY_INFRA_BACKGROUND_WHITELIST_H_ | |
| OLD | NEW |