mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 801151 - Make sure that favicon loads from tabs which are loading right near the end of a private browsing session do not into the non-private session; r=jdm
--HG-- extra : rebase_source : 50c8cc5fd90c907bb8fa00b2851c5f544f355505
This commit is contained in:
parent
4ef6a7114a
commit
3eff91e626
@ -101,12 +101,19 @@ PrivateBrowsingService.prototype = {
|
||||
.usePrivateBrowsing = aFlag;
|
||||
},
|
||||
|
||||
_onBeforePrivateBrowsingModeChange: function PBS__onBeforePrivateBrowsingModeChange() {
|
||||
_adjustPBFlagOnExistingWindows: function PBS__adjustPBFlagOnExistingWindows() {
|
||||
var windowsEnum = Services.wm.getEnumerator(null);
|
||||
while (windowsEnum.hasMoreElements()) {
|
||||
var window = windowsEnum.getNext();
|
||||
this._setPerWindowPBFlag(window, this._inPrivateBrowsing);
|
||||
}
|
||||
},
|
||||
|
||||
_onBeforePrivateBrowsingModeChange: function PBS__onBeforePrivateBrowsingModeChange() {
|
||||
// If we're about to enter PB mode, adjust the flags now
|
||||
if (this._inPrivateBrowsing) {
|
||||
this._adjustPBFlagOnExistingWindows();
|
||||
}
|
||||
|
||||
// nothing needs to be done here if we're enabling at startup
|
||||
if (!this._autoStarted) {
|
||||
@ -180,6 +187,11 @@ PrivateBrowsingService.prototype = {
|
||||
}
|
||||
else
|
||||
this._saveSession = false;
|
||||
|
||||
// If we're about to leave PB mode, adjust the flags now
|
||||
if (!this._inPrivateBrowsing) {
|
||||
this._adjustPBFlagOnExistingWindows();
|
||||
}
|
||||
},
|
||||
|
||||
_onAfterPrivateBrowsingModeChange: function PBS__onAfterPrivateBrowsingModeChange() {
|
||||
|
@ -515,7 +515,18 @@ AsyncFetchAndSetIconForPage::AsyncFetchAndSetIconForPage(
|
||||
if (pbService) {
|
||||
bool inPrivateBrowsing = false;
|
||||
if (NS_SUCCEEDED(pbService->GetPrivateBrowsingEnabled(&inPrivateBrowsing))) {
|
||||
MOZ_ASSERT(inPrivateBrowsing == mFaviconLoadPrivate);
|
||||
// In one specific case that we know of, it is possible for these flags
|
||||
// to not match (bug 801151). We mostly care about the cases where the
|
||||
// global private browsing mode is on, but the favicon load is not marked
|
||||
// as private, as those cases will cause privacy leaks. But because
|
||||
// fixing bug 801151 properly is going to mean tons of really dirty and
|
||||
// fragile work which might cause other types of problems, we fatally
|
||||
// assert the condition which would be a privacy leak, and non-fatally
|
||||
// assert the other side of the condition which would designate a bug,
|
||||
// but not a privacy sensitive one.
|
||||
MOZ_ASSERT_IF(inPrivateBrowsing && !mFaviconLoadPrivate, false);
|
||||
NS_ASSERTION(inPrivateBrowsing == mFaviconLoadPrivate,
|
||||
"The favicon load flag and the global PB flag do not match");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user