Bug 557011: Ensure OOP crashreporter has been initialized on mac. r=bsmedberg

This commit is contained in:
Chris Jones 2010-04-12 15:47:47 -05:00
parent bee34d930e
commit 1adcc7f5e1
3 changed files with 22 additions and 6 deletions

View File

@ -222,7 +222,8 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
childArgv.push_back(pidstring);
childArgv.push_back(childProcessType);
#if defined(MOZ_CRASHREPORTER) && !defined(XP_MACOSX)
#if defined(MOZ_CRASHREPORTER)
# if defined(OS_LINUX)
int childCrashFd, childCrashRemapFd;
if (!CrashReporter::CreateNotificationPipeForChild(
&childCrashFd, &childCrashRemapFd))
@ -236,6 +237,11 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
// "false" == crash reporting disabled
childArgv.push_back("false");
}
# elif defined(XP_MACOSX)
// Call the stub for initialization side effects. Eventually this
// code will be unified with that above.
CrashReporter::CreateNotificationPipeForChild();
# endif // OS_LINUX
#endif
base::LaunchApp(childArgv, mFileMap,

View File

@ -1434,11 +1434,7 @@ OnChildProcessDumpRequested(void* aContext,
static bool
OOPInitialized()
{
#if defined(XP_MACOSX)
return true;
#else
return crashServer != NULL;
#endif
return pidToMinidump != NULL;
}
static void
@ -1592,6 +1588,14 @@ SetRemoteExceptionHandler()
return gExceptionHandler->IsOutOfProcess();
}
//--------------------------------------------------
#elif defined(XP_MACOSX)
void
CreateNotificationPipeForChild()
{
if (GetEnabled() && !OOPInitialized())
OOPInit();
}
#endif // XP_WIN

View File

@ -145,6 +145,12 @@ bool CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd);
// Child-side API
bool SetRemoteExceptionHandler();
# elif defined(XP_MACOSX)
// When OOP crash reporting is implemented for Mac, it will almost
// certainly use the same interface as the linux code above. Until
// then, we provide stubs.
void CreateNotificationPipeForChild();
#endif // XP_WIN32
bool UnsetRemoteExceptionHandler();