aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac/Framework
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-10-05 22:32:27 +0000
committermark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-10-05 22:32:27 +0000
commit405bb7aff734100b8d25adfd93d42d54a778b9a4 (patch)
tree87825db11db4f56cc19cb9ae74cc35cfa2ac8a92 /src/client/mac/Framework
parentEnsure crash reports will be uploaded on the Mac. (diff)
downloadbreakpad-405bb7aff734100b8d25adfd93d42d54a778b9a4.tar.xz
Address review comments from r843 (http://breakpad.appspot.com/307001)
Review URL: http://breakpad.appspot.com/308001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@844 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/Framework')
-rw-r--r--src/client/mac/Framework/Breakpad.h4
-rw-r--r--src/client/mac/Framework/OnDemandServer.mm13
2 files changed, 11 insertions, 6 deletions
diff --git a/src/client/mac/Framework/Breakpad.h b/src/client/mac/Framework/Breakpad.h
index fa861431..29bb3ec1 100644
--- a/src/client/mac/Framework/Breakpad.h
+++ b/src/client/mac/Framework/Breakpad.h
@@ -94,6 +94,10 @@ extern "C" {
#define BREAKPAD_SERVER_PARAMETER_PREFIX "BreakpadServerParameterPrefix_"
#define BREAKPAD_ON_DEMAND "BreakpadOnDemand"
+// A service name associated with the original bootstrap parent port, saved in
+// OnDemandServer and restored in Inspector.
+#define BREAKPAD_BOOTSTRAP_PARENT_PORT "com.Breakpad.BootstrapParent"
+
// Optional user-defined function to dec to decide if we should handle
// this crash or forward it along.
// Return true if you want Breakpad to handle it.
diff --git a/src/client/mac/Framework/OnDemandServer.mm b/src/client/mac/Framework/OnDemandServer.mm
index f736abd4..43a2703b 100644
--- a/src/client/mac/Framework/OnDemandServer.mm
+++ b/src/client/mac/Framework/OnDemandServer.mm
@@ -28,6 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "OnDemandServer.h"
+#import "Breakpad.h"
#if DEBUG
#define PRINT_MACH_RESULT(result_, message_) \
@@ -81,7 +82,7 @@ kern_return_t OnDemandServer::Initialize(const char *server_command,
mach_port_t bootstrap_subset_port;
kr = bootstrap_subset(bootstrap_port, self_task, &bootstrap_subset_port);
- if (kr != KERN_SUCCESS) {
+ if (kr != BOOTSTRAP_SUCCESS) {
PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_subset(): ");
return kr;
}
@@ -94,9 +95,9 @@ kern_return_t OnDemandServer::Initialize(const char *server_command,
// 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*>("BootstrapParentPort"),
+ const_cast<char*>(BREAKPAD_BOOTSTRAP_PARENT_PORT),
bootstrap_port);
- if (kr != KERN_SUCCESS) {
+ if (kr != BOOTSTRAP_SUCCESS) {
PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_register(): ");
return kr;
}
@@ -106,7 +107,7 @@ kern_return_t OnDemandServer::Initialize(const char *server_command,
geteuid(), // server uid
true,
&server_port_);
- if (kr != KERN_SUCCESS) {
+ if (kr != BOOTSTRAP_SUCCESS) {
PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_create_server(): ");
return kr;
}
@@ -118,13 +119,13 @@ kern_return_t OnDemandServer::Initialize(const char *server_command,
kr = bootstrap_create_service(server_port_,
const_cast<char*>(service_name),
&service_port_);
- if (kr != KERN_SUCCESS) {
+ if (kr != BOOTSTRAP_SUCCESS) {
PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_create_service(): ");
// perhaps the service has already been created - try to look it up
kr = bootstrap_look_up(bootstrap_port, (char*)service_name, &service_port_);
- if (kr != KERN_SUCCESS) {
+ if (kr != BOOTSTRAP_SUCCESS) {
PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_look_up(): ");
Unregister(); // clean up server port
return kr;