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_NATIVE_UNWINDER_WIN_H_ 6 #define BASE_PROFILER_NATIVE_UNWINDER_WIN_H_ 7 8 #include <vector> 9 10 #include "base/profiler/unwinder.h" 11 12 namespace base { 13 14 // Native unwinder implementation for Windows, using RtlVirtualUnwind. 15 class NativeUnwinderWin : public Unwinder { 16 public: 17 NativeUnwinderWin() = default; 18 19 NativeUnwinderWin(const NativeUnwinderWin&) = delete; 20 NativeUnwinderWin& operator=(const NativeUnwinderWin&) = delete; 21 22 // Unwinder: 23 bool CanUnwindFrom(const Frame& current_frame) const override; 24 UnwindResult TryUnwind(RegisterContext* thread_context, 25 uintptr_t stack_top, 26 std::vector<Frame>* stack) override; 27 }; 28 29 } // namespace base 30 31 #endif // BASE_PROFILER_NATIVE_UNWINDER_WIN_H_ 32