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

Delta Between Two Patch Sets: lib/main.js

Issue 29338425: Issue 3499 - Remove old messaging API (Closed)
Left Patch Set: Created March 16, 2016, 12:33 p.m.
Right Patch Set: Use URLSearchParams Created March 23, 2016, 3:26 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 20 matching lines...) Expand all
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 39
40 let processScript = info.addonRoot + "lib/child/bootstrap.js?" + 40 let processScript = info.addonRoot + "lib/child/bootstrap.js?" +
41 Math.random() + "#" + encodeURIComponent(JSON.stringify(info)); 41 Math.random() + "&info=" + encodeURIComponent(JSON.stringify(info));
Thomas Greiner 2016/03/23 14:09:20 That looks a bit hacky and not easily extensible.
Wladimir Palant 2016/03/23 15:29:33 I don't think extensibility matters here. I've imp
42 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"] 42 let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"]
43 .getService(Ci.nsIProcessScriptLoader) 43 .getService(Ci.nsIProcessScriptLoader)
44 .QueryInterface(Ci.nsIMessageBroadcaster); 44 .QueryInterface(Ci.nsIMessageBroadcaster);
45 messageManager.loadProcessScript(processScript, true); 45 messageManager.loadProcessScript(processScript, true);
46 46
47 onShutdown.add(() => { 47 onShutdown.add(() => {
48 messageManager.broadcastAsyncMessage("AdblockPlus:Shutdown", processScript); 48 messageManager.broadcastAsyncMessage("AdblockPlus:Shutdown", processScript);
49 messageManager.removeDelayedProcessScript(processScript); 49 messageManager.removeDelayedProcessScript(processScript);
50 }); 50 });
51 } 51 }
(...skipping 21 matching lines...) Expand all
73 73
74 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); 74 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
75 registrar.registerFactory(classID, "Adblock Plus public API URL", contractID, factory); 75 registrar.registerFactory(classID, "Adblock Plus public API URL", contractID, factory);
76 76
77 onShutdown.add(function() 77 onShutdown.add(function()
78 { 78 {
79 registrar.unregisterFactory(classID, factory); 79 registrar.unregisterFactory(classID, factory);
80 Cu.unload(uri.spec); 80 Cu.unload(uri.spec);
81 }); 81 });
82 } 82 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld