| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 (options & MACH_SEND_TRAILER) ? (max_reply_size + MAX_TRAILER_SIZE) | 113 (options & MACH_SEND_TRAILER) ? (max_reply_size + MAX_TRAILER_SIZE) |
| 114 : max_reply_size); | 114 : max_reply_size); |
| 115 | 115 |
| 116 kern_return_t kr; | 116 kern_return_t kr; |
| 117 | 117 |
| 118 do { | 118 do { |
| 119 mach_msg_size_t this_request_alloc = request_alloc; | 119 mach_msg_size_t this_request_alloc = request_alloc; |
| 120 mach_msg_size_t this_request_size = request_size; | 120 mach_msg_size_t this_request_size = request_size; |
| 121 | 121 |
| 122 base::mac::ScopedMachVM request_scoper; | 122 base::mac::ScopedMachVM request_scoper; |
| 123 mach_msg_header_t* request_header = NULL; | 123 mach_msg_header_t* request_header = nullptr; |
| 124 | 124 |
| 125 while (!request_scoper.address()) { | 125 while (!request_scoper.address()) { |
| 126 vm_address_t request_addr; | 126 vm_address_t request_addr; |
| 127 kr = vm_allocate(mach_task_self(), | 127 kr = vm_allocate(mach_task_self(), |
| 128 &request_addr, | 128 &request_addr, |
| 129 this_request_alloc, | 129 this_request_alloc, |
| 130 VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_MACH_MSG)); | 130 VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_MACH_MSG)); |
| 131 if (kr != KERN_SUCCESS) { | 131 if (kr != KERN_SUCCESS) { |
| 132 return kr; | 132 return kr; |
| 133 } | 133 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // persistent mode, and just return success when not in persistent mode. | 257 // persistent mode, and just return success when not in persistent mode. |
| 258 return (persistent == kPersistent) ? MACH_RCV_TIMED_OUT : kr; | 258 return (persistent == kPersistent) ? MACH_RCV_TIMED_OUT : kr; |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 } while (persistent == kPersistent); | 261 } while (persistent == kPersistent); |
| 262 | 262 |
| 263 return kr; | 263 return kr; |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace crashpad | 266 } // namespace crashpad |
| OLD | NEW |