Bug 1314445 - Remove unused EME notification handlers from browser-media.js. r=gijs draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 02 Nov 2016 13:07:14 +1300
changeset 432842 50eb62c487aa88e687fa6a6ff30cdfd762aa51a7
parent 432841 9c9ddf6b2b9df845a2807186e8649684e9227ee3
child 432843 88b11bbbe0fffb434d7699f9c720c12ab7797b5c
push id34444
push usercpearce@mozilla.com
push dateWed, 02 Nov 2016 22:51:27 +0000
reviewersgijs
bugs1314445
milestone52.0a1
Bug 1314445 - Remove unused EME notification handlers from browser-media.js. r=gijs Gecko no longer emits these notifications, so there's no point handling them in the front end code. MozReview-Commit-ID: KGysG56m3QO
browser/base/content/browser-media.js
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -89,21 +89,19 @@ var gEMEHandler = {
       case "cdm-not-installed":
         notificationId = "drmContentCDMInstalling";
         params = [this._brandShortName];
         break;
 
       case "cdm-not-supported":
         // Not to pop up user-level notification because they cannot do anything
         // about it.
-      case "error":
-        // Fall through and do the same for unknown messages:
+        return;
       default:
-        let typeOfIssue = status == "error" ? "error" : "message ('" + status + "')";
-        Cu.reportError("Unknown " + typeOfIssue + " dealing with EME key request: " + data);
+        Cu.reportError(new Error("Unknown message ('" + status + "') dealing with EME key request: " + data));
         return;
     }
 
     this.showNotificationBar(browser, notificationId, keySystem, params, buttonCallback);
   },
   showNotificationBar: function(browser, notificationId, keySystem, labelParams, callback) {
     let box = gBrowser.getNotificationBox(browser);
     if (box.getNotificationWithValue(notificationId)) {
@@ -140,17 +138,16 @@ var gEMEHandler = {
 
     box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM,
                            buttons);
   },
   showPopupNotificationForSuccess: function(browser, keySystem) {
     // We're playing EME content! Remove any "we can't play because..." messages.
     var box = gBrowser.getNotificationBox(browser);
     ["drmContentDisabled",
-     "drmContentCDMInsufficientVersion",
      "drmContentCDMInstalling"
      ].forEach(function (value) {
         var notification = box.getNotificationWithValue(value);
         if (notification)
           box.removeNotification(notification);
       });
 
     // Don't bother creating it if it's already there:
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -595,19 +595,16 @@ emeNotifications.drmContentPlaying.butto
 
 # LOCALIZATION NOTE(emeNotifications.drmContentDisabled.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S will be the 'learn more' link
 emeNotifications.drmContentDisabled.message = You must enable DRM to play some audio or video on this page. %S
 emeNotifications.drmContentDisabled.button.label = Enable DRM
 emeNotifications.drmContentDisabled.button.accesskey = E
 # LOCALIZATION NOTE(emeNotifications.drmContentDisabled.learnMoreLabel): NB: inserted via innerHTML, so please don't use <, > or & in this string.
 emeNotifications.drmContentDisabled.learnMoreLabel = Learn More
 
-# LOCALIZATION NOTE(emeNotifications.drmContentCDMInsufficientVersion.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S is brandShortName
-emeNotifications.drmContentCDMInsufficientVersion.message = %S is installing updates needed to play the audio or video on this page. Please try again later.
-
 # LOCALIZATION NOTE(emeNotifications.drmContentCDMInstalling.message): NB: inserted via innerHTML, so please don't use <, > or & in this string. %S is brandShortName
 emeNotifications.drmContentCDMInstalling.message = %S is installing components needed to play the audio or video on this page. Please try again later.
 
 emeNotifications.unknownDRMSoftware = Unknown
 
 # LOCALIZATION NOTE - %S is brandShortName
 slowStartup.message = %S seems slow… to… start.
 slowStartup.helpButton.label = Learn How to Speed It Up