Closed
Bug 788275
Opened 12 years ago
Closed 12 years ago
Tab preview should respect the private browsing mode when attempting to load a favicon
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: jdm, Assigned: ehsan.akhgari)
References
Details
Attachments
(3 files, 2 obsolete files)
7.99 KB,
patch
|
jduell.mcbugs
:
review+
|
Details | Diff | Splinter Review |
3.93 KB,
patch
|
Details | Diff | Splinter Review | |
20.19 KB,
patch
|
Details | Diff | Splinter Review |
Besides being generally inefficient compared to the favicon cache we have, this interacts badly with things like private browsing (the favicons will be cached in the disk cached even for private windows, which is an information leak).
Reporter | ||
Comment 1•12 years ago
|
||
http://mxr.mozilla.org/mozilla-central/source/browser/modules/WindowsPreviewPerTab.jsm#76 (_imageFromURI) for reference.
Assignee | ||
Updated•12 years ago
|
Assignee | ||
Comment 2•12 years ago
|
||
While it would be a good thing to make this use the async favicon loading API, that is outside my scope of interest. I just need the correct private flag to be passed to the network channel (and that patch would be half of fixing the original bug, the other half being delivering the page URI to the call site), so I'll write the PB specific patch instead.
Summary: Tab preview should go through the Places favicon service instead of creating a channel by hand → Tab preview should respect the private browsing mode when attempting to load a favicon
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #659029 -
Flags: review?(josh)
Reporter | ||
Comment 4•12 years ago
|
||
Comment on attachment 659029 [details] [diff] [review] Patch (v1) Review of attachment 659029 [details] [diff] [review]: ----------------------------------------------------------------- Looks ok to me.
Attachment #659029 -
Flags: review?(josh)
Attachment #659029 -
Flags: review?(jmathies)
Attachment #659029 -
Flags: feedback+
Updated•12 years ago
|
Attachment #659029 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 5•12 years ago
|
||
Updated to use the new API and landed: https://hg.mozilla.org/integration/mozilla-inbound/rev/6571e0aef937
Target Milestone: --- → mozilla18
Assignee | ||
Comment 6•12 years ago
|
||
Backed out because of test failures: https://hg.mozilla.org/integration/mozilla-inbound/rev/427ca4f66d83
Assignee | ||
Comment 7•12 years ago
|
||
Hmm, I don't know why I did not come across this before. NetUtils.asyncFetch sets the notification callbacks before calling asyncOpen <http://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/NetUtil.jsm#160>, which is unfortunate since that does not give us an obvious point at which we can call setPrivate. Here are the solutions I can think of: 1. Modify asyncFetch to add a third optional parameter to it which tells it to call setPrivate before calling asyncOpen (and after setting the notification callbacks on the socket). 2. Modify CanSetCallbacks and CanSetLoadGroup to make them accept pointers to the arguments of their callers, and do the dance of ensuring that the set callback/loadgroup does not provide an nsILoadContext* if asked for. Jason, which one of these solutions do you prefer? I slightly favor the second solution, but don't have a strong opinion either way.
Comment 8•12 years ago
|
||
I think #2 is better too. Make sure to update comments to reflect the change in semantics.
Assignee | ||
Comment 9•12 years ago
|
||
Attachment #661948 -
Flags: review?(jduell.mcbugs)
Assignee | ||
Comment 10•12 years ago
|
||
This patch hits this nasty bug where the ctor of nsCORSListenerProxy passes |this| to the SetNotificationCallbacks method, which now does an AddRef/Release on the passed in argument, which causes the object to get destroyed immediately after it was created. I'll fix that by adding an Init methot to the class.
Assignee | ||
Comment 11•12 years ago
|
||
Attachment #661965 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 12•12 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=3fd800a23941
Assignee | ||
Comment 13•12 years ago
|
||
Attachment #659029 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #662152 -
Attachment description: Part 3 → Part 2
Assignee | ||
Comment 14•12 years ago
|
||
I ended up pushing the old version of part 2 to try. Here's a correct push: https://tbpl.mozilla.org/?tree=Try&rev=e8f96ff375ec
Assignee | ||
Comment 15•12 years ago
|
||
(In reply to Ehsan Akhgari [:ehsan] from comment #14) > I ended up pushing the old version of part 2 to try. Here's a correct push: > https://tbpl.mozilla.org/?tree=Try&rev=e8f96ff375ec And, I ended up pushing that on top of bustage :( https://tbpl.mozilla.org/?tree=Try&rev=1a7c97a404e1
Comment 16•12 years ago
|
||
Try run for e8f96ff375ec is complete. Detailed breakdown of the results available here: https://tbpl.mozilla.org/?tree=Try&rev=e8f96ff375ec Results (out of 2 total builds): exception: 2 Builds (or logs if builds failed) available at: http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/eakhgari@mozilla.com-e8f96ff375ec
Comment 17•12 years ago
|
||
Comment on attachment 661965 [details] [diff] [review] Part 0 >@@ -1086,22 +1054,23 @@ NS_StartCORSPreflight(nsIChannel* aReque >+ preflightListener = static_cast<nsIStreamListener*>(corsListener); You shouldn't need the cast here... Why is it needed? >+++ b/content/base/src/nsScriptLoader.cpp >+ listener = static_cast<nsIStreamListener*>(corsListener); Or here. And elsewhere in this patch. r=me
Attachment #661965 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 18•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #17) > Comment on attachment 661965 [details] [diff] [review] > Part 0 > > >@@ -1086,22 +1054,23 @@ NS_StartCORSPreflight(nsIChannel* aReque > >+ preflightListener = static_cast<nsIStreamListener*>(corsListener); > > You shouldn't need the cast here... Why is it needed? Because otherwise nsCOMPtr would try to pick an nsISupports* out of the thing you assign to it, and that conversion is ambiguous and it fails. The only way to avoid these casts is to QI I think which would be worse. Are you fine with leaving the casts in?
Comment 19•12 years ago
|
||
Most of those are not nsCOMPtr<nsISupports>, so why are they trying to get an nsISupports out? If it's needed to compile, I can live with it; just trying to understand why it's needed.
Assignee | ||
Comment 20•12 years ago
|
||
(In reply to comment #19) > Most of those are not nsCOMPtr<nsISupports>, so why are they trying to get an > nsISupports out? > > If it's needed to compile, I can live with it; just trying to understand why > it's needed. Actually, this made me curious. I was under the impression that nsCOMPtr has an operator=(nsISupports*) which makes this break. So I wondered. And that method does not exist. So I tried taking out all of the casts which I'm pretty sure I added yesterday to beat this thing to compile, and things seem to compile without the casts! I'm doing a full rebuild to check my sanity, and if that proves me to be insane, then I will attach a new patch without any of the casts!
Assignee | ||
Comment 21•12 years ago
|
||
Clearly my sanity should not be over-trusted! This version of the patch gets rid of all of those casts.
Attachment #661965 -
Attachment is obsolete: true
Assignee | ||
Comment 22•12 years ago
|
||
Landed part 0: https://hg.mozilla.org/integration/mozilla-inbound/rev/64c78f239c47
Whiteboard: [leave open]
Comment 23•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/64c78f239c47
status-firefox18:
--- → fixed
Updated•12 years ago
|
Attachment #661948 -
Flags: review?(jduell.mcbugs) → review+
Assignee | ||
Comment 24•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4cda2cc45466 https://hg.mozilla.org/integration/mozilla-inbound/rev/7c3acad5cf39
Whiteboard: [leave open]
Comment 25•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4cda2cc45466 https://hg.mozilla.org/mozilla-central/rev/7c3acad5cf39
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•