Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: base/profiler/win32_stack_frame_unwinder.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler_unittest.cc ('k') | base/profiler/win32_stack_frame_unwinder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698