Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/child/main.js

Issue 29340653: Issue 3958 - Fixed initialization race condition when Adblock Plus is updated (Closed)
Patch Set: Created April 20, 2016, 1:58 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/child/main.js
===================================================================
--- a/lib/child/main.js
+++ b/lib/child/main.js
@@ -10,14 +10,22 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-require("child/elemHide");
-require("child/contentPolicy");
-require("child/contextMenu");
-require("child/dataCollector");
-require("child/cssProperties");
-require("child/subscribeLinks");
+let {port} = require("messaging");
+
+// Only initialize after receiving a "response" to a dummy message - this makes
+// sure that on update the old version has enough time to receive and process
+// the shutdown message.
+port.emitWithResponse("ping").then(() =>
Thomas Greiner 2016/04/20 14:38:35 Where is the code that responds to the "ping" even
Wladimir Palant 2016/04/20 14:41:40 There is none, we don't need a response. Or, if yo
+{
+ require("child/elemHide");
+ require("child/contentPolicy");
+ require("child/contextMenu");
+ require("child/dataCollector");
+ require("child/cssProperties");
+ require("child/subscribeLinks");
+});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld