| OLD | NEW |
| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 else | 476 else |
| 477 readFile(sourceFile, 0); | 477 readFile(sourceFile, 0); |
| 478 } | 478 }.bind(this); |
| 479 | 479 |
| 480 if (sourceFile) | 480 if (sourceFile) |
| 481 IO.statFile(sourceFile, callback); | 481 IO.statFile(sourceFile, callback); |
| 482 else | 482 else |
| 483 callback(true); | 483 callback(true); |
| 484 } | 484 } |
| 485 | 485 |
| 486 TimeLine.leave("FilterStorage.loadFromDisk() done"); | 486 TimeLine.leave("FilterStorage.loadFromDisk() done"); |
| 487 }, | 487 }, |
| 488 | 488 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 Subscription.knownSubscriptions = origKnownSubscriptions; | 885 Subscription.knownSubscriptions = origKnownSubscriptions; |
| 886 } | 886 } |
| 887 | 887 |
| 888 // Allow events to be processed every now and then. | 888 // Allow events to be processed every now and then. |
| 889 // Note: IO.readFromFile() will deal with the potential reentrance here. | 889 // Note: IO.readFromFile() will deal with the potential reentrance here. |
| 890 this.linesProcessed++; | 890 this.linesProcessed++; |
| 891 if (this.linesProcessed % 1000 == 0) | 891 if (this.linesProcessed % 1000 == 0) |
| 892 Utils.yield(); | 892 Utils.yield(); |
| 893 } | 893 } |
| 894 }; | 894 }; |
| OLD | NEW |