#include "base/threading/thread_id_name_manager.h"
#include <stdlib.h>
#include <string.h>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/memory/singleton.h"
#include "base/strings/string_util.h"
#include "base/trace_event/heap_profiler_allocation_context_tracker.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"
namespace base {
namespace {
static const char kDefaultName[] = …;
static std::string* g_default_name;
ABSL_CONST_INIT thread_local const char* thread_name = …;
}
ThreadIdNameManager::Observer::~Observer() = default;
ThreadIdNameManager::ThreadIdNameManager()
: … { … }
ThreadIdNameManager::~ThreadIdNameManager() = default;
ThreadIdNameManager* ThreadIdNameManager::GetInstance() { … }
const char* ThreadIdNameManager::GetDefaultInternedString() { … }
void ThreadIdNameManager::RegisterThread(PlatformThreadHandle::Handle handle,
PlatformThreadId id) { … }
void ThreadIdNameManager::AddObserver(Observer* obs) { … }
void ThreadIdNameManager::RemoveObserver(Observer* obs) { … }
void ThreadIdNameManager::SetName(const std::string& name) { … }
const char* ThreadIdNameManager::GetName(PlatformThreadId id) { … }
const char* ThreadIdNameManager::GetNameForCurrentThread() { … }
void ThreadIdNameManager::RemoveName(PlatformThreadHandle::Handle handle,
PlatformThreadId id) { … }
std::vector<PlatformThreadId> ThreadIdNameManager::GetIds() { … }
}