chromium/base/trace_event/memory_infra_background_allowlist.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/trace_event/memory_infra_background_allowlist.h"

#include <string.h>

#include <string>
#include <string_view>

#include "base/containers/contains.h"
#include "base/containers/fixed_flat_set.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "partition_alloc/buildflags.h"
#include "third_party/abseil-cpp/absl/strings/ascii.h"

#if BUILDFLAG(IS_ANDROID)
#include "base/android/meminfo_dump_provider.h"
#endif

namespace base::trace_event {
namespace {

// The names of dump providers allowed to perform background tracing. Dump
// providers can be added here only if the background mode dump has very
// little processor and memory overhead.
// TODO(ssid): Some dump providers do not create ownership edges on background
// dump. So, the effective size will not be correct.
constexpr auto kDumpProviderAllowlist =;

// A list of string names that are allowed for the memory allocator dumps in
// background mode.
constexpr auto kAllocatorDumpNameAllowlist =;

base::span<const std::string_view> g_dump_provider_allowlist_for_testing;
base::span<const std::string_view> g_allocator_dump_name_allowlist_for_testing;

}  // namespace

bool IsMemoryDumpProviderInAllowlist(const char* mdp_name) {}

bool IsMemoryAllocatorDumpNameInAllowlist(const std::string& name) {}

void SetDumpProviderAllowlistForTesting(
    base::span<const std::string_view> list) {}

void SetAllocatorDumpNameAllowlistForTesting(
    base::span<const std::string_view> list) {}

}  // namespace base::trace_event