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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 uint32_t number; | 314 uint32_t number; |
315 }; | 315 }; |
316 | 316 |
317 // MachMultiprocess: | 317 // MachMultiprocess: |
318 | 318 |
319 void MachMultiprocessParent() override { | 319 void MachMultiprocessParent() override { |
320 mach_port_t local_port = LocalPort(); | 320 mach_port_t local_port = LocalPort(); |
321 | 321 |
322 kern_return_t kr; | 322 kern_return_t kr; |
323 if (options_.child_send_all_requests_before_receiving_any_replies) { | 323 if (options_.child_send_all_requests_before_receiving_any_replies) { |
324 // On Mac OS X 10.10, the queue limit of a new Mach port seems to be 2 | 324 // On OS X 10.10, the queue limit of a new Mach port seems to be 2 by |
325 // by default, which is below the value of MACH_PORT_QLIMIT_DEFAULT. Set | 325 // default, which is below the value of MACH_PORT_QLIMIT_DEFAULT. Set the |
326 // the port’s queue limit explicitly here. | 326 // port’s queue limit explicitly here. |
327 mach_port_limits limits = {}; | 327 mach_port_limits limits = {}; |
328 limits.mpl_qlimit = MACH_PORT_QLIMIT_DEFAULT; | 328 limits.mpl_qlimit = MACH_PORT_QLIMIT_DEFAULT; |
329 kr = mach_port_set_attributes(mach_task_self(), | 329 kr = mach_port_set_attributes(mach_task_self(), |
330 local_port, | 330 local_port, |
331 MACH_PORT_LIMITS_INFO, | 331 MACH_PORT_LIMITS_INFO, |
332 reinterpret_cast<mach_port_info_t>(&limits), | 332 reinterpret_cast<mach_port_info_t>(&limits), |
333 MACH_PORT_LIMITS_INFO_COUNT); | 333 MACH_PORT_LIMITS_INFO_COUNT); |
334 ASSERT_EQ(KERN_SUCCESS, kr) | 334 ASSERT_EQ(KERN_SUCCESS, kr) |
335 << MachErrorMessage(kr, "mach_port_set_attributes"); | 335 << MachErrorMessage(kr, "mach_port_set_attributes"); |
336 } | 336 } |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 options.expect_server_transaction_count = 0; | 847 options.expect_server_transaction_count = 0; |
848 options.client_send_large = true; | 848 options.client_send_large = true; |
849 options.client_expect_reply = false; | 849 options.client_expect_reply = false; |
850 TestMachMessageServer test_mach_message_server(options); | 850 TestMachMessageServer test_mach_message_server(options); |
851 test_mach_message_server.Test(); | 851 test_mach_message_server.Test(); |
852 } | 852 } |
853 | 853 |
854 } // namespace | 854 } // namespace |
855 } // namespace test | 855 } // namespace test |
856 } // namespace crashpad | 856 } // namespace crashpad |
OLD | NEW |