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