Skip to content
Snippets Groups Projects
Commit 3adc1963 authored by Neill Miller's avatar Neill Miller Committed by Pier Angelo Vendrame
Browse files

Bug 1768907 - Part 2: nsTransferable disk-leaks when private browsing mode is...

Bug 1768907 - Part 2: nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman

nsTransferable was modified to prevent disk leakings when copying data
in private browsing mode with Bug 1123480.
However, the context is nullptr when it is initialized, so it still
leaks if PBM is enabled by default.
Our solution is to check the browser.privatebrowsing.autostart in this
condition.

Differential Revision: https://phabricator.services.mozilla.com/D157800
parent 9920955c
No related branches found
No related tags found
1 merge request!735Bug 42033: Rebased release onto 102.15.0esr (last 102.x release!)
......@@ -32,6 +32,7 @@ Notes to self:
#include "nsNetUtil.h"
#include "nsILoadContext.h"
#include "nsXULAppAPI.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/UniquePtr.h"
using namespace mozilla;
......@@ -195,6 +196,10 @@ nsTransferable::Init(nsILoadContext* aContext) {
if (aContext) {
mPrivateData = aContext->UsePrivateBrowsing();
} else {
// without aContext here to provide PrivateBrowsing information, we defer to
// the active configured setting
mPrivateData = StaticPrefs::browser_privatebrowsing_autostart();
}
#ifdef DEBUG
mInitialized = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment