chromium/base/trace_event/category_registry.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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "base/trace_event/category_registry.h"

#include <string.h>

#include <ostream>
#include <type_traits>

#include "base/check.h"
#include "base/debug/leak_annotations.h"
#include "base/notreached.h"
#include "third_party/abseil-cpp/absl/base/dynamic_annotations.h"

namespace base {
namespace trace_event {

namespace {

// |categories_| might end up causing creating dynamic initializers if not POD.
static_assert;

}  // namespace

// static
TraceCategory CategoryRegistry::categories_[kMaxCategories] =;

// static
std::atomic<size_t> CategoryRegistry::category_index_{};

// static
TraceCategory* const CategoryRegistry::kCategoryAlreadyShutdown =;
TraceCategory* const CategoryRegistry::kCategoryMetadata =;

// static
void CategoryRegistry::Initialize() {}

// static
void CategoryRegistry::ResetForTesting() {}

// static
TraceCategory* CategoryRegistry::GetCategoryByName(const char* category_name) {}

bool CategoryRegistry::GetOrCreateCategoryLocked(
    const char* category_name,
    CategoryInitializerFn category_initializer_fn,
    TraceCategory** category) {}

// static
const TraceCategory* CategoryRegistry::GetCategoryByStatePtr(
    const uint8_t* category_state) {}

// static
bool CategoryRegistry::IsMetaCategory(const TraceCategory* category) {}

// static
base::span<TraceCategory> CategoryRegistry::GetAllCategories() {}

// static
bool CategoryRegistry::IsValidCategoryPtr(const TraceCategory* category) {}

}  // namespace trace_event
}  // namespace base