Bug 691424 - Ensure that plugin processes that can't create a crash reporter actor abort the plugin creation process. r=bsmedberg

This commit is contained in:
Josh Matthews 2011-10-19 15:32:17 -04:00
parent 3715293ac6
commit a73000fbda
2 changed files with 9 additions and 3 deletions

View File

@ -86,7 +86,7 @@ public:
the protocol.
*/
template<class Toplevel>
static void CreateCrashReporter(Toplevel* actor);
static bool CreateCrashReporter(Toplevel* actor);
#endif
/* Initialize this reporter with data from the child process */
void
@ -176,7 +176,7 @@ CrashReporterParent::GenerateCrashReport(Toplevel* t,
}
template<class Toplevel>
/* static */ void
/* static */ bool
CrashReporterParent::CreateCrashReporter(Toplevel* actor)
{
#ifdef MOZ_CRASHREPORTER
@ -189,7 +189,9 @@ CrashReporterParent::CreateCrashReporter(Toplevel* actor)
} else {
NS_ERROR("Error creating crash reporter actor");
}
return !!p;
#endif
return false;
}
#endif

View File

@ -116,7 +116,11 @@ PluginModuleParent::LoadModule(const char* aFilePath)
TimeoutChanged(kChildTimeoutPref, parent);
#ifdef MOZ_CRASHREPORTER
CrashReporterParent::CreateCrashReporter(parent.get());
// If this fails, we're having IPC troubles, and we're doomed anyways.
if (!CrashReporterParent::CreateCrashReporter(parent.get())) {
parent->mShutdown = true;
return nsnull;
}
#endif
return parent.forget();