Fix emulator build error
[platform/framework/web/chromium-efl.git] / base / profiler / thread_delegate_posix.h
1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_PROFILER_THREAD_DELEGATE_POSIX_H_
6 #define BASE_PROFILER_THREAD_DELEGATE_POSIX_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/base_export.h"
12 #include "base/profiler/sampling_profiler_thread_token.h"
13 #include "base/profiler/thread_delegate.h"
14 #include "base/threading/platform_thread.h"
15
16 namespace base {
17
18 // Platform- and thread-specific implementation in support of stack sampling on
19 // POSIX.
20 class BASE_EXPORT ThreadDelegatePosix : public ThreadDelegate {
21  public:
22   static std::unique_ptr<ThreadDelegatePosix> Create(
23       SamplingProfilerThreadToken thread_token);
24
25   ~ThreadDelegatePosix() override;
26
27   ThreadDelegatePosix(const ThreadDelegatePosix&) = delete;
28   ThreadDelegatePosix& operator=(const ThreadDelegatePosix&) = delete;
29
30   // ThreadDelegate
31   PlatformThreadId GetThreadId() const override;
32   uintptr_t GetStackBaseAddress() const override;
33   std::vector<uintptr_t*> GetRegistersToRewrite(
34       RegisterContext* thread_context) override;
35
36  private:
37   ThreadDelegatePosix(PlatformThreadId id, uintptr_t base_address);
38
39   const PlatformThreadId thread_id_;
40   const uintptr_t thread_stack_base_address_;
41 };
42
43 }  // namespace base
44
45 #endif  // BASE_PROFILER_THREAD_DELEGATE_POSIX_H_