Bug 839456 - Annotate crash reports with Flash version on Android. r=bsmedberg, a=lsblakk
authorJames Willcox <jwillcox@mozilla.com>
Tue, 12 Feb 2013 15:33:38 -0500
changeset 127514 45e785af89970c1f9b711fa2b1d84a22e37646c0
parent 127513 fcd1d2c9dd8ba11311303ae20ac965609b05e7b6
child 127515 53a7311047ef99f41aa31b48621b2a7a51771f9d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, lsblakk
bugs839456
milestone20.0a2
Bug 839456 - Annotate crash reports with Flash version on Android. r=bsmedberg, a=lsblakk
dom/plugins/base/nsPluginHost.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -129,16 +129,20 @@
 #include "winbase.h"
 #endif
 
 #ifdef ANDROID
 #include <android/log.h>
 #define LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
 #endif
 
+#if MOZ_CRASHREPORTER
+#include "nsExceptionHandler.h"
+#endif
+
 using namespace mozilla;
 using mozilla::TimeStamp;
 
 // Null out a strong ref to a linked list iteratively to avoid
 // exhausting the stack (bug 486349).
 #define NS_ITERATIVE_UNREF_LIST(type_, list_, mNext_)                \
   {                                                                  \
     while (list_) {                                                  \
@@ -1054,16 +1058,22 @@ nsPluginHost::TrySetUpPluginInstance(con
         aMimeType, aOwner, urlSpec.get()));
 
   PR_LogFlush();
 #endif
 
   nsPluginTag* pluginTag = FindPluginForType(aMimeType, true);
   NS_ASSERTION(pluginTag, "Must have plugin tag here!");
 
+#if defined(MOZ_WIDGET_ANDROID) && defined(MOZ_CRASHREPORTER)
+  if (pluginTag->mIsFlashPlugin) {
+    CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FlashVersion"), pluginTag->mVersion);
+  }
+#endif
+
   nsRefPtr<nsNPAPIPlugin> plugin;
   GetPlugin(aMimeType, getter_AddRefs(plugin));
   if (!plugin) {
     return NS_ERROR_FAILURE;
   }
 
   nsRefPtr<nsNPAPIPluginInstance> instance = new nsNPAPIPluginInstance();