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

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

Issue 29329554: Issue 3208 - Send Private Browsing flag separately from the frame structure (Closed)
Patch Set: Fixed PrivateBrowsingUtils call Created Nov. 2, 2015, 6:52 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 | « no previous file | 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-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
(...skipping 17 matching lines...) Expand all
28 delete proto.Components; 28 delete proto.Components;
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 36
37 let {Utils} = require("utils"); 37 let {Utils} = require("utils");
38 let {getFrames} = require("child/utils"); 38 let {getFrames, isPrivate} = require("child/utils");
39 39
40 let messageID = 0; 40 let messageID = 0;
41 41
42 // The allowXBL binding below won't have any effect on the element. For elements 42 // The allowXBL binding below won't have any effect on the element. For elements
43 // that should be hidden however we don't return any binding at all, this makes 43 // that should be hidden however we don't return any binding at all, this makes
44 // Gecko stop constructing the node - it cannot be shown. 44 // Gecko stop constructing the node - it cannot be shown.
45 const allowXBL = "<bindings xmlns='http://www.mozilla.org/xbl'><binding id='dumm y' bindToUntrustedContent='true'/></bindings>"; 45 const allowXBL = "<bindings xmlns='http://www.mozilla.org/xbl'><binding id='dumm y' bindToUntrustedContent='true'/></bindings>";
46 const hideXBL = "<bindings xmlns='http://www.mozilla.org/xbl'/>"; 46 const hideXBL = "<bindings xmlns='http://www.mozilla.org/xbl'/>";
47 47
48 /** 48 /**
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 listener.onStartRequest(this, context); 145 listener.onStartRequest(this, context);
146 } catch(e) {} 146 } catch(e) {}
147 try { 147 try {
148 listener.onDataAvailable(this, context, stream, 0, stream.available()); 148 listener.onDataAvailable(this, context, stream, 0, stream.available());
149 } catch(e) {} 149 } catch(e) {}
150 try { 150 try {
151 listener.onStopRequest(this, context, Cr.NS_OK); 151 listener.onStopRequest(this, context, Cr.NS_OK);
152 } catch(e) {} 152 } catch(e) {}
153 }; 153 };
154 154
155 let window = Utils.getRequestWindow(this);
155 addMessageListener(responseMessage, processResponse); 156 addMessageListener(responseMessage, processResponse);
156 sendAsyncMessage("AdblockPlus:ElemHideHit", { 157 sendAsyncMessage("AdblockPlus:ElemHideHit", {
157 responseMessage, 158 responseMessage,
158 key: this.key, 159 key: this.key,
159 frames: getFrames(Utils.getRequestWindow(this)) 160 frames: getFrames(window),
161 isPrivate: isPrivate(window)
160 }); 162 });
161 }, 163 },
162 164
163 asyncOpen2: function(listener) 165 asyncOpen2: function(listener)
164 { 166 {
165 if (!this.loadInfo.triggeringPrincipal.equals(Utils.systemPrincipal)) 167 if (!this.loadInfo.triggeringPrincipal.equals(Utils.systemPrincipal))
166 throw Cr.NS_ERROR_FAILURE; 168 throw Cr.NS_ERROR_FAILURE;
167 this.asyncOpen(listener, null); 169 this.asyncOpen(listener, null);
168 }, 170 },
169 171
(...skipping 13 matching lines...) Expand all
183 { 185 {
184 throw Cr.NS_ERROR_NOT_IMPLEMENTED; 186 throw Cr.NS_ERROR_NOT_IMPLEMENTED;
185 }, 187 },
186 resume: function() 188 resume: function()
187 { 189 {
188 throw Cr.NS_ERROR_NOT_IMPLEMENTED; 190 throw Cr.NS_ERROR_NOT_IMPLEMENTED;
189 }, 191 },
190 192
191 QueryInterface: XPCOMUtils.generateQI([Ci.nsIChannel, Ci.nsIRequest]) 193 QueryInterface: XPCOMUtils.generateQI([Ci.nsIChannel, Ci.nsIRequest])
192 }; 194 };
OLDNEW
« no previous file with comments | « no previous file | lib/child/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld