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

Delta Between Two Patch Sets: lib/elemHide.js

Issue 5229474392047616: Issue 2582 - Optimize loop in ElemHide.getSelectorsForDomain() for V8 (Closed)
Left Patch Set: Created May 24, 2015, 5:12 p.m.
Right Patch Set: Use Object.getOwnPropertyNames() Created June 3, 2015, 11:08 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 | no next file » | 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-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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 return (key in filterByKey ? filterByKey[key] : null); 371 return (key in filterByKey ? filterByKey[key] : null);
372 }, 372 },
373 373
374 /** 374 /**
375 * Returns a list of all selectors active on a particular domain (currently 375 * Returns a list of all selectors active on a particular domain (currently
376 * used only in Chrome, Opera and Safari). 376 * used only in Chrome, Opera and Safari).
377 */ 377 */
378 getSelectorsForDomain: function(/**String*/ domain, /**Boolean*/ specificOnly) 378 getSelectorsForDomain: function(/**String*/ domain, /**Boolean*/ specificOnly)
379 { 379 {
380 let result = []; 380 let result = [];
381 let keys = Object.keys(filterByKey); 381 let keys = Object.getOwnPropertyNames(filterByKey);
382 for (let key of keys) 382 for (let key of keys)
383 { 383 {
384 let filter = filterByKey[key]; 384 let filter = filterByKey[key];
385 if (specificOnly && (!filter.domains || filter.domains[""])) 385 if (specificOnly && (!filter.domains || filter.domains[""]))
386 continue; 386 continue;
387 387
388 if (filter.isActiveOnDomain(domain) && !this.getException(filter, domain)) 388 if (filter.isActiveOnDomain(domain) && !this.getException(filter, domain))
389 result.push(filter.selector); 389 result.push(filter.selector);
390 } 390 }
391 return result; 391 return result;
392 } 392 }
393 }; 393 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld