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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 const mach_msg_size_t trailer_alloc = REQUESTED_TRAILER_SIZE(options); | 140 const mach_msg_size_t trailer_alloc = REQUESTED_TRAILER_SIZE(options); |
141 const mach_msg_size_t expected_receive_size = | 141 const mach_msg_size_t expected_receive_size = |
142 round_msg(interface->MachMessageServerRequestSize()) + trailer_alloc; | 142 round_msg(interface->MachMessageServerRequestSize()) + trailer_alloc; |
143 const mach_msg_size_t request_size = (receive_large == kReceiveLargeResize) | 143 const mach_msg_size_t request_size = (receive_large == kReceiveLargeResize) |
144 ? round_page(expected_receive_size) | 144 ? round_page(expected_receive_size) |
145 : expected_receive_size; | 145 : expected_receive_size; |
146 DCHECK_GE(request_size, sizeof(mach_msg_empty_rcv_t)); | 146 DCHECK_GE(request_size, sizeof(mach_msg_empty_rcv_t)); |
147 | 147 |
148 // mach_msg_server() and mach_msg_server_once() would consider whether | 148 // mach_msg_server() and mach_msg_server_once() would consider whether |
149 // |options| contains MACH_SEND_TRAILER and include MAX_TRAILER_SIZE in this | 149 // |options| contains MACH_SEND_TRAILER and include MAX_TRAILER_SIZE in this |
150 // computation if it does, but that option is ineffective on OS X. | 150 // computation if it does, but that option is ineffective on macOS. |
151 const mach_msg_size_t reply_size = interface->MachMessageServerReplySize(); | 151 const mach_msg_size_t reply_size = interface->MachMessageServerReplySize(); |
152 DCHECK_GE(reply_size, sizeof(mach_msg_empty_send_t)); | 152 DCHECK_GE(reply_size, sizeof(mach_msg_empty_send_t)); |
153 const mach_msg_size_t reply_alloc = round_page(reply_size); | 153 const mach_msg_size_t reply_alloc = round_page(reply_size); |
154 | 154 |
155 MachMessageBuffer request; | 155 MachMessageBuffer request; |
156 MachMessageBuffer reply; | 156 MachMessageBuffer reply; |
157 bool received_any_request = false; | 157 bool received_any_request = false; |
158 bool retry; | 158 bool retry; |
159 | 159 |
160 kern_return_t kr; | 160 kern_return_t kr; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 return kr; | 272 return kr; |
273 } | 273 } |
274 } | 274 } |
275 } while (persistent == kPersistent || retry); | 275 } while (persistent == kPersistent || retry); |
276 | 276 |
277 return kr; | 277 return kr; |
278 } | 278 } |
279 | 279 |
280 } // namespace crashpad | 280 } // namespace crashpad |
OLD | NEW |