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

Side by Side Diff: lib/filterStorage.js

Issue 6304089612746752: Issue 196 - Filters added on first-run are being removed immediately (Closed)
Patch Set: Created March 26, 2014, 12:58 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 let callback = function(e, statData) 466 let callback = function(e, statData)
467 { 467 {
468 if (e || !statData.exists) 468 if (e || !statData.exists)
469 { 469 {
470 this.firstRun = true; 470 this.firstRun = true;
471 this._loading = false; 471 this._loading = false;
472 FilterNotifier.triggerListeners("load"); 472 FilterNotifier.triggerListeners("load");
473 473
474 TimeLine.leave("FilterStorage.loadFromDisk() read callback done"); 474 TimeLine.leave("FilterStorage.loadFromDisk() read callback done");
475 } 475 }
476 readFile(sourceFile, 0); 476 else
477 readFile(sourceFile, 0);
477 } 478 }
478 479
479 if (sourceFile) 480 if (sourceFile)
480 IO.statFile(sourceFile, callback); 481 IO.statFile(sourceFile, callback);
481 else 482 else
482 callback(true); 483 callback(true);
483 } 484 }
484 485
485 TimeLine.leave("FilterStorage.loadFromDisk() done"); 486 TimeLine.leave("FilterStorage.loadFromDisk() done");
486 }, 487 },
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 Subscription.knownSubscriptions = origKnownSubscriptions; 885 Subscription.knownSubscriptions = origKnownSubscriptions;
885 } 886 }
886 887
887 // Allow events to be processed every now and then. 888 // Allow events to be processed every now and then.
888 // Note: IO.readFromFile() will deal with the potential reentrance here. 889 // Note: IO.readFromFile() will deal with the potential reentrance here.
889 this.linesProcessed++; 890 this.linesProcessed++;
890 if (this.linesProcessed % 1000 == 0) 891 if (this.linesProcessed % 1000 == 0)
891 Utils.yield(); 892 Utils.yield();
892 } 893 }
893 }; 894 };
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