| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef BASE_PROFILER_WIN32_STACK_FRAME_UNWINDER_H_ | 5 #ifndef BASE_PROFILER_WIN32_STACK_FRAME_UNWINDER_H_ | 
| 6 #define BASE_PROFILER_WIN32_STACK_FRAME_UNWINDER_H_ | 6 #define BASE_PROFILER_WIN32_STACK_FRAME_UNWINDER_H_ | 
| 7 | 7 | 
| 8 #include <windows.h> | 8 #include <windows.h> | 
| 9 | 9 | 
|  | 10 #include <memory> | 
|  | 11 | 
| 10 #include "base/base_export.h" | 12 #include "base/base_export.h" | 
| 11 #include "base/macros.h" | 13 #include "base/macros.h" | 
| 12 #include "base/memory/scoped_ptr.h" |  | 
| 13 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" | 
| 14 | 15 | 
| 15 namespace base { | 16 namespace base { | 
| 16 | 17 | 
| 17 #if !defined(_WIN64) | 18 #if !defined(_WIN64) | 
| 18 // Allows code to compile for x86. Actual support for x86 will require either | 19 // Allows code to compile for x86. Actual support for x86 will require either | 
| 19 // refactoring these interfaces or separate architecture-specific interfaces. | 20 // refactoring these interfaces or separate architecture-specific interfaces. | 
| 20 struct RUNTIME_FUNCTION { | 21 struct RUNTIME_FUNCTION { | 
| 21   DWORD BeginAddress; | 22   DWORD BeginAddress; | 
| 22   DWORD EndAddress; | 23   DWORD EndAddress; | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 77   Win32StackFrameUnwinder(); | 78   Win32StackFrameUnwinder(); | 
| 78   ~Win32StackFrameUnwinder(); | 79   ~Win32StackFrameUnwinder(); | 
| 79 | 80 | 
| 80   // Attempts to unwind the frame represented by the stack and instruction | 81   // Attempts to unwind the frame represented by the stack and instruction | 
| 81   // pointers in |context|. If successful, updates |context| and provides the | 82   // pointers in |context|. If successful, updates |context| and provides the | 
| 82   // module associated with the frame in |module|. | 83   // module associated with the frame in |module|. | 
| 83   bool TryUnwind(CONTEXT* context, ScopedModuleHandle* module); | 84   bool TryUnwind(CONTEXT* context, ScopedModuleHandle* module); | 
| 84 | 85 | 
| 85  private: | 86  private: | 
| 86   // This function is for internal and test purposes only. | 87   // This function is for internal and test purposes only. | 
| 87   Win32StackFrameUnwinder(scoped_ptr<UnwindFunctions> unwind_functions); | 88   Win32StackFrameUnwinder(std::unique_ptr<UnwindFunctions> unwind_functions); | 
| 88   friend class Win32StackFrameUnwinderTest; | 89   friend class Win32StackFrameUnwinderTest; | 
| 89 | 90 | 
| 90   // State associated with each stack unwinding. | 91   // State associated with each stack unwinding. | 
| 91   bool at_top_frame_; | 92   bool at_top_frame_; | 
| 92   bool unwind_info_present_for_all_frames_; | 93   bool unwind_info_present_for_all_frames_; | 
| 93 | 94 | 
| 94   scoped_ptr<UnwindFunctions> unwind_functions_; | 95   std::unique_ptr<UnwindFunctions> unwind_functions_; | 
| 95 | 96 | 
| 96   DISALLOW_COPY_AND_ASSIGN(Win32StackFrameUnwinder); | 97   DISALLOW_COPY_AND_ASSIGN(Win32StackFrameUnwinder); | 
| 97 }; | 98 }; | 
| 98 | 99 | 
| 99 }  // namespace base | 100 }  // namespace base | 
| 100 | 101 | 
| 101 #endif  // BASE_PROFILER_WIN32_STACK_FRAME_UNWINDER_H_ | 102 #endif  // BASE_PROFILER_WIN32_STACK_FRAME_UNWINDER_H_ | 
| OLD | NEW | 
|---|