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

Side by Side Diff: lib/child/elemHide.js

Issue 29356087: Issue 4497 - Move Utils.getRequestWindow() into child/utils.js (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created Oct. 6, 2016, 12:18 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/child/contentPolicy.js ('k') | lib/child/utils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 18 matching lines...) Expand all
29 } 29 }
30 catch (e) 30 catch (e)
31 { 31 {
32 Cu.reportError(e); 32 Cu.reportError(e);
33 } 33 }
34 34
35 let {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); 35 let {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
36 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); 36 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
37 37
38 let {shouldAllowAsync} = require("child/contentPolicy"); 38 let {shouldAllowAsync} = require("child/contentPolicy");
39 let {getFrames, isPrivate} = require("child/utils"); 39 let {getFrames, isPrivate, getRequestWindow} = require("child/utils");
40 let {RequestNotifier} = require("child/requestNotifier"); 40 let {RequestNotifier} = require("child/requestNotifier");
41 let {port} = require("messaging"); 41 let {port} = require("messaging");
42 let {Utils} = require("utils"); 42 let {Utils} = require("utils");
43 43
44 const notImplemented = () => Cr.NS_ERROR_NOT_IMPLEMENTED; 44 const notImplemented = () => Cr.NS_ERROR_NOT_IMPLEMENTED;
45 45
46 /** 46 /**
47 * about: URL module used to count hits. 47 * about: URL module used to count hits.
48 * @class 48 * @class
49 */ 49 */
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 BaseChannel.call(this, uri, loadInfo); 261 BaseChannel.call(this, uri, loadInfo);
262 this.key = key; 262 this.key = key;
263 } 263 }
264 HitRegistrationChannel.prototype = { 264 HitRegistrationChannel.prototype = {
265 __proto__: BaseChannel.prototype, 265 __proto__: BaseChannel.prototype,
266 key: null, 266 key: null,
267 contentType: "text/xml", 267 contentType: "text/xml",
268 268
269 _getResponse: function() 269 _getResponse: function()
270 { 270 {
271 let window = Utils.getRequestWindow(this); 271 let window = getRequestWindow(this);
272 port.emitWithResponse("registerElemHideHit", { 272 port.emitWithResponse("registerElemHideHit", {
273 key: this.key, 273 key: this.key,
274 frames: getFrames(window), 274 frames: getFrames(window),
275 isPrivate: isPrivate(window) 275 isPrivate: isPrivate(window)
276 }).then(hit => 276 }).then(hit =>
277 { 277 {
278 if (hit) 278 if (hit)
279 RequestNotifier.addNodeData(window.document, window.top, hit); 279 RequestNotifier.addNodeData(window.document, window.top, hit);
280 }); 280 });
281 return "<bindings xmlns='http://www.mozilla.org/xbl'/>"; 281 return "<bindings xmlns='http://www.mozilla.org/xbl'/>";
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 else if (filter) 382 else if (filter)
383 { 383 {
384 RequestNotifier.addNodeData(window.document, window.top, { 384 RequestNotifier.addNodeData(window.document, window.top, {
385 contentType, docDomain, thirdParty, location, filter, filterType 385 contentType, docDomain, thirdParty, location, filter, filterType
386 }); 386 });
387 } 387 }
388 }); 388 });
389 } 389 }
390 }; 390 };
391 observer.init(); 391 observer.init();
OLDNEW
« no previous file with comments | « lib/child/contentPolicy.js ('k') | lib/child/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld