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

Unified Diff: lib/requestNotifier.js

Issue 5681038109966336: issue #362 - firefox: block image broken on youtube thumbnails (recommended videos) (Closed)
Patch Set: Created Aug. 17, 2014, 2:11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/requestNotifier.js
===================================================================
--- a/lib/requestNotifier.js
+++ b/lib/requestNotifier.js
@@ -27,6 +27,7 @@
let nodeData = new WeakMap();
let windowStats = new WeakMap();
let windowSelection = new WeakMap();
+let requestEntryMaxId = 0;
let setEntry, hasEntry, getEntry;
// Last issue(Bug 982561) preventing us from using WeakMap fixed for FF version 32
@@ -244,16 +245,19 @@
let data = getEntry(nodeData, node);
if (typeof data != "undefined")
{
+ let entry = null;
// Look for matching entry
for (let k in data)
{
- let entry = data[k];
- if ((typeof type == "undefined" || entry.type == type) &&
- (typeof location == "undefined" || entry.location == location))
+ if ((!entry || entry.id < data[k].id) &&
+ (typeof type == "undefined" || data[k].type == type) &&
+ (typeof location == "undefined" || data[k].location == location))
{
- return [node, entry];
+ entry = data[k];
}
}
+ if (entry)
+ return [node, entry];
}
// If we don't have any match on this node then maybe its parent will do
@@ -278,6 +282,7 @@
this.thirdParty = thirdParty;
this.location = location;
this.filter = filter;
+ this.id = ++requestEntryMaxId;
this.attachToNode(node);
@@ -319,6 +324,11 @@
RequestEntry.prototype =
{
/**
+ * id of request (used to determine last entry attached to a node)
+ * @type integer
+ */
+ id: 0,
+ /**
* Content type of the request (one of the nsIContentPolicy constants)
* @type Integer
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld