| Index: lib/requestNotifier.js |
| =================================================================== |
| --- a/lib/requestNotifier.js |
| +++ b/lib/requestNotifier.js |
| @@ -24,44 +24,45 @@ Cu.import("resource://gre/modules/Servic |
| let {Utils} = require("utils"); |
| let {BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, ElemHideException} = require("filterClasses"); |
| let nodeData = new WeakMap(); |
| let windowStats = new WeakMap(); |
| let windowSelection = new WeakMap(); |
| let setEntry, hasEntry, getEntry; |
| -if (Services.vc.compare(Utils.platformVersion, "13.0") >= 0) |
| +if (false) |
| { |
| - // Bug 673468 is fixed, we can use weak maps |
| + // This branch can be enabled again once both bug 673468 and bug 819131 are |
| + // fixed and we can use weak maps |
| setEntry = function(map, key, value) map.set(key, value); |
| hasEntry = function(map, key) map.has(key); |
| getEntry = function(map, key) map.get(key); |
| } |
| else |
| { |
| // Fall back to user data |
| let dataSeed = Math.random(); |
| let nodeDataProp = "abpNodeData" + dataSeed; |
| let windowStatsProp = "abpWindowStats" + dataSeed; |
| let windowSelectionProp = "abpWindowSelection" + dataSeed; |
| - function getProp(map) |
| + let getProp = function(map) |
|
Wladimir Palant
2013/01/23 14:48:33
Please ignore this change, it's from a different c
|
| { |
| switch (map) |
| { |
| case nodeData: |
| return nodeDataProp; |
| case windowStats: |
| return windowStatsProp; |
| case windowSelection: |
| return windowSelectionProp; |
| default: |
| return null; |
| } |
| - } |
| + }; |
| setEntry = function(map, key, value) key.setUserData(getProp(map), value, null); |
| hasEntry = function(map, key) key.getUserData(getProp(map)); |
| getEntry = function(map, key) key.getUserData(getProp(map)) || undefined; |
| } |
| /** |
| * List of notifiers in use - these notifiers need to receive notifications on |