From 8f421f43e9bb0820c7ec43f50f7c5cfeaa7a8fdf Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Thu, 23 Apr 2015 10:34:39 +0200 Subject: [PATCH] Backed out changeset d6df8807c839 (bug 1155908) for bustage --- dom/plugins/ipc/PluginModuleParent.cpp | 58 ++++++++++++++------------ 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 3b3a9bd21e4e..3808276999ed 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -1112,17 +1112,26 @@ PluginModuleChromeParent::AnnotateHang(mozilla::HangMonitor::HangAnnotations& aA } } +#ifdef MOZ_CRASHREPORTER_INJECTOR static bool -CreatePluginMinidump(base::ProcessId processId, ThreadId childThread, - nsIFile* parentMinidump, const nsACString& name) +CreateFlashMinidump(DWORD processId, ThreadId childThread, + nsIFile* parentMinidump, const nsACString& name) { - mozilla::ipc::ScopedProcessHandle handle; - if (processId == 0 || - !base::OpenPrivilegedProcessHandle(processId, &handle.rwget())) { + if (processId == 0) { return false; } - return CreateAdditionalChildMinidump(handle, 0, parentMinidump, name); + + base::ProcessHandle handle; + if (!base::OpenPrivilegedProcessHandle(processId, &handle)) { + return false; + } + + bool res = CreateAdditionalChildMinidump(handle, 0, parentMinidump, name); + base::CloseProcessHandle(handle); + + return res; } +#endif bool PluginModuleChromeParent::ShouldContinueFromReplyTimeout() @@ -1192,37 +1201,32 @@ PluginModuleChromeParent::TerminateChildProcess(MessageLoop* aMsgLoop) } } #endif // XP_WIN - // Generate base report, includes plugin and browser process minidumps. if (crashReporter->GeneratePairedMinidump(this)) { mPluginDumpID = crashReporter->ChildDumpID(); PLUGIN_LOG_DEBUG( ("generated paired browser/plugin minidumps: %s)", NS_ConvertUTF16toUTF8(mPluginDumpID).get())); + nsAutoCString additionalDumps("browser"); + +#ifdef MOZ_CRASHREPORTER_INJECTOR nsCOMPtr pluginDumpFile; + if (GetMinidumpForID(mPluginDumpID, getter_AddRefs(pluginDumpFile)) && pluginDumpFile) { -#ifdef MOZ_CRASHREPORTER_INJECTOR - // If we have handles to the flash sandbox processes on Windows, - // include those minidumps as well. - if (CreatePluginMinidump(mFlashProcess1, 0, pluginDumpFile, - NS_LITERAL_CSTRING("flash1"))) { - additionalDumps.AppendLiteral(",flash1"); - } - if (CreatePluginMinidump(mFlashProcess2, 0, pluginDumpFile, - NS_LITERAL_CSTRING("flash2"))) { - additionalDumps.AppendLiteral(",flash2"); - } -#endif - if (mContentParent) { - // Include the content process minidump - if (CreatePluginMinidump(mContentParent->OtherPid(), 0, - pluginDumpFile, - NS_LITERAL_CSTRING("content"))) { - additionalDumps.AppendLiteral(",content"); - } - } + nsCOMPtr childDumpFile; + + if (CreateFlashMinidump(mFlashProcess1, 0, pluginDumpFile, + NS_LITERAL_CSTRING("flash1"))) { + additionalDumps.AppendLiteral(",flash1"); + } + if (CreateFlashMinidump(mFlashProcess2, 0, pluginDumpFile, + NS_LITERAL_CSTRING("flash2"))) { + additionalDumps.AppendLiteral(",flash2"); + } } +#endif + crashReporter->AnnotateCrashReport( NS_LITERAL_CSTRING("additional_minidumps"), additionalDumps);