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

Side by Side Diff: util/mach/exception_ports.h

Issue 700143004: C++11: Use type aliases instead of typedefs (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « util/mach/exc_server_variants_test.cc ('k') | util/mach/symbolic_constants_mach_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 exception_handler_t port, 146 exception_handler_t port,
147 exception_behavior_t behavior, 147 exception_behavior_t behavior,
148 thread_state_flavor_t flavor) const; 148 thread_state_flavor_t flavor) const;
149 149
150 //! \brief Returns a string identifying the target type. 150 //! \brief Returns a string identifying the target type.
151 //! 151 //!
152 //! \return `"host"`, `"task"`, or `"thread"`, as appropriate. 152 //! \return `"host"`, `"task"`, or `"thread"`, as appropriate.
153 const char* TargetTypeName() const; 153 const char* TargetTypeName() const;
154 154
155 private: 155 private:
156 typedef kern_return_t (*GetExceptionPortsType)(mach_port_t, 156 using GetExceptionPortsType = kern_return_t(*)(mach_port_t,
157 exception_mask_t, 157 exception_mask_t,
158 exception_mask_array_t, 158 exception_mask_array_t,
159 mach_msg_type_number_t*, 159 mach_msg_type_number_t*,
160 exception_handler_array_t, 160 exception_handler_array_t,
161 exception_behavior_array_t, 161 exception_behavior_array_t,
162 exception_flavor_array_t); 162 exception_flavor_array_t);
163 163
164 typedef kern_return_t (*SetExceptionPortsType)(mach_port_t, 164 using SetExceptionPortsType = kern_return_t(*)(mach_port_t,
165 exception_mask_t, 165 exception_mask_t,
166 exception_handler_t, 166 exception_handler_t,
167 exception_behavior_t, 167 exception_behavior_t,
168 thread_state_flavor_t); 168 thread_state_flavor_t);
169 169
170 GetExceptionPortsType get_exception_ports_; 170 GetExceptionPortsType get_exception_ports_;
171 SetExceptionPortsType set_exception_ports_; 171 SetExceptionPortsType set_exception_ports_;
172 const char* target_name_; 172 const char* target_name_;
173 mach_port_t target_port_; 173 mach_port_t target_port_;
174 174
175 // If true, target_port_ will be deallocated in the destructor. This will 175 // If true, target_port_ will be deallocated in the destructor. This will
176 // always be false when the user provides a non-null target_port to the 176 // always be false when the user provides a non-null target_port to the
177 // constructor. It will also be false when target_type is kTargetTypeTask, 177 // constructor. It will also be false when target_type is kTargetTypeTask,
178 // even with a TASK_NULL target_port, because it is incorrect to deallocate 178 // even with a TASK_NULL target_port, because it is incorrect to deallocate
179 // the result of mach_task_self(). 179 // the result of mach_task_self().
180 bool dealloc_target_port_; 180 bool dealloc_target_port_;
181 181
182 DISALLOW_COPY_AND_ASSIGN(ExceptionPorts); 182 DISALLOW_COPY_AND_ASSIGN(ExceptionPorts);
183 }; 183 };
184 184
185 } // namespace crashpad 185 } // namespace crashpad
186 186
187 #endif // CRASHPAD_UTIL_MACH_EXCEPTION_PORTS_H_ 187 #endif // CRASHPAD_UTIL_MACH_EXCEPTION_PORTS_H_
OLDNEW
« no previous file with comments | « util/mach/exc_server_variants_test.cc ('k') | util/mach/symbolic_constants_mach_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698