| 6 | #define BASE_PROFILER_THREAD_DELEGATE_POSIX_H_ |
| 7 |
| 8 | #include "base/base_export.h" |
| 9 | #include "base/profiler/sampling_profiler_thread_token.h" |
| 10 | #include "base/profiler/thread_delegate.h" |
| 11 | #include "base/threading/platform_thread.h" |
| 12 |
| 13 | namespace base { |
| 14 |
| 15 | // Platform- and thread-specific implementation in support of stack sampling on |
| 16 | // POSIX. |
| 17 | class BASE_EXPORT ThreadDelegatePosix : public ThreadDelegate { |
| 18 | public: |
| 19 | ThreadDelegatePosix(SamplingProfilerThreadToken thread_token); |
| 20 |
| 21 | ThreadDelegatePosix(const ThreadDelegatePosix&) = delete; |
| 22 | ThreadDelegatePosix& operator=(const ThreadDelegatePosix&) = delete; |
| 23 |
| 24 | // ThreadDelegate |
| 25 | PlatformThreadId GetThreadId() const override; |
| 26 | uintptr_t GetStackBaseAddress() const override; |
| 27 | std::vector<uintptr_t*> GetRegistersToRewrite( |
| 28 | RegisterContext* thread_context) override; |
| 29 |
| 30 | private: |
| 31 | const PlatformThreadId thread_id_; |
| 32 | const uintptr_t thread_stack_base_address_; |
| 33 | }; |
| 34 |
| 35 | } // namespace base |
| 36 |
| 37 | #endif // BASE_PROFILER_THREAD_DELEGATE_POSIX_H_ |
| 38 |