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

Delta Between Two Patch Sets: adblockplus/Api.jsm

Issue 29588596: Issue 5919 - Adjust our code to the new messaging system (Closed)
Left Patch Set: Removing Log statement Created Oct. 25, 2017, 11:43 a.m.
Right Patch Set: Adding missing return statements Created Nov. 2, 2017, 10:12 a.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
« no previous file with change/comment | « no previous file | mobile/android/thirdparty/org/adblockplus/browser/AbpCheckBoxPreference.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 }, 225 },
226 initCommunication: function() 226 initCommunication: function()
227 { 227 {
228 initFilterListeners(); 228 initFilterListeners();
229 229
230 EventDispatcher.instance.registerListener((event, data, callback) => 230 EventDispatcher.instance.registerListener((event, data, callback) =>
231 { 231 {
232 if (!data) 232 if (!data)
233 { 233 {
234 callback.onError("malformed request"); 234 callback.onError("malformed request");
anton 2017/10/30 13:16:55 should not `return` be added here?
diegocarloslima 2017/10/30 13:40:11 Acknowledged.
235 return;
235 } 236 }
236 237
237 if (!this.filtersLoaded) 238 if (!this.filtersLoaded)
238 { 239 {
239 callback.onError("filters not loaded"); 240 callback.onError("filters not loaded");
anton 2017/10/30 13:16:55 should not `return` be added here?
diegocarloslima 2017/10/30 13:40:11 Acknowledged.
241 return;
240 } 242 }
241 243
242 switch (data["action"]) 244 switch (data["action"])
243 { 245 {
244 case "getAdblockPlusEnabled": 246 case "getAdblockPlusEnabled":
245 callback.onSuccess({"value": this.adblockPlusEnabled}); 247 callback.onSuccess({"value": this.adblockPlusEnabled});
246 return; 248 return;
247 case "setAdblockPlusEnabled": 249 case "setAdblockPlusEnabled":
248 if ("enable" in data) 250 if ("enable" in data)
249 { 251 {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 this.whitelistSite(data["url"], data["whitelisted"]); 314 this.whitelistSite(data["url"], data["whitelisted"]);
313 callback.onSuccess({}); 315 callback.onSuccess({});
314 return; 316 return;
315 } 317 }
316 break; 318 break;
317 } 319 }
318 callback.onError("malformed request"); 320 callback.onError("malformed request");
319 }, "AdblockPlus:Api"); 321 }, "AdblockPlus:Api");
320 } 322 }
321 }; 323 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld