Bug 1008925 Port plugin crashed handler changes from bug 981237 r=Ratty a=Ratty
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 09 Jun 2014 15:56:29 +0100
changeset 20000 275585d6b51ab73ed629c87045acce9307c5f13e
parent 19999 e83fae600a28b856159927a707ce4bc55542bbf4
child 20001 f4dd28fcd93c341cdc2f978a64f30d52dabc5dfd
push id1151
push usermbanner@mozilla.com
push dateMon, 09 Jun 2014 22:14:36 +0000
treeherdercomm-beta@ce127428ad7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, Ratty
bugs1008925, 981237
Bug 1008925 Port plugin crashed handler changes from bug 981237 r=Ratty a=Ratty
suite/common/bindings/notification.xml
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -2250,25 +2250,29 @@
               return;
           }
           this.pluginUnavailable(plugin, notification, message, buttons, pref);
         ]]>
       </handler>
 
       <handler event="PluginCrashed" phase="capturing">
         <![CDATA[
+          // Ensure the plugin and event are of the right type.
           var plugin = event.target;
-
-          var submittedReport = event.getData("submittedCrashReport");
-          var doPrompt        = true; // XXX followup for .getData("doPrompt");
-          var submitReports   = true; // XXX followup for .getData("submitReports");
-          var pluginName      = event.getData("pluginName");
-          var pluginFilename  = event.getData("pluginFilename");
-          var pluginDumpID    = event.getData("pluginDumpID");
-          var browserDumpID   = event.getData("browserDumpID");
+          var detail = event.detail;
+          if (!(detail instanceof Components.interfaces.nsIPropertyBag2))
+            return;
+
+          var submittedReport = detail.getPropertyAsBool("submittedCrashReport");
+          var doPrompt        = true; // XXX followup for .getPropertyAsBool("doPrompt");
+          var submitReports   = true; // XXX followup for .getPropertyAsBool("submitReports");
+          var pluginName      = detail.getPropertyAsAString("pluginName");
+          var pluginFilename  = detail.getPropertyAsAString("pluginFilename");
+          var pluginDumpID    = detail.getPropertyAsAString("pluginDumpID");
+          var browserDumpID   = detail.getPropertyAsAString("browserDumpID");
 
           // Remap the plugin name to a more user-presentable form.
           pluginName = this.makeNicePluginName(pluginName);
 
           // Force a style flush, so that we ensure our binding is attached.
           plugin.clientTop;
 
           // Configure the crashed-plugin placeholder.