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

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

Issue 584223002: ExceptionPorts test: accept a port of MACH_PORT_NULL as “no handler.” (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | util/mach/exception_ports_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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 //! \param[in] mask The exception mask, containing the `EXC_MASK_*` values to 110 //! \param[in] mask The exception mask, containing the `EXC_MASK_*` values to
111 //! be looked up and returned in \a handlers. 111 //! be looked up and returned in \a handlers.
112 //! \param[out] handlers The exception handlers registered for \a target_port 112 //! \param[out] handlers The exception handlers registered for \a target_port
113 //! to handle exceptions indicated in \a mask. The caller must take 113 //! to handle exceptions indicated in \a mask. The caller must take
114 //! ownership of the \a port members of the returned ExceptionHandler 114 //! ownership of the \a port members of the returned ExceptionHandler
115 //! objects. On failure, this argument is untouched. 115 //! objects. On failure, this argument is untouched.
116 //! 116 //!
117 //! \return `true` if `*_get_exception_ports()` returned `KERN_SUCCESS`, with 117 //! \return `true` if `*_get_exception_ports()` returned `KERN_SUCCESS`, with
118 //! \a handlers set appropriately. `false` otherwise, with an appropriate 118 //! \a handlers set appropriately. `false` otherwise, with an appropriate
119 //! message logged. 119 //! message logged.
120 //!
121 //! \note One element at most will be returned in \a handlers for each bit set
122 //! in \a mask. If no exception port is registered for a bit in \a mask,
123 //! there will either be no entry corresponding to that bit in \a
124 //! handlers, or there will be an entry whose ExceptionHandler::port field
125 //! is set to `MACH_PORT_NULL`. The precise behavior depends on the
Robert Sesek 2014/09/22 15:08:23 Would it not be better to have ExceptionPorts norm
126 //! underlying operating system and the target type.
120 bool GetExceptionPorts(exception_mask_t mask, 127 bool GetExceptionPorts(exception_mask_t mask,
121 std::vector<ExceptionHandler>* handlers) const; 128 std::vector<ExceptionHandler>* handlers) const;
122 129
123 //! \brief Calls `*_set_exception_ports()` on the target. 130 //! \brief Calls `*_set_exception_ports()` on the target.
124 //! 131 //!
125 //! \param[in] mask A mask specifying the exception types to direct to \a 132 //! \param[in] mask A mask specifying the exception types to direct to \a
126 //! port, containing `EXC_MASK_*` values. 133 //! port, containing `EXC_MASK_*` values.
127 //! \param[in] port A send right to a Mach port that will handle exceptions 134 //! \param[in] port A send right to a Mach port that will handle exceptions
128 //! sustained by \a target_port of the types indicated in \a mask. The 135 //! sustained by \a target_port of the types indicated in \a mask. The
129 //! send right is copied, not consumed, by this call. 136 //! send right is copied, not consumed, by this call.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // even with a MACH_PORT_NULL target_port, because it is incorrect to 180 // even with a MACH_PORT_NULL target_port, because it is incorrect to
174 // deallocate the result of mach_task_self(). 181 // deallocate the result of mach_task_self().
175 bool dealloc_target_port_; 182 bool dealloc_target_port_;
176 183
177 DISALLOW_COPY_AND_ASSIGN(ExceptionPorts); 184 DISALLOW_COPY_AND_ASSIGN(ExceptionPorts);
178 }; 185 };
179 186
180 } // namespace crashpad 187 } // namespace crashpad
181 188
182 #endif // CRASHPAD_UTIL_MACH_EXCEPTION_PORTS_H_ 189 #endif // CRASHPAD_UTIL_MACH_EXCEPTION_PORTS_H_
OLDNEW
« no previous file with comments | « no previous file | util/mach/exception_ports_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698