Bug 541076 - add minidump id and plugin name to PluginCrashed event. p=ted+dolske, r=jst, r=ted
This commit is contained in:
@@ -50,6 +50,24 @@ using namespace mozilla::plugins;
|
||||
|
||||
PR_STATIC_ASSERT(sizeof(NPIdentifier) == sizeof(void*));
|
||||
|
||||
class PluginCrashed : public nsRunnable
|
||||
{
|
||||
public:
|
||||
PluginCrashed(nsNPAPIPlugin* plugin,
|
||||
const nsString& dumpID)
|
||||
: mDumpID(dumpID),
|
||||
mPlugin(plugin) { }
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
mPlugin->PluginCrashed(mDumpID);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
nsNPAPIPlugin* mPlugin;
|
||||
nsString mDumpID;
|
||||
};
|
||||
|
||||
// static
|
||||
PluginLibrary*
|
||||
PluginModuleParent::LoadModule(const char* aFilePath)
|
||||
@@ -160,8 +178,13 @@ PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
||||
switch (why) {
|
||||
case AbnormalShutdown: {
|
||||
nsCOMPtr<nsIFile> dump;
|
||||
nsAutoString dumpID;
|
||||
if (GetMinidump(getter_AddRefs(dump))) {
|
||||
WriteExtraDataForMinidump(dump);
|
||||
if (NS_SUCCEEDED(dump->GetLeafName(dumpID))) {
|
||||
dumpID.Replace(dumpID.Length() - 4, 4,
|
||||
NS_LITERAL_STRING(""));
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_WARNING("[PluginModuleParent::ActorDestroy] abnormal shutdown without minidump!");
|
||||
@@ -172,8 +195,7 @@ PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
||||
// and potentially modify the actor child list while enumerating it.
|
||||
if (mPlugin) {
|
||||
nsCOMPtr<nsIRunnable> r =
|
||||
new nsRunnableMethod<nsNPAPIPlugin>(
|
||||
mPlugin, &nsNPAPIPlugin::PluginCrashed);
|
||||
new PluginCrashed(mPlugin, dumpID);
|
||||
NS_DispatchToMainThread(r);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user