[Pkg-mozext-commits] [adblock-plus] 19/98: Issue 4221 - Only forward one elemhideupdate message per update batch to the content process

David Prévot taffit at moszumanska.debian.org
Tue Oct 24 01:30:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit f55be57eb2f198fc5ca228fb0e3cc08e2948900b
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Mon Jul 4 14:16:44 2016 +0200

    Issue 4221 - Only forward one elemhideupdate message per update batch to the content process
---
 lib/elemHideFF.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/elemHideFF.js b/lib/elemHideFF.js
index 692379a..fc8da1f 100644
--- a/lib/elemHideFF.js
+++ b/lib/elemHideFF.js
@@ -23,8 +23,21 @@ let {FilterNotifier} = require("filterNotifier");
 let {FilterStorage} = require("filterStorage");
 let {Prefs} = require("prefs");
 let {Policy} = require("contentPolicy");
+let {Utils} = require("utils");
 
-FilterNotifier.on("elemhideupdate", () => port.emit("elemhideupdate"));
+let isDirty = false;
+FilterNotifier.on("elemhideupdate", () =>
+{
+  // Notify content process asynchronously, only one message per update batch.
+  if (!isDirty)
+  {
+    isDirty = true;
+    Utils.runAsync(() => {
+      isDirty = false;
+      port.emit("elemhideupdate")
+    });
+  }
+});
 
 port.on("getSelectors", () => ElemHide.getSelectors());
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list