Bug 1521671 - Port bug 1514340: Implement nsIWebProgressListener.onContentBlockingEvent(), JS part. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Tue, 22 Jan 2019 09:53:30 +0100
changeset 34269 f00434eba47a01e79c2ad037578b089a3b017572
parent 34268 995656d1fb108b518f5b3b7f38222fe05efd51c3
child 34270 2173bcabed6dce8c8d578b6aeb4cff4b3156eb4f
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersbustage-fix
bugs1521671, 1514340
Bug 1521671 - Port bug 1514340: Implement nsIWebProgressListener.onContentBlockingEvent(), JS part. rs=bustage-fix
calendar/providers/gdata/content/browserRequest.js
chat/content/browserRequest.js
chat/content/conversation-browser.js
editor/ui/composer/content/ComposerCommands.js
mail/base/content/browserRequest.js
mail/base/content/specialTabs.js
mail/base/content/tabmail.xml
mail/components/compose/content/MsgComposeCommands.js
mailnews/addrbook/prefs/content/pref-directory-add.js
mailnews/base/content/shutdownWindow.js
mailnews/compose/content/sendProgress.js
mailnews/compose/test/unit/head_compose.js
mailnews/compose/test/unit/test_temporaryFilesRemoved.js
mailnews/imap/test/unit/test_offlineDraftDataloss.js
mailnews/imap/test/unit/test_saveImapDraft.js
--- a/calendar/providers/gdata/content/browserRequest.js
+++ b/calendar/providers/gdata/content/browserRequest.js
@@ -65,17 +65,20 @@ var reporterListener = {
         if (level) {
             this.securityButton.setAttribute("level", level);
             this.securityButton.hidden = false;
         } else {
             this.securityButton.hidden = true;
             this.securityButton.removeAttribute("level");
         }
         this.securityButton.setAttribute("tooltiptext", browser.securityUI.tooltipText);
-    }
+    },
+
+    onContentBlockingEvent: function(aWebProgress, aRequest, aEvent) {
+    },
 };
 
 function cancelRequest() {
     reportUserClosed();
     window.close();
 }
 
 function reportUserClosed() {
--- a/chat/content/browserRequest.js
+++ b/chat/content/browserRequest.js
@@ -98,16 +98,20 @@ var reporterListener = {
       this.securityButton.hidden = false;
       this.securityLabel.setAttribute("label", browser.securityUI.tooltipText);
     } else {
       this.securityButton.hidden = true;
       this.securityButton.removeAttribute("level");
     }
     this.securityButton.setAttribute("tooltiptext",
                                      browser.securityUI.tooltipText);
+  },
+
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent)
+  {
   }
 }
 
 function cancelRequest()
 {
   reportUserClosed();
   window.close();
 }
--- a/chat/content/conversation-browser.js
+++ b/chat/content/conversation-browser.js
@@ -68,16 +68,17 @@ class MozConversationBrowser extends cus
 
         // Notify observers to get the conversation shown.
         Services.obs.notifyObservers(this, "conversation-loaded");
       },
       onProgressChange(progress, request, curSelf, maxSelf, curTotal, maxTotal) { },
       onLocationChange(aprogress, request, location) { },
       onStatusChange(progress, request, status, message) { },
       onSecurityChange(progress, request, state) { },
+      onContentBlockingEvent(progress, request, event) { },
       QueryInterface: ChromeUtils.generateQI([
         Ci.nsIWebProgressListener,
         Ci.nsISupportsWeakReference],
       ),
     };
 
     // Make sure to load URLs externally.
     this.addEventListener("click", (event) => {
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -1290,16 +1290,20 @@ var gEditorOutputProgressListener =
     {
       try {
         var channel = aRequest.QueryInterface(nsIChannel);
         dump("***** onSecurityChange request: " + channel.URI.spec + "\n");
       } catch (e) {}
     }
   },
 
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent)
+  {
+  },
+
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference",
                                           "nsIPrompt",
                                           "nsIAuthPrompt"]),
 
 // nsIPrompt
   alert : function(dlgTitle, text)
   {
--- a/mail/base/content/browserRequest.js
+++ b/mail/base/content/browserRequest.js
@@ -69,16 +69,19 @@ var reporterListener = {
       this.securityButton.hidden = false;
     } else {
       this.securityButton.hidden = true;
       this.securityButton.removeAttribute("level");
     }
     this.securityButton.setAttribute("tooltiptext",
                                      browser.securityUI.tooltipText);
   },
+
+  onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
+  },
 };
 
 function cancelRequest() {
   reportUserClosed();
   window.close();
 }
 
 function reportUserClosed() {
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -166,16 +166,18 @@ tabProgressListener.prototype = {
     if (level) {
       this.mTab.security.setAttribute("level", level);
       this.mTab.security.hidden = false;
     } else {
       this.mTab.security.hidden = true;
       this.mTab.security.removeAttribute("level");
     }
   },
+  onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
+  },
   onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) {
     if (this.mProgressListener)
       this.mProgressListener.onRefreshAttempted(aWebProgress, aURI, aDelay,
         aSameURI);
   },
   QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
                                           Ci.nsIWebProgressListener2,
                                           Ci.nsISupportsWeakReference]),
