OLD | NEW |
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 set_exception_ports_ = thread_set_exception_ports; | 47 set_exception_ports_ = thread_set_exception_ports; |
48 target_name_ = "thread"; | 48 target_name_ = "thread"; |
49 if (target_port_ == THREAD_NULL) { | 49 if (target_port_ == THREAD_NULL) { |
50 target_port_ = mach_thread_self(); | 50 target_port_ = mach_thread_self(); |
51 dealloc_target_port_ = true; | 51 dealloc_target_port_ = true; |
52 } | 52 } |
53 break; | 53 break; |
54 | 54 |
55 default: | 55 default: |
56 NOTREACHED(); | 56 NOTREACHED(); |
57 get_exception_ports_ = NULL; | 57 get_exception_ports_ = nullptr; |
58 set_exception_ports_ = NULL; | 58 set_exception_ports_ = nullptr; |
59 target_name_ = NULL; | 59 target_name_ = nullptr; |
60 target_port_ = MACH_PORT_NULL; | 60 target_port_ = MACH_PORT_NULL; |
61 break; | 61 break; |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 ExceptionPorts::~ExceptionPorts() { | 65 ExceptionPorts::~ExceptionPorts() { |
66 if (dealloc_target_port_) { | 66 if (dealloc_target_port_) { |
67 kern_return_t kr = mach_port_deallocate(mach_task_self(), target_port_); | 67 kern_return_t kr = mach_port_deallocate(mach_task_self(), target_port_); |
68 MACH_LOG_IF(ERROR, kr != KERN_SUCCESS, kr) << "mach_port_deallocate"; | 68 MACH_LOG_IF(ERROR, kr != KERN_SUCCESS, kr) << "mach_port_deallocate"; |
69 } | 69 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 124 } |
125 | 125 |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 const char* ExceptionPorts::TargetTypeName() const { | 129 const char* ExceptionPorts::TargetTypeName() const { |
130 return target_name_; | 130 return target_name_; |
131 } | 131 } |
132 | 132 |
133 } // namespace crashpad | 133 } // namespace crashpad |
OLD | NEW |