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

Unified Diff: lib/requestNotifier.js

Issue 29329450: Issue 3208 - Don`t use numerical content types outside nsIContentPolicy.shouldLoad (Closed)
Patch Set: Created Oct. 28, 2015, 2:42 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/objectTabs.js ('k') | lib/ui.js » ('j') | 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
@@ -204,23 +204,23 @@ RequestNotifier.getSelection = function(
else
return null;
};
/**
* Attaches request data to a DOM node.
* @param {Node} node node to attach data to
* @param {Window} topWnd top-level window the node belongs to
- * @param {Integer} contentType request type, one of the Policy.type.* constants
+ * @param {String} contentType request type, e.g. "IMAGE"
* @param {String} docDomain domain of the document that initiated the request
* @param {Boolean} thirdParty will be true if a third-party server has been requested
* @param {String} location the address that has been requested
* @param {Filter} filter filter applied to the request or null if none
*/
-RequestNotifier.addNodeData = function(/**Node*/ node, /**Window*/ topWnd, /**Integer*/ contentType, /**String*/ docDomain, /**Boolean*/ thirdParty, /**String*/ location, /**Filter*/ filter)
+RequestNotifier.addNodeData = function(/**Node*/ node, /**Window*/ topWnd, /**String*/ contentType, /**String*/ docDomain, /**Boolean*/ thirdParty, /**String*/ location, /**Filter*/ filter)
{
return new RequestEntry(node, topWnd, contentType, docDomain, thirdParty, location, filter);
}
/**
* Retrieves the statistics for a window.
* @result {Object} Object with the properties items, blocked, whitelisted, hidden, filters containing statistics for the window (might be null)
*/
@@ -327,18 +327,18 @@ function RequestEntry(node, topWnd, cont
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
+ * Content type of the request, e.g. "IMAGE"
+ * @type String
*/
type: null,
/**
* Domain name of the requesting document
* @type String
*/
docDomain: null,
/**
@@ -357,25 +357,25 @@ RequestEntry.prototype =
*/
filter: null,
/**
* String representation of the content type, e.g. "subdocument"
* @type String
*/
get typeDescr()
{
- return require("contentPolicy").Policy.typeDescr[this.type];
+ return this.type;
},
/**
* User-visible localized representation of the content type, e.g. "frame"
* @type String
*/
get localizedDescr()
{
- return require("contentPolicy").Policy.localizedDescr[this.type];
+ return require("contentPolicy").Policy.localizedDescr.get(this.type);
},
/**
* Attaches this request object to a DOM node.
*/
attachToNode: function(/**Node*/ node)
{
let existingData = getEntry(nodeData, node);
« no previous file with comments | « lib/objectTabs.js ('k') | lib/ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld