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

Side by Side Diff: lib/filterStorage.js

Issue 5373553692114944: Issue #430 - Filter hit counters aren't cleared (Closed)
Patch Set: Created June 9, 2014, 11:21 a.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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 { 348 {
349 filters = []; 349 filters = [];
350 for (let text in Filter.knownFilters) 350 for (let text in Filter.knownFilters)
351 filters.push(Filter.knownFilters[text]); 351 filters.push(Filter.knownFilters[text]);
352 } 352 }
353 for (let filter of filters) 353 for (let filter of filters)
354 { 354 {
355 filter.hitCount = 0; 355 filter.hitCount = 0;
356 filter.lastHit = 0; 356 filter.lastHit = 0;
357 } 357 }
358 let {FilterListener} = require("filterListener");
saroyanm 2014/06/09 11:28:02 Called FilterListener module inside of the functio
Wladimir Palant 2014/06/12 11:58:38 Actually, hardcoding this logic here doesn't seem
saroyanm 2014/06/12 16:56:02 Thanks for idea. Done.
359 FilterListener.setDirty(0);
358 }, 360 },
359 361
360 _loading: false, 362 _loading: false,
361 363
362 /** 364 /**
363 * Loads all subscriptions from the disk 365 * Loads all subscriptions from the disk
364 * @param {nsIFile} [sourceFile] File to read from 366 * @param {nsIFile} [sourceFile] File to read from
365 */ 367 */
366 loadFromDisk: function(sourceFile) 368 loadFromDisk: function(sourceFile)
367 { 369 {
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 Subscription.knownSubscriptions = origKnownSubscriptions; 890 Subscription.knownSubscriptions = origKnownSubscriptions;
889 } 891 }
890 892
891 // Allow events to be processed every now and then. 893 // Allow events to be processed every now and then.
892 // Note: IO.readFromFile() will deal with the potential reentrance here. 894 // Note: IO.readFromFile() will deal with the potential reentrance here.
893 this.linesProcessed++; 895 this.linesProcessed++;
894 if (this.linesProcessed % 1000 == 0) 896 if (this.linesProcessed % 1000 == 0)
895 Utils.yield(); 897 Utils.yield();
896 } 898 }
897 }; 899 };
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