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

Unified Diff: lib/filterListener.js

Issue 6337686776315904: Issue 394 - hit statistics tool data collection (Closed)
Patch Set: Created April 7, 2015, 3:15 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -28,6 +28,7 @@
let {defaultMatcher} = require("matcher");
let {ActiveFilter, RegExpFilter, ElemHideBase} = require("filterClasses");
let {Prefs} = require("prefs");
+let {FilterHits} = require("filterHits");
/**
* Value of the FilterListener.batchMode property.
@@ -74,7 +75,11 @@
else
isDirty += factor;
if (isDirty >= 1)
+ {
FilterStorage.saveToDisk();
+ if (Prefs.sendstats)
+ FilterHits.saveFilterHitsToDatabase();
+ }
}
};
@@ -89,6 +94,7 @@
if (topic == "browser:purge-session-history" && Prefs.clearStatsOnHistoryPurge)
{
FilterStorage.resetHitCounts();
+ FilterHits.resetFilterHits();
FilterListener.setDirty(0); // Force saving to disk
Prefs.recentReports = [];
« lib/filterHits.js ('K') | « lib/filterHits.js ('k') | lib/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld