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

Side by Side Diff: messageResponder.js

Issue 29338002: Noissue - Remove redundant Filter.fromText() (Closed)
Patch Set: Created March 8, 2016, 8:53 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 | « no previous file | 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-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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (message.filter) 176 if (message.filter)
177 listenerFilters.app = message.filter; 177 listenerFilters.app = message.filter;
178 else 178 else
179 delete listenerFilters.app; 179 delete listenerFilters.app;
180 break; 180 break;
181 case "app.open": 181 case "app.open":
182 if (message.what == "options") 182 if (message.what == "options")
183 ext.showOptions(); 183 ext.showOptions();
184 break; 184 break;
185 case "filters.add": 185 case "filters.add":
186 var filter = Filter.fromText(message.text);
187 var result = require("filterValidation").parseFilter(message.text); 186 var result = require("filterValidation").parseFilter(message.text);
188 if (result.error) 187 if (result.error)
189 sendMessage("app", "error", [result.error.toString()], sender.page); 188 sendMessage("app", "error", [result.error.toString()], sender.page);
190 else if (result.filter) 189 else if (result.filter)
191 FilterStorage.addFilter(result.filter); 190 FilterStorage.addFilter(result.filter);
192 break; 191 break;
193 case "filters.blocked": 192 case "filters.blocked":
194 var filter = defaultMatcher.matchesAny(message.url, message.requestType, 193 var filter = defaultMatcher.matchesAny(message.url, message.requestType,
195 message.docDomain, message.thirdParty); 194 message.docDomain, message.thirdParty);
196 callback(filter instanceof BlockingFilter); 195 callback(filter instanceof BlockingFilter);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (subscription instanceof DownloadableSubscription) 362 if (subscription instanceof DownloadableSubscription)
364 Synchronizer.execute(subscription, true); 363 Synchronizer.execute(subscription, true);
365 } 364 }
366 break; 365 break;
367 case "subscriptions.isDownloading": 366 case "subscriptions.isDownloading":
368 callback(Synchronizer.isExecuting(message.url)); 367 callback(Synchronizer.isExecuting(message.url));
369 break; 368 break;
370 } 369 }
371 }); 370 });
372 })(this); 371 })(this);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld