From 83f0e39a499e6b70ccd17fe7b015b9c371e6eb37 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 2 Aug 2019 11:59:06 +0000 Subject: [PATCH] Bug 1570212 - Convert browser.tabs.remote.force-paint to a static pref. r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D40162 --HG-- extra : moz-landing-system : lando --- dom/ipc/ProcessHangMonitor.cpp | 14 ++------------ modules/libpref/init/StaticPrefList.yaml | 5 +++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/dom/ipc/ProcessHangMonitor.cpp b/dom/ipc/ProcessHangMonitor.cpp index 2b41b359ae90..951d9a19dd35 100644 --- a/dom/ipc/ProcessHangMonitor.cpp +++ b/dom/ipc/ProcessHangMonitor.cpp @@ -22,6 +22,7 @@ #include "mozilla/Monitor.h" #include "mozilla/plugins/PluginBridge.h" #include "mozilla/Preferences.h" +#include "mozilla/StaticPrefs_browser.h" #include "mozilla/Unused.h" #include "mozilla/WeakPtr.h" @@ -305,12 +306,8 @@ class HangMonitorParent : public PProcessHangMonitorParent, nsDataHashtable mBrowserCrashDumpIds; Mutex mBrowserCrashDumpHashLock; mozilla::ipc::TaskFactory mMainThreadTaskFactory; - - static bool sShouldPaintWhileInterruptingJS; }; -bool HangMonitorParent::sShouldPaintWhileInterruptingJS = true; - } // namespace /* HangMonitorChild implementation */ @@ -717,13 +714,6 @@ HangMonitorParent::HangMonitorParent(ProcessHangMonitor* aMonitor) MOZ_RELEASE_ASSERT(NS_IsMainThread()); mReportHangs = mozilla::Preferences::GetBool("dom.ipc.reportProcessHangs", false); - - static bool sInited = false; - if (!sInited) { - sInited = true; - Preferences::AddBoolVarCache(&sShouldPaintWhileInterruptingJS, - "browser.tabs.remote.force-paint", true); - } } HangMonitorParent::~HangMonitorParent() { @@ -775,7 +765,7 @@ void HangMonitorParent::PaintWhileInterruptingJS( dom::BrowserParent* aTab, bool aForceRepaint, const LayersObserverEpoch& aEpoch) { MOZ_RELEASE_ASSERT(NS_IsMainThread()); - if (sShouldPaintWhileInterruptingJS) { + if (StaticPrefs::browser_tabs_remote_force_paint()) { TabId id = aTab->GetTabId(); Dispatch(NewNonOwningRunnableMethod( "HangMonitorParent::PaintWhileInterruptingJSOnThread", this, diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 88a76ee3e23b..6f0343c7dac8 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -853,6 +853,11 @@ value: 2048 mirror: always +- name: browser.tabs.remote.force-paint + type: bool + value: true + mirror: always + # When this pref is enabled document loads with a mismatched # Cross-Origin header will fail to load - name: browser.tabs.remote.useCrossOriginPolicy