Funnel all bootstrap_register calls through a routine that doesn't care that

it's deprecated. Apple marked bootstrap_register as deprecated on 10.5 but
it's actually still needed on that OS release. There isn't a way to get the
functionality Breakpad needs from it without calling it until 10.6.
Review URL: https://breakpad.appspot.com/350001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@921 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
mark@chromium.org
2012-02-21 21:24:43 +00:00
parent 430c0a371a
commit 6fbc102794
6 changed files with 130 additions and 12 deletions

View File

@@ -28,7 +28,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "OnDemandServer.h"
#import "Breakpad.h"
#include "common/mac/bootstrap_compat.h"
#if DEBUG
#define PRINT_MACH_RESULT(result_, message_) \
@@ -100,9 +102,10 @@ kern_return_t OnDemandServer::Initialize(const char *server_command,
// in the subset by registering it under a known name. The inspector will
// recover this port and set it as its own bootstrap port in Inspector.mm
// Inspector::ResetBootstrapPort.
kr = bootstrap_register(bootstrap_subset_port,
const_cast<char*>(BREAKPAD_BOOTSTRAP_PARENT_PORT),
bootstrap_port);
kr = breakpad::BootstrapRegister(
bootstrap_subset_port,
const_cast<char*>(BREAKPAD_BOOTSTRAP_PARENT_PORT),
bootstrap_port);
if (kr != BOOTSTRAP_SUCCESS) {
PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_register(): ");
return kr;
@@ -169,9 +172,9 @@ void OnDemandServer::Unregister() {
if (server_port_ != MACH_PORT_NULL) {
// unregister the service
kern_return_t kr = bootstrap_register(server_port_,
service_name_,
MACH_PORT_NULL);
kern_return_t kr = breakpad::BootstrapRegister(server_port_,
service_name_,
MACH_PORT_NULL);
if (kr != KERN_SUCCESS) {
PRINT_MACH_RESULT(kr, "Breakpad UNREGISTER : bootstrap_register() : ");