stack_copier_signal.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef BASE_PROFILER_STACK_COPIER_SIGNAL_H_
  5. #define BASE_PROFILER_STACK_COPIER_SIGNAL_H_
  6. #include <memory>
  7. #include "base/base_export.h"
  8. #include "base/profiler/stack_copier.h"
  9. namespace base {
  10. class ThreadDelegate;
  11. // Supports stack copying on platforms where a signal must be delivered to the
  12. // profiled thread and the stack is copied from the signal handler.
  13. class BASE_EXPORT StackCopierSignal : public StackCopier {
  14. public:
  15. StackCopierSignal(std::unique_ptr<ThreadDelegate> thread_delegate);
  16. ~StackCopierSignal() override;
  17. // StackCopier:
  18. bool CopyStack(StackBuffer* stack_buffer,
  19. uintptr_t* stack_top,
  20. TimeTicks* timestamp,
  21. RegisterContext* thread_context,
  22. Delegate* delegate) override;
  23. using StackCopier::CopyStackContentsAndRewritePointers;
  24. private:
  25. std::unique_ptr<ThreadDelegate> thread_delegate_;
  26. };
  27. } // namespace base
  28. #endif // BASE_PROFILER_STACK_COPIER_SIGNAL_H_