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

Delta Between Two Patch Sets: lib/requestNotifier.js

Issue 29329490: Issue 3222 - Use WeakMap to store data, remove bug 982561 work-around (Closed)
Left Patch Set: Created Oct. 29, 2015, 6:07 p.m.
Right Patch Set: Removed unnecessary Services.jsm import Created Oct. 29, 2015, 6:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 /** 18 /**
19 * @fileOverview Stores Adblock Plus data to be attached to a window. 19 * @fileOverview Stores Adblock Plus data to be attached to a window.
20 */ 20 */
21 21
22 Cu.import("resource://gre/modules/Services.jsm");
23
24 let {Utils} = require("utils"); 22 let {Utils} = require("utils");
25 let {BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, ElemHideExce ption} = require("filterClasses"); 23 let {BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter, ElemHideExce ption} = require("filterClasses");
26 24
27 let nodeData = new WeakMap(); 25 let nodeData = new WeakMap();
28 let windowStats = new WeakMap(); 26 let windowStats = new WeakMap();
29 let windowSelection = new WeakMap(); 27 let windowSelection = new WeakMap();
30 let requestEntryMaxId = 0; 28 let requestEntryMaxId = 0;
31 29
32 /** 30 /**
33 * List of notifiers in use - these notifiers need to receive notifications on 31 * List of notifiers in use - these notifiers need to receive notifications on
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 if (typeof existingData == "undefined") 329 if (typeof existingData == "undefined")
332 { 330 {
333 existingData = {}; 331 existingData = {};
334 nodeData.set(node, existingData); 332 nodeData.set(node, existingData);
335 } 333 }
336 334
337 // Add this request to the node data 335 // Add this request to the node data
338 existingData[this.type + " " + this.location] = this; 336 existingData[this.type + " " + this.location] = this;
339 } 337 }
340 }; 338 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld