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_ALLOWLIST_H_
6 #define BASE_TRACE_EVENT_MEMORY_INFRA_BACKGROUND_ALLOWLIST_H_
7 
8 // This file contains the allowlists (aka whitelists) for background mode to
9 // limit the tracing overhead and remove sensitive information from traces.
10 
11 #include <string>
12 
13 #include "base/base_export.h"
14 
15 namespace base {
16 namespace trace_event {
17 
18 // Checks if the given |mdp_name| is in the allow list.
19 bool BASE_EXPORT IsMemoryDumpProviderInAllowlist(const char* mdp_name);
20 
21 // Checks if the given |name| matches any of the allowed patterns.
22 bool BASE_EXPORT IsMemoryAllocatorDumpNameInAllowlist(const std::string& name);
23 
24 // The allow list is replaced with the given list for tests. The last element
25 // of the list must be nullptr.
26 void BASE_EXPORT SetDumpProviderAllowlistForTesting(const char* const* list);
27 void BASE_EXPORT
28 SetAllocatorDumpNameAllowlistForTesting(const char* const* list);
29 
30 }  // namespace trace_event
31 }  // namespace base
32 
33 #endif  // BASE_TRACE_EVENT_MEMORY_INFRA_BACKGROUND_ALLOWLIST_H_
34