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

Side by Side Diff: lib/child/bootstrap.js

Issue 29338275: Issue 3499 - Create a clean messaging API for internal use (Closed)
Patch Set: Fixed copyright year Created March 16, 2016, 11:04 a.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 | « no previous file | lib/messaging.js » ('j') | lib/messaging.js » ('J')
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-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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 loader = Loader({ 81 loader = Loader({
82 paths: { 82 paths: {
83 "": info.addonRoot + "lib/" 83 "": info.addonRoot + "lib/"
84 }, 84 },
85 globals: { 85 globals: {
86 Components, Cc, Ci, Cu, Cr, atob, btoa, onShutdown, 86 Components, Cc, Ci, Cu, Cr, atob, btoa, onShutdown,
87 addMessageListener, removeMessageListener, 87 addMessageListener, removeMessageListener,
88 sendAsyncMessage: sendAsyncMessageWithResponse, 88 sendAsyncMessage: sendAsyncMessageWithResponse,
89 sendSyncMessage: sendSyncMessageSingleResponse 89 sendSyncMessage: sendSyncMessageSingleResponse
90 }, 90 },
91 modules: {"info": info}, 91 modules: {"info": info, "messageManager": this},
92 id: info.addonID 92 id: info.addonID
93 }); 93 });
94 onShutdown.add(() => unload(loader, "disable")) 94 onShutdown.add(() => unload(loader, "disable"))
95 95
96 main(loader, "child/main"); 96 main(loader, "child/main");
97 } 97 }
98 98
99 function shutdown(message) 99 function shutdown(message)
100 { 100 {
101 if (message.data == Components.stack.filename) 101 if (message.data == Components.stack.filename)
(...skipping 15 matching lines...) Expand all
117 } 117 }
118 118
119 sendAsyncMessageWithResponse("AdblockPlus:GetInfo", null, init); 119 sendAsyncMessageWithResponse("AdblockPlus:GetInfo", null, init);
120 addMessageListener("AdblockPlus:Response", onResponse); 120 addMessageListener("AdblockPlus:Response", onResponse);
121 addMessageListener("AdblockPlus:Shutdown", shutdown); 121 addMessageListener("AdblockPlus:Shutdown", shutdown);
122 onShutdown.add(() => { 122 onShutdown.add(() => {
123 removeMessageListener("AdblockPlus:Response", onResponse); 123 removeMessageListener("AdblockPlus:Response", onResponse);
124 removeMessageListener("AdblockPlus:Shutdown", shutdown); 124 removeMessageListener("AdblockPlus:Shutdown", shutdown);
125 }); 125 });
126 })(); 126 })();
OLDNEW
« no previous file with comments | « no previous file | lib/messaging.js » ('j') | lib/messaging.js » ('J')

Powered by Google App Engine
This is Rietveld