mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1335303 - Explicitly set up the bool var cache for BrowserFramesEnabled. r=smaug
This commit is contained in:
parent
347e3d646b
commit
0f1312abd1
@ -453,18 +453,28 @@ nsGenericHTMLFrameElement::IsHTMLFocusable(bool aWithMouse,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool sMozBrowserFramesEnabled = false;
|
||||
#ifdef DEBUG
|
||||
static bool sBoolVarCacheInitialized = false;
|
||||
#endif
|
||||
|
||||
void
|
||||
nsGenericHTMLFrameElement::InitStatics()
|
||||
{
|
||||
MOZ_ASSERT(!sBoolVarCacheInitialized);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
|
||||
"dom.mozBrowserFramesEnabled");
|
||||
#ifdef DEBUG
|
||||
sBoolVarCacheInitialized = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
nsGenericHTMLFrameElement::BrowserFramesEnabled()
|
||||
{
|
||||
static bool sMozBrowserFramesEnabled = false;
|
||||
static bool sBoolVarCacheInitialized = false;
|
||||
|
||||
if (!sBoolVarCacheInitialized) {
|
||||
sBoolVarCacheInitialized = true;
|
||||
Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
|
||||
"dom.mozBrowserFramesEnabled");
|
||||
}
|
||||
|
||||
MOZ_ASSERT(sBoolVarCacheInitialized);
|
||||
return sMozBrowserFramesEnabled;
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,7 @@ public:
|
||||
void PresetOpenerWindow(mozIDOMWindowProxy* aOpenerWindow,
|
||||
mozilla::ErrorResult& aRv);
|
||||
|
||||
static void InitStatics();
|
||||
static bool BrowserFramesEnabled();
|
||||
|
||||
/**
|
||||
|
@ -42,6 +42,7 @@ const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
|
||||
"dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
|
||||
"dom.max_chrome_script_run_time",
|
||||
"dom.max_script_run_time",
|
||||
"dom.mozBrowserFramesEnabled",
|
||||
"dom.performance.enable_notify_performance_timing",
|
||||
"dom.performance.enable_user_timing_logging",
|
||||
"dom.storage.testing",
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "nsCSSPseudoClasses.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsGenericHTMLFrameElement.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
@ -286,6 +287,7 @@ nsLayoutStatics::Initialize()
|
||||
nsApplicationCacheService::AppClearDataObserverInit();
|
||||
|
||||
HTMLVideoElement::Init();
|
||||
nsGenericHTMLFrameElement::InitStatics();
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
nsMenuBarListener::InitializeStatics();
|
||||
|
Loading…
Reference in New Issue
Block a user