зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1563996 - Make browser.xul.error_pages.enabled a static pref. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D37201 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
544a779566
Коммит
7c43c6f952
|
@ -665,7 +665,6 @@ pref("mousewheel.with_meta.action", 1); // win key on Win, Super/Hyper on Linux
|
|||
pref("mousewheel.with_control.action",3);
|
||||
pref("mousewheel.with_win.action", 1);
|
||||
|
||||
pref("browser.xul.error_pages.enabled", true);
|
||||
pref("browser.xul.error_pages.expert_bad_cert", false);
|
||||
pref("browser.xul.error_pages.show_safe_browsing_details_on_load", false);
|
||||
|
||||
|
|
|
@ -243,10 +243,6 @@ using namespace mozilla::net;
|
|||
|
||||
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
|
||||
|
||||
// True means sUseErrorPages has been added to
|
||||
// preferences var cache.
|
||||
static bool gAddedPreferencesVarCache = false;
|
||||
|
||||
// Number of documents currently loading
|
||||
static int32_t gNumberOfDocumentsLoading = 0;
|
||||
|
||||
|
@ -271,8 +267,6 @@ const char kBrandBundleURL[] = "chrome://branding/locale/brand.properties";
|
|||
const char kAppstringsBundleURL[] =
|
||||
"chrome://global/locale/appstrings.properties";
|
||||
|
||||
bool nsDocShell::sUseErrorPages = false;
|
||||
|
||||
// Global reference to the URI fixup service.
|
||||
nsIURIFixup* nsDocShell::sURIFixup = nullptr;
|
||||
|
||||
|
@ -2088,7 +2082,8 @@ nsDocShell::GetUseErrorPages(bool* aUseErrorPages) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetUseErrorPages(bool aUseErrorPages) {
|
||||
// If mUseErrorPages is set explicitly, stop using sUseErrorPages.
|
||||
// If mUseErrorPages is set explicitly, stop using the
|
||||
// browser.xul.error_pages_enabled pref.
|
||||
if (mObserveErrorPages) {
|
||||
mObserveErrorPages = false;
|
||||
}
|
||||
|
@ -4949,14 +4944,7 @@ nsDocShell::Create() {
|
|||
"security.strict_security_checks.enabled", mUseStrictSecurityChecks);
|
||||
|
||||
// Should we use XUL error pages instead of alerts if possible?
|
||||
mUseErrorPages =
|
||||
Preferences::GetBool("browser.xul.error_pages.enabled", mUseErrorPages);
|
||||
|
||||
if (!gAddedPreferencesVarCache) {
|
||||
Preferences::AddBoolVarCache(
|
||||
&sUseErrorPages, "browser.xul.error_pages.enabled", mUseErrorPages);
|
||||
gAddedPreferencesVarCache = true;
|
||||
}
|
||||
mUseErrorPages = StaticPrefs::browser_xul_error_pages_enabled();
|
||||
|
||||
mDisableMetaRefreshWhenInactive =
|
||||
Preferences::GetBool("browser.meta_refresh_when_inactive.disabled",
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
|
@ -944,7 +945,9 @@ class nsDocShell final : public nsDocLoader,
|
|||
already_AddRefed<mozilla::dom::ChildSHistory> GetRootSessionHistory();
|
||||
|
||||
inline bool UseErrorPages() {
|
||||
return (mObserveErrorPages ? sUseErrorPages : mUseErrorPages);
|
||||
return (mObserveErrorPages
|
||||
? mozilla::StaticPrefs::browser_xul_error_pages_enabled()
|
||||
: mUseErrorPages);
|
||||
}
|
||||
|
||||
bool CSSErrorReportingEnabled() const { return mCSSErrorReportingEnabled; }
|
||||
|
@ -984,9 +987,6 @@ class nsDocShell final : public nsDocLoader,
|
|||
private: // data members
|
||||
static nsIURIFixup* sURIFixup;
|
||||
|
||||
// Cached value of the "browser.xul.error_pages.enabled" preference.
|
||||
static bool sUseErrorPages;
|
||||
|
||||
#ifdef DEBUG
|
||||
// We're counting the number of |nsDocShells| to help find leaks
|
||||
static unsigned long gNumberOfDocShells;
|
||||
|
|
|
@ -277,9 +277,6 @@ pref("chrome.override_package.global", "browser");
|
|||
pref("chrome.override_package.mozapps", "browser");
|
||||
pref("chrome.override_package.passwordmgr", "browser");
|
||||
|
||||
// enable xul error pages
|
||||
pref("browser.xul.error_pages.enabled", true);
|
||||
|
||||
// disable color management
|
||||
pref("gfx.color_management.mode", 0);
|
||||
|
||||
|
|
|
@ -975,6 +975,14 @@ VARCACHE_PREF(
|
|||
|
||||
PREF("browser.visited_color", String, "")
|
||||
|
||||
// Enable xul error pages.
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
"browser.xul.error_pages.enabled",
|
||||
browser_xul_error_pages_enabled,
|
||||
bool, true
|
||||
)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Prefs starting with "canvas."
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
Загрузка…
Ссылка в новой задаче