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
This commit is contained in:
Nicholas Nethercote 2019-08-02 11:59:06 +00:00
Родитель dd63fcde4e
Коммит 83f0e39a49
2 изменённых файлов: 7 добавлений и 12 удалений

Просмотреть файл

@ -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<nsUint32HashKey, nsString> mBrowserCrashDumpIds;
Mutex mBrowserCrashDumpHashLock;
mozilla::ipc::TaskFactory<HangMonitorParent> 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<TabId, bool, LayersObserverEpoch>(
"HangMonitorParent::PaintWhileInterruptingJSOnThread", this,

Просмотреть файл

@ -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