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

Unified Diff: lib/stats.js

Issue 16067002: Added Safari Support (Closed)
Patch Set: Addressed comments Created Nov. 12, 2013, 10:28 a.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
« background.js ('K') | « include.preload.js ('k') | lib/utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/stats.js
===================================================================
--- a/lib/stats.js
+++ b/lib/stats.js
@@ -29,18 +29,16 @@
* @param {Number} tabId tab ID (leave undefined for total stats)
* @return {Number} field value
*/
-let getStats = exports.getStats = function getStats(key, tabId)
+let getStats = exports.getStats = function getStats(key, tab)
{
- if (tabId)
- {
- let frameData = getFrameData(tabId, 0);
- return (frameData && key in frameData ? frameData[key] : 0);
- }
- else
+ if (!tab)
return (key in Prefs.stats_total ? Prefs.stats_total[key] : 0);
+
+ let frameData = getFrameData(tab, 0);
+ return (frameData && key in frameData ? frameData[key] : 0);
};
-FilterNotifier.addListener(function(action, item, newValue, oldValue, tabId)
+FilterNotifier.addListener(function(action, item, newValue, oldValue, tab)
{
if (action != "filter.hitCount")
return;
@@ -56,7 +54,7 @@
Prefs.stats_total.blocked = 1;
Prefs.stats_total = Prefs.stats_total;
- let frameData = getFrameData(tabId, 0);
+ let frameData = getFrameData(tab, 0);
if (frameData)
{
if ("blocked" in frameData)
« background.js ('K') | « include.preload.js ('k') | lib/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld