Bug 1312416 - use tabbrowser message manager group to listen for decoder doctor messages, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 28 Oct 2016 18:15:30 +0100
changeset 320071 9f0e99ac3fca2edfe9ba5964b20cabff6a0c3705
parent 320070 97db1163c72973f0027e25591b09819a903c2b50
child 320072 288d92c34790593a91aadb83e0e578bdd8ec4b39
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1312416
milestone52.0a1
Bug 1312416 - use tabbrowser message manager group to listen for decoder doctor messages, r=jaws For browsers in e.g. panels, we can't really make decoder doctor work well, so we simply elect to only listen for such messages within tabbrowser browsers. MozReview-Commit-ID: Frrhf6AOgAy
browser/base/content/browser-media.js
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -351,14 +351,14 @@ let gDecoderDoctorHandler = {
       // first time we get this resolution -> Clear prefs and report telemetry.
       Services.prefs.clearUserPref(formatsPref);
       Services.prefs.clearUserPref(buttonClickedPref);
       histogram.add(decoderDoctorReportId, TELEMETRY_DDSTAT_SOLVED);
     }
   },
 }
 
-window.messageManager.addMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler);
-window.messageManager.addMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler);
+window.getGroupMessageManager("browsers").addMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler);
+window.getGroupMessageManager("browsers").addMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler);
 window.addEventListener("unload", function() {
-  window.messageManager.removeMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler);
-  window.messageManager.removeMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler);
+  window.getGroupMessageManager("browsers").removeMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler);
+  window.getGroupMessageManager("browsers").removeMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler);
 }, false);