naiveproxy/src/base/profiler/sampling_profiler_thread_token.cc
2022-03-30 19:51:33 +08:00

20 lines
554 B
C++

// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/profiler/sampling_profiler_thread_token.h"
#include "build/build_config.h"
namespace base {
SamplingProfilerThreadToken GetSamplingProfilerCurrentThreadToken() {
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
return {PlatformThread::CurrentId(), pthread_self()};
#else
return {PlatformThread::CurrentId()};
#endif
}
} // namespace base