--- a/mail/base/content/tabmail.xml
+++ b/mail/base/content/tabmail.xml
@@ -1765,16 +1765,27 @@
         <parameter name="aState"/>
         <body><![CDATA[
           let browser = aWebProgress.QueryInterface(Ci.nsIDocShellTreeItem)
                                     .sameTypeRootTreeItem
                                     .chromeEventHandler;
           this._callTabListeners("onSecurityChange", [browser, ...arguments]);
         ]]></body>
       </method>
+      <method name="onContentBlockingEvent">
+        <parameter name="aWebProgress"/>
+        <parameter name="aRequest"/>
+        <parameter name="aEvent"/>
+        <body><![CDATA[
+          let browser = aWebProgress.QueryInterface(Ci.nsIDocShellTreeItem)
+                                    .sameTypeRootTreeItem
+                                    .chromeEventHandler;
+          this._callTabListeners("onContentBlockingEvent", [browser, ...arguments]);
+        ]]></body>
+      </method>
       <method name="onRefreshAttempted">
         <parameter name="aWebProgress"/>
         <parameter name="aURI"/>
         <parameter name="aDelay"/>
         <parameter name="aSameURI"/>
         <body><![CDATA[
           let browser = aWebProgress.QueryInterface(Ci.nsIDocShellTreeItem)
                                     .sameTypeRootTreeItem
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -591,16 +591,20 @@ var progressListener = {
         statusText.setAttribute("label", aMessage);
     } catch (ex) {}
   },
 
   onSecurityChange(aWebProgress, aRequest, state) {
     // we can ignore this notification
   },
 
+  onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
+    // we can ignore this notification
+  },
+
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 };
 
 var defaultController = {
   commands: {
     cmd_attachFile: {
       isEnabled() {
--- a/mailnews/addrbook/prefs/content/pref-directory-add.js
+++ b/mailnews/addrbook/prefs/content/pref-directory-add.js
@@ -113,16 +113,19 @@ var progressListener = {
   {
   },
   onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
   {
   },
   onSecurityChange: function(aWebProgress, aRequest, state)
   {
   },
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent)
+  {
+  },
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 };
 
 function DownloadNow()
 {
   if (!gDownloadInProgress) {
     gProgressText = document.getElementById("replicationProgressText");
--- a/mailnews/base/content/shutdownWindow.js
+++ b/mailnews/base/content/shutdownWindow.js
@@ -81,12 +81,17 @@ nsMsgShutdownTaskListener.prototype =
     if (aMessage)
       updateProgressLabel(aMessage);
   },
 
   onSecurityChange: function(aWebProgress, aRequest, state)
   {
     // we can ignore this notification
   }
+
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent)
+  {
+    // we can ignore this notification
+  },
 }
 
 var MsgShutdownTaskListener = new nsMsgShutdownTaskListener();
 
--- a/mailnews/compose/content/sendProgress.js
+++ b/mailnews/compose/content/sendProgress.js
@@ -80,16 +80,21 @@ var progressListener = {
         dialog.status.setAttribute("value", aMessage);
     },
 
     onSecurityChange: function(aWebProgress, aRequest, state)
     {
       // we can ignore this notification
     },
 
+    onContentBlockingEvent: function(aWebProgress, aRequest, aEvent)
+    {
+      // we can ignore this notification
+    },
+
     QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                             "nsISupportsWeakReference"]),
 };
 
 function onLoad()
 {
     // Set global variables.
     let subject = "";
--- a/mailnews/compose/test/unit/head_compose.js
+++ b/mailnews/compose/test/unit/head_compose.js
@@ -102,16 +102,17 @@ var progressListener = {
       this.resolve(mailTestUtils.firstMsgHdr(gDraftFolder));
   },
 
   onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress,
     aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
   onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {},
   onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {},
   onSecurityChange: function(aWebProgress, aRequest, state) {},
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent) {},
 
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 };
 
 function createMessage(aAttachment) {
   let fields = Cc["@mozilla.org/messengercompose/composefields;1"]
                  .createInstance(Ci.nsIMsgCompFields);
--- a/mailnews/compose/test/unit/test_temporaryFilesRemoved.js
+++ b/mailnews/compose/test/unit/test_temporaryFilesRemoved.js
@@ -16,16 +16,17 @@ var progressListener = {
     if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
       do_timeout(0, check_result);
   },
 
   onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
   onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {},
   onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {},
   onSecurityChange: function(aWebProgress, aRequest, state) {},
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent) {},
 
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 };
 
 function get_temporary_files_for(name) {
   let file = Services.dirsvc.get("TmpD", Ci.nsIFile);
   file.append(name);
--- a/mailnews/imap/test/unit/test_offlineDraftDataloss.js
+++ b/mailnews/imap/test/unit/test_offlineDraftDataloss.js
@@ -164,16 +164,17 @@ var progressListener = {
   },
 
   onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress,
                              aMaxSelfProgress, aCurTotalProgress,
                              aMaxTotalProgress) {},
   onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {},
   onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {},
   onSecurityChange: function(aWebProgress, aRequest, state) {},
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent) {},
 
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 };
 
 /*
  * helper functions
  */
--- a/mailnews/imap/test/unit/test_saveImapDraft.js
+++ b/mailnews/imap/test/unit/test_saveImapDraft.js
@@ -131,16 +131,17 @@ var progressListener = {
       async_driver();
     }
   },
 
   onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
   onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {},
   onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {},
   onSecurityChange: function(aWebProgress, aRequest, state) {},
+  onContentBlockingEvent: function(aWebProgress, aRequest, aEvent) {},
 
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 };
 
 /*
  * helper functions
  */