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

Unified Diff: lib/whitelisting.js

Issue 5464830253203456: Refactored the abstraction layer to address prerendered pages on Safari caused by leaky abstraction (Closed)
Patch Set: Addressed comments Created April 11, 2014, 2:47 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
« no previous file with comments | « lib/stats.js ('k') | metadata.chrome » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/whitelisting.js
===================================================================
--- a/lib/whitelisting.js
+++ b/lib/whitelisting.js
@@ -18,7 +18,7 @@
let {defaultMatcher} = require("matcher");
let {WhitelistFilter} = require("filterClasses");
-let tabsWithKeyException = new TabMap(true);
+let pagesWithKeyException = new ext.PageMap();
let isWhitelisted = exports.isWhitelisted = function(url, parentUrl, type)
{
@@ -32,9 +32,9 @@
return (filter instanceof WhitelistFilter ? filter : null);
};
-let isFrameWhitelisted = exports.isFrameWhitelisted = function(tab, frame, type)
+let isFrameWhitelisted = exports.isFrameWhitelisted = function(page, frame, type)
{
- let urlsWithKeyException = tabsWithKeyException.get(tab);
+ let urlsWithKeyException = pagesWithKeyException.get(page);
for (; frame != null; frame = frame.parent)
{
@@ -69,24 +69,24 @@
return verifySignature(key, signature, params.join("\0"));
};
-let recordKeyException = function(tab, url)
+let recordKeyException = function(page, url)
{
- let urlsWithKeyException = tabsWithKeyException.get(tab);
+ let urlsWithKeyException = pagesWithKeyException.get(page);
if (!urlsWithKeyException)
{
urlsWithKeyException = {__proto__: null};
- tabsWithKeyException.set(tab, urlsWithKeyException);
+ pagesWithKeyException.set(page, urlsWithKeyException);
}
urlsWithKeyException[url] = null;
};
-let processKeyException = exports.processKeyException = function(token, tab, frame)
+let processKeyException = exports.processKeyException = function(token, page, frame)
{
let url = stripFragmentFromURL(frame.url);
let docDomain = extractHostFromURL((frame.parent || frame).url);
if (verifyKeyException(token, url, docDomain))
- recordKeyException(tab, url);
+ recordKeyException(page, url);
};
« no previous file with comments | « lib/stats.js ('k') | metadata.chrome » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld