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

Delta Between Two Patch Sets: lib/requestNotifier.js

Issue 5743717579227136: Get rid of Utils.threadManager (Closed)
Left Patch Set: Created March 13, 2014, 11:49 a.m.
Right Patch Set: Removed a line that is no longer in use Created March 13, 2014, 11:52 a.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 | « chrome/content/ui/sendReport.js ('k') | lib/utils.js » ('j') | 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 * running). 146 * running).
147 */ 147 */
148 eventsPosted: 0, 148 eventsPosted: 0,
149 149
150 /** 150 /**
151 * Starts the initial scan of the window (will recurse into frames). 151 * Starts the initial scan of the window (will recurse into frames).
152 * @param {Window} wnd the window to be scanned 152 * @param {Window} wnd the window to be scanned
153 */ 153 */
154 startScan: function(wnd) 154 startScan: function(wnd)
155 { 155 {
156 let currentThread = Services.tm.currentThread;
157
158 let doc = wnd.document; 156 let doc = wnd.document;
159 let walker = doc.createTreeWalker(doc, Ci.nsIDOMNodeFilter.SHOW_ELEMENT, nul l, false); 157 let walker = doc.createTreeWalker(doc, Ci.nsIDOMNodeFilter.SHOW_ELEMENT, nul l, false);
160 158
161 let process = function() 159 let process = function()
162 { 160 {
163 if (!this.listener) 161 if (!this.listener)
164 return; 162 return;
165 163
166 let node = walker.currentNode; 164 let node = walker.currentNode;
167 let data = getEntry(nodeData, node); 165 let data = getEntry(nodeData, node);
(...skipping 11 matching lines...) Expand all
179 177
180 this.eventsPosted--; 178 this.eventsPosted--;
181 if (!this.eventsPosted) 179 if (!this.eventsPosted)
182 { 180 {
183 this.scanComplete = true; 181 this.scanComplete = true;
184 this.notifyListener(wnd, null, null); 182 this.notifyListener(wnd, null, null);
185 } 183 }
186 } 184 }
187 }.bind(this); 185 }.bind(this);
188 186
189 // Process each node in a separate event on current thread to allow other 187 // Process each node in a separate event to allow other events to process
190 // events to process
191 this.eventsPosted++; 188 this.eventsPosted++;
192 Utils.runAsync(process); 189 Utils.runAsync(process);
193 } 190 }
194 }; 191 };
195 192
196 RequestNotifier.storeSelection = function(/**Window*/ wnd, /**String*/ selection ) 193 RequestNotifier.storeSelection = function(/**Window*/ wnd, /**String*/ selection )
197 { 194 {
198 setEntry(windowSelection, wnd.document, selection); 195 setEntry(windowSelection, wnd.document, selection);
199 }; 196 };
200 RequestNotifier.getSelection = function(/**Window*/ wnd) /**String*/ 197 RequestNotifier.getSelection = function(/**Window*/ wnd) /**String*/
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (typeof existingData == "undefined") 364 if (typeof existingData == "undefined")
368 { 365 {
369 existingData = {}; 366 existingData = {};
370 setEntry(nodeData, node, existingData); 367 setEntry(nodeData, node, existingData);
371 } 368 }
372 369
373 // Add this request to the node data 370 // Add this request to the node data
374 existingData[this.type + " " + this.location] = this; 371 existingData[this.type + " " + this.location] = this;
375 } 372 }
376 }; 373 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld