sampling_profiler_thread_token.cc 554 B

12345678910111213141516171819
  1. // Copyright 2019 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. #include "base/profiler/sampling_profiler_thread_token.h"
  5. #include "build/build_config.h"
  6. namespace base {
  7. SamplingProfilerThreadToken GetSamplingProfilerCurrentThreadToken() {
  8. #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
  9. return {PlatformThread::CurrentId(), pthread_self()};
  10. #else
  11. return {PlatformThread::CurrentId()};
  12. #endif
  13. }
  14. } // namespace base