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

Side by Side Diff: lib/main.js

Issue 29329895: Issue 3290 - Adblock Plus child modules don`t always start up (Closed)
Patch Set: Removed unnecessary statement Created Dec. 1, 2015, 7:12 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/child/bootstrap.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 18 matching lines...) Expand all
29 require("synchronizer"); 29 require("synchronizer");
30 require("notification"); 30 require("notification");
31 require("sync"); 31 require("sync");
32 require("messageResponder"); 32 require("messageResponder");
33 require("ui"); 33 require("ui");
34 require("objectTabs"); 34 require("objectTabs");
35 35
36 function bootstrapChildProcesses() 36 function bootstrapChildProcesses()
37 { 37 {
38 let info = require("info"); 38 let info = require("info");
39 let {Utils} = require("utils");
40 Utils.addChildMessageListener("AdblockPlus:GetInfo", () => info);
39 41
40 let processScript = info.addonRoot + "lib/child/bootstrap.js?" + Math.random() ; 42 let processScript = info.addonRoot + "lib/child/bootstrap.js?" + Math.random() ;
41 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"] 43 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"]
42 .getService(Ci.nsIProcessScriptLoader) 44 .getService(Ci.nsIProcessScriptLoader)
43 .QueryInterface(Ci.nsIMessageBroadcaster); 45 .QueryInterface(Ci.nsIMessageBroadcaster);
44 messageManager.loadProcessScript(processScript, true); 46 messageManager.loadProcessScript(processScript, true);
45 messageManager.broadcastAsyncMessage("AdblockPlus:Info", info);
46 47
47 onShutdown.add(() => { 48 onShutdown.add(() => {
48 messageManager.broadcastAsyncMessage("AdblockPlus:Shutdown", processScript); 49 messageManager.broadcastAsyncMessage("AdblockPlus:Shutdown", processScript);
49 messageManager.removeDelayedProcessScript(processScript); 50 messageManager.removeDelayedProcessScript(processScript);
50 }); 51 });
51 } 52 }
52 53
53 function registerPublicAPI() 54 function registerPublicAPI()
54 { 55 {
55 let {addonRoot} = require("info"); 56 let {addonRoot} = require("info");
(...skipping 17 matching lines...) Expand all
73 74
74 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); 75 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
75 registrar.registerFactory(classID, "Adblock Plus public API URL", contractID, factory); 76 registrar.registerFactory(classID, "Adblock Plus public API URL", contractID, factory);
76 77
77 onShutdown.add(function() 78 onShutdown.add(function()
78 { 79 {
79 registrar.unregisterFactory(classID, factory); 80 registrar.unregisterFactory(classID, factory);
80 Cu.unload(uri.spec); 81 Cu.unload(uri.spec);
81 }); 82 });
82 } 83 }
OLDNEW
« no previous file with comments | « lib/child/bootstrap.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld