Commit c05bb1f8 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by Richard Pospesel
Browse files

Bug 1768907 - Part 1: Make browser.privatebrowsing.autostart a static pref....

Bug 1768907 - Part 1: Make browser.privatebrowsing.autostart a static pref. r=handyman,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D157843
parent 9bed52cd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#endif
#include "mozilla/net/DocumentLoadListener.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/StaticPrefs_docshell.h"
#include "mozilla/StaticPrefs_fission.h"
#include "mozilla/Telemetry.h"
@@ -100,7 +101,7 @@ static void DecreasePrivateCount() {
          ("%s: Private browsing context count %d -> %d", __func__,
           gNumberOfPrivateContexts + 1, gNumberOfPrivateContexts));
  if (!gNumberOfPrivateContexts &&
      !mozilla::Preferences::GetBool("browser.privatebrowsing.autostart")) {
      !mozilla::StaticPrefs::browser_privatebrowsing_autostart()) {
    nsCOMPtr<nsIObserverService> observerService =
        mozilla::services::GetObserverService();
    if (observerService) {
+2 −4
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include "mozilla/net/HttpAuthUtils.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/net/DNS.h"
#include "mozilla/StaticPrefs_browser.h"

using mozilla::Base64Decode;

@@ -100,10 +101,7 @@ static bool TestNotInPBMode(nsIHttpAuthenticableChannel* authChannel,
    // When the "Never remember history" option is set, all channels are
    // set PB mode flag, but here we want to make an exception, users
    // want their credentials go out.
    bool dontRememberHistory;
    if (NS_SUCCEEDED(prefs->GetBoolPref("browser.privatebrowsing.autostart",
                                        &dontRememberHistory)) &&
        dontRememberHistory) {
    if (mozilla::StaticPrefs::browser_privatebrowsing_autostart()) {
      return true;
    }
  }
+6 −0
Original line number Diff line number Diff line
@@ -1326,6 +1326,12 @@
  value: 5000
  mirror: always

# Whether to start the private browsing mode at application startup
- name: browser.privatebrowsing.autostart
  type: bool
  value: false
  mirror: always

# Force usage of in-memory (rather than file on disk) media cache for video streaming when private browsing
- name: browser.privatebrowsing.forceMediaMemoryCache
  type: bool
+0 −3
Original line number Diff line number Diff line
@@ -4400,9 +4400,6 @@ pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", false
pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", false, locked);
#endif

// Whether to start the private browsing mode at application startup
pref("browser.privatebrowsing.autostart", false);

// Whether sites require the open-protocol-handler permission to open a
//preferred external application for a protocol. If a site doesn't have
// permission we will show a prompt.
+2 −4
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include "mozilla/net/HttpAuthUtils.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/net/DNS.h"
#include "mozilla/StaticPrefs_browser.h"

namespace mozilla {
namespace net {
@@ -102,10 +103,7 @@ static bool CanUseDefaultCredentials(nsIHttpAuthenticableChannel* channel,
      return true;
    }

    bool dontRememberHistory;
    if (NS_SUCCEEDED(prefs->GetBoolPref("browser.privatebrowsing.autostart",
                                        &dontRememberHistory)) &&
        !dontRememberHistory) {
    if (!StaticPrefs::browser_privatebrowsing_autostart()) {
      return false;
    }
  }
Loading