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

Side by Side Diff: lib/filterStorage.js

Issue 6612223174639616: Issue 1602 - Use ES6 generators instead of legacy generators (Closed)
Patch Set: Created March 31, 2015, 6:24 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 | « lib/elemHide.js ('k') | lib/io.js » ('j') | 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-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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 readFile(sourceFile, 0); 469 readFile(sourceFile, 0);
470 }.bind(this); 470 }.bind(this);
471 471
472 if (sourceFile) 472 if (sourceFile)
473 IO.statFile(sourceFile, callback); 473 IO.statFile(sourceFile, callback);
474 else 474 else
475 callback(true); 475 callback(true);
476 } 476 }
477 }, 477 },
478 478
479 _generateFilterData: function(subscriptions) 479 _generateFilterData: function*(subscriptions)
480 { 480 {
481 yield "# Adblock Plus preferences"; 481 yield "# Adblock Plus preferences";
482 yield "version=" + formatVersion; 482 yield "version=" + formatVersion;
483 483
484 let saved = Object.create(null); 484 let saved = Object.create(null);
485 let buf = []; 485 let buf = [];
486 486
487 // Save filter data 487 // Save filter data
488 for (let i = 0; i < subscriptions.length; i++) 488 for (let i = 0; i < subscriptions.length; i++)
489 { 489 {
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 Subscription.knownSubscriptions = origKnownSubscriptions; 863 Subscription.knownSubscriptions = origKnownSubscriptions;
864 } 864 }
865 865
866 // Allow events to be processed every now and then. 866 // Allow events to be processed every now and then.
867 // Note: IO.readFromFile() will deal with the potential reentrance here. 867 // Note: IO.readFromFile() will deal with the potential reentrance here.
868 this.linesProcessed++; 868 this.linesProcessed++;
869 if (this.linesProcessed % 1000 == 0) 869 if (this.linesProcessed % 1000 == 0)
870 Utils.yield(); 870 Utils.yield();
871 } 871 }
872 }; 872 };
OLDNEW
« no previous file with comments | « lib/elemHide.js ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld