mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 660121 Remove all pref related methods from nsContentUtils r=roc
This commit is contained in:
parent
0ca0078601
commit
4a5030c91a
@ -77,7 +77,6 @@ static fp_except_t oldmask = fpsetmask(~allmask);
|
|||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
#include "nsTextFragment.h"
|
#include "nsTextFragment.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "nsIPrefBranch2.h"
|
|
||||||
#include "mozilla/AutoRestore.h"
|
#include "mozilla/AutoRestore.h"
|
||||||
#include "nsINode.h"
|
#include "nsINode.h"
|
||||||
#include "nsHashtable.h"
|
#include "nsHashtable.h"
|
||||||
@ -104,7 +103,6 @@ class imgIDecoderObserver;
|
|||||||
class imgIRequest;
|
class imgIRequest;
|
||||||
class imgILoader;
|
class imgILoader;
|
||||||
class imgICache;
|
class imgICache;
|
||||||
class nsIPrefBranch2;
|
|
||||||
class nsIImageLoadingContent;
|
class nsIImageLoadingContent;
|
||||||
class nsIDOMHTMLFormElement;
|
class nsIDOMHTMLFormElement;
|
||||||
class nsIDOMDocument;
|
class nsIDOMDocument;
|
||||||
@ -129,8 +127,6 @@ class nsPIDOMWindow;
|
|||||||
class nsPIDOMEventTarget;
|
class nsPIDOMEventTarget;
|
||||||
class nsIPresShell;
|
class nsIPresShell;
|
||||||
class nsIXPConnectJSObjectHolder;
|
class nsIXPConnectJSObjectHolder;
|
||||||
class nsPrefOldCallback;
|
|
||||||
class nsPrefObserverHashKey;
|
|
||||||
#ifdef MOZ_XTF
|
#ifdef MOZ_XTF
|
||||||
class nsIXTFService;
|
class nsIXTFService;
|
||||||
#endif
|
#endif
|
||||||
@ -146,11 +142,6 @@ struct nsIntMargin;
|
|||||||
class nsPIDOMWindow;
|
class nsPIDOMWindow;
|
||||||
class nsIDocumentLoaderFactory;
|
class nsIDocumentLoaderFactory;
|
||||||
|
|
||||||
#ifndef have_PrefChangedFunc_typedef
|
|
||||||
typedef int (*PR_CALLBACK PrefChangedFunc)(const char *, void *);
|
|
||||||
#define have_PrefChangedFunc_typedef
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
namespace layers {
|
namespace layers {
|
||||||
@ -561,17 +552,6 @@ public:
|
|||||||
static void SplitExpatName(const PRUnichar *aExpatName, nsIAtom **aPrefix,
|
static void SplitExpatName(const PRUnichar *aExpatName, nsIAtom **aPrefix,
|
||||||
nsIAtom **aTagName, PRInt32 *aNameSpaceID);
|
nsIAtom **aTagName, PRInt32 *aNameSpaceID);
|
||||||
|
|
||||||
static void RegisterPrefCallback(const char *aPref,
|
|
||||||
PrefChangedFunc aCallback,
|
|
||||||
void * aClosure);
|
|
||||||
static void UnregisterPrefCallback(const char *aPref,
|
|
||||||
PrefChangedFunc aCallback,
|
|
||||||
void * aClosure);
|
|
||||||
static void AddBoolPrefVarCache(const char* aPref, PRBool* aVariable,
|
|
||||||
PRBool aDefault = PR_FALSE);
|
|
||||||
static void AddIntPrefVarCache(const char* aPref, PRInt32* aVariable,
|
|
||||||
PRInt32 aDefault = 0);
|
|
||||||
|
|
||||||
// Get a permission-manager setting for the given uri and type.
|
// Get a permission-manager setting for the given uri and type.
|
||||||
// If the pref doesn't exist or if it isn't ALLOW_ACTION, PR_FALSE is
|
// If the pref doesn't exist or if it isn't ALLOW_ACTION, PR_FALSE is
|
||||||
// returned, otherwise PR_TRUE is returned.
|
// returned, otherwise PR_TRUE is returned.
|
||||||
@ -1791,11 +1771,6 @@ private:
|
|||||||
static nsIXTFService *sXTFService;
|
static nsIXTFService *sXTFService;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static nsIPrefBranch2 *sPrefBranch;
|
|
||||||
// For old compatibility of RegisterPrefCallback
|
|
||||||
static nsRefPtrHashtable<nsPrefObserverHashKey, nsPrefOldCallback>
|
|
||||||
*sPrefCallbackTable;
|
|
||||||
|
|
||||||
static bool sImgLoaderInitialized;
|
static bool sImgLoaderInitialized;
|
||||||
static void InitImgLoader();
|
static void InitImgLoader();
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#include "nsIObserver.h"
|
#include "nsIObserver.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "nsCSPService.h"
|
#include "nsCSPService.h"
|
||||||
#include "nsIContentSecurityPolicy.h"
|
#include "nsIContentSecurityPolicy.h"
|
||||||
#include "nsIChannelPolicy.h"
|
#include "nsIChannelPolicy.h"
|
||||||
@ -55,6 +54,9 @@
|
|||||||
#include "nsChannelProperties.h"
|
#include "nsChannelProperties.h"
|
||||||
#include "nsIAsyncVerifyRedirectCallback.h"
|
#include "nsIAsyncVerifyRedirectCallback.h"
|
||||||
#include "nsAsyncRedirectVerifyHelper.h"
|
#include "nsAsyncRedirectVerifyHelper.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
/* Keeps track of whether or not CSP is enabled */
|
/* Keeps track of whether or not CSP is enabled */
|
||||||
PRBool CSPService::sCSPEnabled = PR_TRUE;
|
PRBool CSPService::sCSPEnabled = PR_TRUE;
|
||||||
@ -65,7 +67,7 @@ static PRLogModuleInfo* gCspPRLog;
|
|||||||
|
|
||||||
CSPService::CSPService()
|
CSPService::CSPService()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddBoolPrefVarCache("security.csp.enable", &sCSPEnabled);
|
Preferences::AddBoolVarCache(&sCSPEnabled, "security.csp.enable");
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
if (!gCspPRLog)
|
if (!gCspPRLog)
|
||||||
|
@ -102,6 +102,9 @@
|
|||||||
#include "nsGenericHTMLElement.h"
|
#include "nsGenericHTMLElement.h"
|
||||||
#include "nsHTMLDNSPrefetch.h"
|
#include "nsHTMLDNSPrefetch.h"
|
||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
PRLogModuleInfo* gContentSinkLogModuleInfo;
|
PRLogModuleInfo* gContentSinkLogModuleInfo;
|
||||||
|
|
||||||
@ -232,11 +235,11 @@ PRBool nsContentSink::sCanInterruptParser;
|
|||||||
void
|
void
|
||||||
nsContentSink::InitializeStatics()
|
nsContentSink::InitializeStatics()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddBoolPrefVarCache("content.notify.ontimer",
|
Preferences::AddBoolVarCache(&sNotifyOnTimer,
|
||||||
&sNotifyOnTimer, PR_TRUE);
|
"content.notify.ontimer", PR_TRUE);
|
||||||
// -1 means never.
|
// -1 means never.
|
||||||
nsContentUtils::AddIntPrefVarCache("content.notify.backoffcount",
|
Preferences::AddIntVarCache(&sBackoffCount,
|
||||||
&sBackoffCount, -1);
|
"content.notify.backoffcount", -1);
|
||||||
// The gNotificationInterval has a dramatic effect on how long it
|
// The gNotificationInterval has a dramatic effect on how long it
|
||||||
// takes to initially display content for slow connections.
|
// takes to initially display content for slow connections.
|
||||||
// The current value provides good
|
// The current value provides good
|
||||||
@ -244,29 +247,28 @@ nsContentSink::InitializeStatics()
|
|||||||
// in page load time. If this value is set below 1/10 of second
|
// in page load time. If this value is set below 1/10 of second
|
||||||
// it starts to impact page load performance.
|
// it starts to impact page load performance.
|
||||||
// see bugzilla bug 72138 for more info.
|
// see bugzilla bug 72138 for more info.
|
||||||
nsContentUtils::AddIntPrefVarCache("content.notify.interval",
|
Preferences::AddIntVarCache(&sNotificationInterval,
|
||||||
&sNotificationInterval,
|
"content.notify.interval", 120000);
|
||||||
120000);
|
Preferences::AddIntVarCache(&sInteractiveDeflectCount,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.interactive_deflect_count",
|
"content.sink.interactive_deflect_count", 0);
|
||||||
&sInteractiveDeflectCount, 0);
|
Preferences::AddIntVarCache(&sPerfDeflectCount,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.perf_deflect_count",
|
"content.sink.perf_deflect_count", 200);
|
||||||
&sPerfDeflectCount, 200);
|
Preferences::AddIntVarCache(&sPendingEventMode,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.pending_event_mode",
|
"content.sink.pending_event_mode", 1);
|
||||||
&sPendingEventMode, 1);
|
Preferences::AddIntVarCache(&sEventProbeRate,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.event_probe_rate",
|
"content.sink.event_probe_rate", 1);
|
||||||
&sEventProbeRate, 1);
|
Preferences::AddIntVarCache(&sInteractiveParseTime,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.interactive_parse_time",
|
"content.sink.interactive_parse_time", 3000);
|
||||||
&sInteractiveParseTime, 3000);
|
Preferences::AddIntVarCache(&sPerfParseTime,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.perf_parse_time",
|
"content.sink.perf_parse_time", 360000);
|
||||||
&sPerfParseTime, 360000);
|
Preferences::AddIntVarCache(&sInteractiveTime,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.interactive_time",
|
"content.sink.interactive_time", 750000);
|
||||||
&sInteractiveTime, 750000);
|
Preferences::AddIntVarCache(&sInitialPerfTime,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.initial_perf_time",
|
"content.sink.initial_perf_time", 2000000);
|
||||||
&sInitialPerfTime, 2000000);
|
Preferences::AddIntVarCache(&sEnablePerfMode,
|
||||||
nsContentUtils::AddIntPrefVarCache("content.sink.enable_perf_mode",
|
"content.sink.enable_perf_mode", 0);
|
||||||
&sEnablePerfMode, 0);
|
Preferences::AddBoolVarCache(&sCanInterruptParser,
|
||||||
nsContentUtils::AddBoolPrefVarCache("content.interrupt.parsing",
|
"content.interrupt.parsing", PR_TRUE);
|
||||||
&sCanInterruptParser, PR_TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -49,9 +49,6 @@
|
|||||||
#include "nsAString.h"
|
#include "nsAString.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsIPrefService.h"
|
|
||||||
#include "nsIPrefBranch2.h"
|
|
||||||
#include "nsIPrefLocalizedString.h"
|
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsIScriptGlobalObject.h"
|
#include "nsIScriptGlobalObject.h"
|
||||||
#include "nsIScriptContext.h"
|
#include "nsIScriptContext.h"
|
||||||
@ -233,7 +230,6 @@ nsIIOService *nsContentUtils::sIOService;
|
|||||||
#ifdef MOZ_XTF
|
#ifdef MOZ_XTF
|
||||||
nsIXTFService *nsContentUtils::sXTFService = nsnull;
|
nsIXTFService *nsContentUtils::sXTFService = nsnull;
|
||||||
#endif
|
#endif
|
||||||
nsIPrefBranch2 *nsContentUtils::sPrefBranch = nsnull;
|
|
||||||
imgILoader *nsContentUtils::sImgLoader;
|
imgILoader *nsContentUtils::sImgLoader;
|
||||||
imgICache *nsContentUtils::sImgCache;
|
imgICache *nsContentUtils::sImgCache;
|
||||||
nsIConsoleService *nsContentUtils::sConsoleService;
|
nsIConsoleService *nsContentUtils::sConsoleService;
|
||||||
@ -267,9 +263,6 @@ PRBool nsContentUtils::sAllowXULXBL_for_file = PR_FALSE;
|
|||||||
|
|
||||||
PRBool nsContentUtils::sInitialized = PR_FALSE;
|
PRBool nsContentUtils::sInitialized = PR_FALSE;
|
||||||
|
|
||||||
nsRefPtrHashtable<nsPrefObserverHashKey, nsPrefOldCallback>
|
|
||||||
*nsContentUtils::sPrefCallbackTable = nsnull;
|
|
||||||
|
|
||||||
static PLDHashTable sEventListenerManagersHash;
|
static PLDHashTable sEventListenerManagersHash;
|
||||||
|
|
||||||
class EventListenerManagerMapEntry : public PLDHashEntryHdr
|
class EventListenerManagerMapEntry : public PLDHashEntryHdr
|
||||||
@ -319,108 +312,6 @@ class nsSameOriginChecker : public nsIChannelEventSink,
|
|||||||
NS_DECL_NSIINTERFACEREQUESTOR
|
NS_DECL_NSIINTERFACEREQUESTOR
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsPrefObserverHashKey : public PLDHashEntryHdr {
|
|
||||||
public:
|
|
||||||
typedef nsPrefObserverHashKey* KeyType;
|
|
||||||
typedef const nsPrefObserverHashKey* KeyTypePointer;
|
|
||||||
|
|
||||||
static const nsPrefObserverHashKey* KeyToPointer(nsPrefObserverHashKey *aKey)
|
|
||||||
{
|
|
||||||
return aKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PLDHashNumber HashKey(const nsPrefObserverHashKey *aKey)
|
|
||||||
{
|
|
||||||
PRUint32 strHash = nsCRT::HashCode(aKey->mPref.BeginReading(),
|
|
||||||
aKey->mPref.Length());
|
|
||||||
return PR_ROTATE_LEFT32(strHash, 4) ^
|
|
||||||
NS_PTR_TO_UINT32(aKey->mCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsPrefObserverHashKey(const char *aPref, PrefChangedFunc aCallback) :
|
|
||||||
mPref(aPref), mCallback(aCallback) { }
|
|
||||||
|
|
||||||
nsPrefObserverHashKey(const nsPrefObserverHashKey *aOther) :
|
|
||||||
mPref(aOther->mPref), mCallback(aOther->mCallback)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
PRBool KeyEquals(const nsPrefObserverHashKey *aOther) const
|
|
||||||
{
|
|
||||||
return mCallback == aOther->mCallback &&
|
|
||||||
mPref.Equals(aOther->mPref);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsPrefObserverHashKey *GetKey() const
|
|
||||||
{
|
|
||||||
return const_cast<nsPrefObserverHashKey*>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum { ALLOW_MEMMOVE = PR_TRUE };
|
|
||||||
|
|
||||||
public:
|
|
||||||
nsCString mPref;
|
|
||||||
PrefChangedFunc mCallback;
|
|
||||||
};
|
|
||||||
|
|
||||||
// For nsContentUtils::RegisterPrefCallback/UnregisterPrefCallback
|
|
||||||
class nsPrefOldCallback : public nsIObserver,
|
|
||||||
public nsPrefObserverHashKey
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
NS_DECL_NSIOBSERVER
|
|
||||||
|
|
||||||
public:
|
|
||||||
nsPrefOldCallback(const char *aPref, PrefChangedFunc aCallback)
|
|
||||||
: nsPrefObserverHashKey(aPref, aCallback) { }
|
|
||||||
|
|
||||||
~nsPrefOldCallback() {
|
|
||||||
Preferences::RemoveObserver(this, mPref.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppendClosure(void *aClosure) {
|
|
||||||
mClosures.AppendElement(aClosure);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RemoveClosure(void *aClosure) {
|
|
||||||
mClosures.RemoveElement(aClosure);
|
|
||||||
}
|
|
||||||
|
|
||||||
PRBool HasNoClosures() {
|
|
||||||
return mClosures.Length() == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
nsTArray<void *> mClosures;
|
|
||||||
};
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS1(nsPrefOldCallback, nsIObserver)
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsPrefOldCallback::Observe(nsISupports *aSubject,
|
|
||||||
const char *aTopic,
|
|
||||||
const PRUnichar *aData)
|
|
||||||
{
|
|
||||||
NS_ASSERTION(!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID),
|
|
||||||
"invalid topic");
|
|
||||||
NS_LossyConvertUTF16toASCII data(aData);
|
|
||||||
for (PRUint32 i = 0; i < mClosures.Length(); i++) {
|
|
||||||
mCallback(data.get(), mClosures.ElementAt(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct PrefCacheData {
|
|
||||||
void* cacheLocation;
|
|
||||||
union {
|
|
||||||
PRBool defaultValueBool;
|
|
||||||
PRInt32 defaultValueInt;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nsTArray<nsAutoPtr<PrefCacheData> >* sPrefCacheData = nsnull;
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
nsresult
|
nsresult
|
||||||
nsContentUtils::Init()
|
nsContentUtils::Init()
|
||||||
@ -431,11 +322,6 @@ nsContentUtils::Init()
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
sPrefCacheData = new nsTArray<nsAutoPtr<PrefCacheData> >();
|
|
||||||
|
|
||||||
// It's ok to not have a pref service.
|
|
||||||
CallGetService(NS_PREFSERVICE_CONTRACTID, &sPrefBranch);
|
|
||||||
|
|
||||||
nsresult rv = NS_GetNameSpaceManager(&sNameSpaceManager);
|
nsresult rv = NS_GetNameSpaceManager(&sNameSpaceManager);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
@ -493,8 +379,8 @@ nsContentUtils::Init()
|
|||||||
sBlockedScriptRunners = new nsCOMArray<nsIRunnable>;
|
sBlockedScriptRunners = new nsCOMArray<nsIRunnable>;
|
||||||
NS_ENSURE_TRUE(sBlockedScriptRunners, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(sBlockedScriptRunners, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsContentUtils::AddBoolPrefVarCache("dom.allow_XUL_XBL_for_file",
|
Preferences::AddBoolVarCache(&sAllowXULXBL_for_file,
|
||||||
&sAllowXULXBL_for_file);
|
"dom.allow_XUL_XBL_for_file");
|
||||||
|
|
||||||
sInitialized = PR_TRUE;
|
sInitialized = PR_TRUE;
|
||||||
|
|
||||||
@ -1123,9 +1009,10 @@ nsContentUtils::OfflineAppAllowed(nsIURI *aURI)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool allowed;
|
PRBool allowed;
|
||||||
nsresult rv = updateService->OfflineAppAllowedForURI(aURI,
|
nsresult rv =
|
||||||
sPrefBranch,
|
updateService->OfflineAppAllowedForURI(aURI,
|
||||||
&allowed);
|
Preferences::GetRootBranch(),
|
||||||
|
&allowed);
|
||||||
return NS_SUCCEEDED(rv) && allowed;
|
return NS_SUCCEEDED(rv) && allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1141,7 +1028,7 @@ nsContentUtils::OfflineAppAllowed(nsIPrincipal *aPrincipal)
|
|||||||
|
|
||||||
PRBool allowed;
|
PRBool allowed;
|
||||||
nsresult rv = updateService->OfflineAppAllowed(aPrincipal,
|
nsresult rv = updateService->OfflineAppAllowed(aPrincipal,
|
||||||
sPrefBranch,
|
Preferences::GetRootBranch(),
|
||||||
&allowed);
|
&allowed);
|
||||||
return NS_SUCCEEDED(rv) && allowed;
|
return NS_SUCCEEDED(rv) && allowed;
|
||||||
}
|
}
|
||||||
@ -1161,15 +1048,6 @@ nsContentUtils::Shutdown()
|
|||||||
for (i = 0; i < PropertiesFile_COUNT; ++i)
|
for (i = 0; i < PropertiesFile_COUNT; ++i)
|
||||||
NS_IF_RELEASE(sStringBundles[i]);
|
NS_IF_RELEASE(sStringBundles[i]);
|
||||||
|
|
||||||
// Clean up c-style's observer
|
|
||||||
if (sPrefCallbackTable) {
|
|
||||||
delete sPrefCallbackTable;
|
|
||||||
sPrefCallbackTable = nsnull;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete sPrefCacheData;
|
|
||||||
sPrefCacheData = nsnull;
|
|
||||||
|
|
||||||
NS_IF_RELEASE(sStringBundleService);
|
NS_IF_RELEASE(sStringBundleService);
|
||||||
NS_IF_RELEASE(sConsoleService);
|
NS_IF_RELEASE(sConsoleService);
|
||||||
NS_IF_RELEASE(sDOMScriptObjectFactory);
|
NS_IF_RELEASE(sDOMScriptObjectFactory);
|
||||||
@ -1187,7 +1065,6 @@ nsContentUtils::Shutdown()
|
|||||||
#endif
|
#endif
|
||||||
NS_IF_RELEASE(sImgLoader);
|
NS_IF_RELEASE(sImgLoader);
|
||||||
NS_IF_RELEASE(sImgCache);
|
NS_IF_RELEASE(sImgCache);
|
||||||
NS_IF_RELEASE(sPrefBranch);
|
|
||||||
#ifdef IBMBIDI
|
#ifdef IBMBIDI
|
||||||
NS_IF_RELEASE(sBidiKeyboard);
|
NS_IF_RELEASE(sBidiKeyboard);
|
||||||
#endif
|
#endif
|
||||||
@ -2580,109 +2457,6 @@ nsContentUtils::IsDraggableLink(const nsIContent* aContent) {
|
|||||||
return aContent->IsLink(getter_AddRefs(absURI));
|
return aContent->IsLink(getter_AddRefs(absURI));
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterPrefCallback/UnregisterPrefCallback are for backward compatiblity
|
|
||||||
// with c-style observers.
|
|
||||||
|
|
||||||
// static
|
|
||||||
void
|
|
||||||
nsContentUtils::RegisterPrefCallback(const char *aPref,
|
|
||||||
PrefChangedFunc aCallback,
|
|
||||||
void * aClosure)
|
|
||||||
{
|
|
||||||
if (sPrefBranch) {
|
|
||||||
if (!sPrefCallbackTable) {
|
|
||||||
sPrefCallbackTable =
|
|
||||||
new nsRefPtrHashtable<nsPrefObserverHashKey, nsPrefOldCallback>();
|
|
||||||
sPrefCallbackTable->Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
nsPrefObserverHashKey hashKey(aPref, aCallback);
|
|
||||||
nsRefPtr<nsPrefOldCallback> callback;
|
|
||||||
sPrefCallbackTable->Get(&hashKey, getter_AddRefs(callback));
|
|
||||||
if (callback) {
|
|
||||||
callback->AppendClosure(aClosure);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
callback = new nsPrefOldCallback(aPref, aCallback);
|
|
||||||
callback->AppendClosure(aClosure);
|
|
||||||
if (NS_SUCCEEDED(sPrefBranch->AddObserver(aPref, callback, PR_FALSE))) {
|
|
||||||
sPrefCallbackTable->Put(callback, callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
|
||||||
void
|
|
||||||
nsContentUtils::UnregisterPrefCallback(const char *aPref,
|
|
||||||
PrefChangedFunc aCallback,
|
|
||||||
void * aClosure)
|
|
||||||
{
|
|
||||||
if (sPrefBranch) {
|
|
||||||
if (!sPrefCallbackTable) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsPrefObserverHashKey hashKey(aPref, aCallback);
|
|
||||||
nsRefPtr<nsPrefOldCallback> callback;
|
|
||||||
sPrefCallbackTable->Get(&hashKey, getter_AddRefs(callback));
|
|
||||||
|
|
||||||
if (callback) {
|
|
||||||
callback->RemoveClosure(aClosure);
|
|
||||||
if (callback->HasNoClosures()) {
|
|
||||||
// Delete the callback since its list of closures is empty.
|
|
||||||
sPrefCallbackTable->Remove(callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
BoolVarChanged(const char *aPref, void *aClosure)
|
|
||||||
{
|
|
||||||
PrefCacheData* cache = static_cast<PrefCacheData*>(aClosure);
|
|
||||||
*((PRBool*)cache->cacheLocation) =
|
|
||||||
Preferences::GetBool(aPref, cache->defaultValueBool);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsContentUtils::AddBoolPrefVarCache(const char *aPref,
|
|
||||||
PRBool* aCache,
|
|
||||||
PRBool aDefault)
|
|
||||||
{
|
|
||||||
*aCache = Preferences::GetBool(aPref, aDefault);
|
|
||||||
PrefCacheData* data = new PrefCacheData;
|
|
||||||
data->cacheLocation = aCache;
|
|
||||||
data->defaultValueBool = aDefault;
|
|
||||||
sPrefCacheData->AppendElement(data);
|
|
||||||
RegisterPrefCallback(aPref, BoolVarChanged, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
IntVarChanged(const char *aPref, void *aClosure)
|
|
||||||
{
|
|
||||||
PrefCacheData* cache = static_cast<PrefCacheData*>(aClosure);
|
|
||||||
*((PRInt32*)cache->cacheLocation) =
|
|
||||||
Preferences::GetInt(aPref, cache->defaultValueInt);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsContentUtils::AddIntPrefVarCache(const char *aPref,
|
|
||||||
PRInt32* aCache,
|
|
||||||
PRInt32 aDefault)
|
|
||||||
{
|
|
||||||
*aCache = Preferences::GetInt(aPref, aDefault);
|
|
||||||
PrefCacheData* data = new PrefCacheData;
|
|
||||||
data->cacheLocation = aCache;
|
|
||||||
data->defaultValueInt = aDefault;
|
|
||||||
sPrefCacheData->AppendElement(data);
|
|
||||||
RegisterPrefCallback(aPref, IntVarChanged, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsContentUtils::IsSitePermAllow(nsIURI* aURI, const char* aType)
|
nsContentUtils::IsSitePermAllow(nsIURI* aURI, const char* aType)
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,9 @@
|
|||||||
#include "nsClassHashtable.h"
|
#include "nsClassHashtable.h"
|
||||||
#include "nsHashKeys.h"
|
#include "nsHashKeys.h"
|
||||||
#include "nsStreamUtils.h"
|
#include "nsStreamUtils.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
#define PREFLIGHT_CACHE_SIZE 100
|
#define PREFLIGHT_CACHE_SIZE 100
|
||||||
|
|
||||||
@ -369,8 +372,10 @@ NS_IMPL_ISUPPORTS5(nsCORSListenerProxy, nsIStreamListener,
|
|||||||
void
|
void
|
||||||
nsCORSListenerProxy::Startup()
|
nsCORSListenerProxy::Startup()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddBoolPrefVarCache("content.cors.disable", &gDisableCORS);
|
Preferences::AddBoolVarCache(&gDisableCORS,
|
||||||
nsContentUtils::AddBoolPrefVarCache("content.cors.no_private_data", &gDisableCORSPrivateData);
|
"content.cors.disable");
|
||||||
|
Preferences::AddBoolVarCache(&gDisableCORSPrivateData,
|
||||||
|
"content.cors.no_private_data");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
@ -54,7 +54,6 @@
|
|||||||
#include "nsIDNSRecord.h"
|
#include "nsIDNSRecord.h"
|
||||||
#include "nsIDNSService.h"
|
#include "nsIDNSService.h"
|
||||||
#include "nsICancelable.h"
|
#include "nsICancelable.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
@ -97,8 +96,8 @@ nsHTMLDNSPrefetch::Initialize()
|
|||||||
|
|
||||||
sPrefetches->Activate();
|
sPrefetches->Activate();
|
||||||
|
|
||||||
nsContentUtils::AddBoolPrefVarCache("network.dns.disablePrefetchFromHTTPS",
|
Preferences::AddBoolVarCache(&sDisablePrefetchHTTPSPref,
|
||||||
&sDisablePrefetchHTTPSPref);
|
"network.dns.disablePrefetchFromHTTPS");
|
||||||
|
|
||||||
// Default is false, so we need an explicit call to prime the cache.
|
// Default is false, so we need an explicit call to prime the cache.
|
||||||
sDisablePrefetchHTTPSPref =
|
sDisablePrefetchHTTPSPref =
|
||||||
|
@ -599,9 +599,8 @@ nsHTMLDocument::StartAutodetection(nsIDocShell *aDocShell, nsACString& aCharset,
|
|||||||
gPlugDetector = PR_TRUE;
|
gPlugDetector = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("intl.charset.detector",
|
Preferences::RegisterCallback(MyPrefChangedCallback,
|
||||||
MyPrefChangedCallback,
|
"intl.charset.detector");
|
||||||
nsnull);
|
|
||||||
|
|
||||||
gInitDetector = PR_TRUE;
|
gInitDetector = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ using namespace mozilla::dom;
|
|||||||
#include "nsAudioStream.h"
|
#include "nsAudioStream.h"
|
||||||
#include "nsAlgorithm.h"
|
#include "nsAlgorithm.h"
|
||||||
#include "VideoUtils.h"
|
#include "VideoUtils.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "mozilla/Mutex.h"
|
#include "mozilla/Mutex.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "sydneyaudio/sydney_audio.h"
|
#include "sydneyaudio/sydney_audio.h"
|
||||||
@ -347,16 +346,12 @@ void nsAudioStream::InitLibrary()
|
|||||||
#endif
|
#endif
|
||||||
gVolumeScaleLock = new mozilla::Mutex("nsAudioStream::gVolumeScaleLock");
|
gVolumeScaleLock = new mozilla::Mutex("nsAudioStream::gVolumeScaleLock");
|
||||||
VolumeScaleChanged(nsnull, nsnull);
|
VolumeScaleChanged(nsnull, nsnull);
|
||||||
nsContentUtils::RegisterPrefCallback("media.volume_scale",
|
Preferences::RegisterCallback(VolumeScaleChanged, "media.volume_scale");
|
||||||
VolumeScaleChanged,
|
|
||||||
nsnull);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsAudioStream::ShutdownLibrary()
|
void nsAudioStream::ShutdownLibrary()
|
||||||
{
|
{
|
||||||
nsContentUtils::UnregisterPrefCallback("media.volume_scale",
|
Preferences::UnregisterCallback(VolumeScaleChanged, "media.volume_scale");
|
||||||
VolumeScaleChanged,
|
|
||||||
nsnull);
|
|
||||||
delete gVolumeScaleLock;
|
delete gVolumeScaleLock;
|
||||||
gVolumeScaleLock = nsnull;
|
gVolumeScaleLock = nsnull;
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "nsIDOMLoadListener.h"
|
#include "nsIDOMLoadListener.h"
|
||||||
#include "nsIDOMEventGroup.h"
|
#include "nsIDOMEventGroup.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
#define NS_MAX_XBL_BINDING_RECURSION 20
|
#define NS_MAX_XBL_BINDING_RECURSION 20
|
||||||
|
|
||||||
@ -511,9 +514,8 @@ nsXBLService::nsXBLService(void)
|
|||||||
if (gRefCnt == 1) {
|
if (gRefCnt == 1) {
|
||||||
gClassTable = new nsHashtable();
|
gClassTable = new nsHashtable();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentUtils::AddBoolPrefVarCache("layout.debug.enable_data_xbl",
|
Preferences::AddBoolVarCache(&gAllowDataURIs, "layout.debug.enable_data_xbl");
|
||||||
&gAllowDataURIs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsXBLService::~nsXBLService(void)
|
nsXBLService::~nsXBLService(void)
|
||||||
|
@ -128,7 +128,9 @@
|
|||||||
#include "nsCCUncollectableMarker.h"
|
#include "nsCCUncollectableMarker.h"
|
||||||
#include "nsURILoader.h"
|
#include "nsURILoader.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -278,9 +280,8 @@ nsXULDocument::~nsXULDocument()
|
|||||||
|
|
||||||
delete mTemplateBuilderTable;
|
delete mTemplateBuilderTable;
|
||||||
|
|
||||||
nsContentUtils::UnregisterPrefCallback("intl.uidirection.",
|
Preferences::UnregisterCallback(nsXULDocument::DirectionChanged,
|
||||||
nsXULDocument::DirectionChanged,
|
"intl.uidirection.", this);
|
||||||
this);
|
|
||||||
|
|
||||||
if (--gRefCnt == 0) {
|
if (--gRefCnt == 0) {
|
||||||
NS_IF_RELEASE(gRDFService);
|
NS_IF_RELEASE(gRDFService);
|
||||||
@ -1984,9 +1985,8 @@ nsXULDocument::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("intl.uidirection.",
|
Preferences::RegisterCallback(nsXULDocument::DirectionChanged,
|
||||||
nsXULDocument::DirectionChanged,
|
"intl.uidirection.", this);
|
||||||
this);
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
if (! gXULLog)
|
if (! gXULLog)
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include "nsXULPrototypeCache.h"
|
#include "nsXULPrototypeCache.h"
|
||||||
|
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "nsXULPrototypeDocument.h"
|
#include "nsXULPrototypeDocument.h"
|
||||||
#include "nsCSSStyleSheet.h"
|
#include "nsCSSStyleSheet.h"
|
||||||
@ -137,9 +136,8 @@ NS_NewXULPrototypeCache(nsISupports* aOuter, REFNSIID aIID, void** aResult)
|
|||||||
// XXX Ignore return values.
|
// XXX Ignore return values.
|
||||||
gDisableXULCache =
|
gDisableXULCache =
|
||||||
Preferences::GetBool(kDisableXULCachePref, gDisableXULCache);
|
Preferences::GetBool(kDisableXULCachePref, gDisableXULCache);
|
||||||
nsContentUtils::RegisterPrefCallback(kDisableXULCachePref,
|
Preferences::RegisterCallback(DisableXULCacheChangedCallback,
|
||||||
DisableXULCacheChangedCallback,
|
kDisableXULCachePref);
|
||||||
nsnull);
|
|
||||||
|
|
||||||
nsresult rv = result->QueryInterface(aIID, aResult);
|
nsresult rv = result->QueryInterface(aIID, aResult);
|
||||||
|
|
||||||
@ -732,12 +730,10 @@ nsXULPrototypeCache::StartFastLoad(nsIURI* aURI)
|
|||||||
gChecksumXULFastLoadFile =
|
gChecksumXULFastLoadFile =
|
||||||
Preferences::GetBool(kChecksumXULFastLoadFilePref,
|
Preferences::GetBool(kChecksumXULFastLoadFilePref,
|
||||||
gChecksumXULFastLoadFile);
|
gChecksumXULFastLoadFile);
|
||||||
nsContentUtils::RegisterPrefCallback(kDisableXULFastLoadPref,
|
Preferences::RegisterCallback(FastLoadPrefChangedCallback,
|
||||||
FastLoadPrefChangedCallback,
|
kDisableXULFastLoadPref);
|
||||||
nsnull);
|
Preferences::RegisterCallback(FastLoadPrefChangedCallback,
|
||||||
nsContentUtils::RegisterPrefCallback(kChecksumXULFastLoadFilePref,
|
kChecksumXULFastLoadFilePref);
|
||||||
FastLoadPrefChangedCallback,
|
|
||||||
nsnull);
|
|
||||||
|
|
||||||
if (gDisableXULFastLoad)
|
if (gDisableXULFastLoad)
|
||||||
return NS_ERROR_NOT_AVAILABLE;
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
|
@ -907,15 +907,15 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
|||||||
|
|
||||||
if (gRefCnt == 1) {
|
if (gRefCnt == 1) {
|
||||||
#if !(defined(NS_DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
|
#if !(defined(NS_DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
|
||||||
nsContentUtils::AddBoolPrefVarCache("browser.dom.window.dump.enabled",
|
Preferences::AddBoolVarCache(&gDOMWindowDumpEnabled,
|
||||||
&gDOMWindowDumpEnabled);
|
"browser.dom.window.dump.enabled");
|
||||||
#endif
|
#endif
|
||||||
nsContentUtils::AddIntPrefVarCache("dom.min_timeout_value",
|
Preferences::AddIntVarCache(&gMinTimeoutValue,
|
||||||
&gMinTimeoutValue,
|
"dom.min_timeout_value",
|
||||||
DEFAULT_MIN_TIMEOUT_VALUE);
|
DEFAULT_MIN_TIMEOUT_VALUE);
|
||||||
nsContentUtils::AddIntPrefVarCache("dom.min_background_timeout_value",
|
Preferences::AddIntVarCache(&gMinBackgroundTimeoutValue,
|
||||||
&gMinBackgroundTimeoutValue,
|
"dom.min_background_timeout_value",
|
||||||
DEFAULT_MIN_BACKGROUND_TIMEOUT_VALUE);
|
DEFAULT_MIN_BACKGROUND_TIMEOUT_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gDumpFile == nsnull) {
|
if (gDumpFile == nsnull) {
|
||||||
|
@ -1035,9 +1035,8 @@ nsJSContext::nsJSContext(JSRuntime *aRuntime)
|
|||||||
::JS_SetOptions(mContext, mDefaultJSOptions);
|
::JS_SetOptions(mContext, mDefaultJSOptions);
|
||||||
|
|
||||||
// Watch for the JS boolean options
|
// Watch for the JS boolean options
|
||||||
nsContentUtils::RegisterPrefCallback(js_options_dot_str,
|
Preferences::RegisterCallback(JSOptionChangedCallback,
|
||||||
JSOptionChangedCallback,
|
js_options_dot_str, this);
|
||||||
this);
|
|
||||||
|
|
||||||
::JS_SetOperationCallback(mContext, DOMOperationCallback);
|
::JS_SetOperationCallback(mContext, DOMOperationCallback);
|
||||||
|
|
||||||
@ -1089,9 +1088,8 @@ nsJSContext::DestroyJSContext()
|
|||||||
::JS_SetContextPrivate(mContext, nsnull);
|
::JS_SetContextPrivate(mContext, nsnull);
|
||||||
|
|
||||||
// Unregister our "javascript.options.*" pref-changed callback.
|
// Unregister our "javascript.options.*" pref-changed callback.
|
||||||
nsContentUtils::UnregisterPrefCallback(js_options_dot_str,
|
Preferences::UnregisterCallback(JSOptionChangedCallback,
|
||||||
JSOptionChangedCallback,
|
js_options_dot_str, this);
|
||||||
this);
|
|
||||||
|
|
||||||
PRBool do_gc = mGCOnDestruction && !sGCTimer;
|
PRBool do_gc = mGCOnDestruction && !sGCTimer;
|
||||||
|
|
||||||
@ -3763,38 +3761,32 @@ nsJSRuntime::Init()
|
|||||||
JS_SetStructuredCloneCallbacks(sRuntime, &cloneCallbacks);
|
JS_SetStructuredCloneCallbacks(sRuntime, &cloneCallbacks);
|
||||||
|
|
||||||
// Set these global xpconnect options...
|
// Set these global xpconnect options...
|
||||||
nsContentUtils::RegisterPrefCallback("dom.max_script_run_time",
|
Preferences::RegisterCallback(MaxScriptRunTimePrefChangedCallback,
|
||||||
MaxScriptRunTimePrefChangedCallback,
|
"dom.max_script_run_time");
|
||||||
nsnull);
|
|
||||||
MaxScriptRunTimePrefChangedCallback("dom.max_script_run_time", nsnull);
|
MaxScriptRunTimePrefChangedCallback("dom.max_script_run_time", nsnull);
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("dom.max_chrome_script_run_time",
|
Preferences::RegisterCallback(MaxScriptRunTimePrefChangedCallback,
|
||||||
MaxScriptRunTimePrefChangedCallback,
|
"dom.max_chrome_script_run_time");
|
||||||
nsnull);
|
|
||||||
MaxScriptRunTimePrefChangedCallback("dom.max_chrome_script_run_time",
|
MaxScriptRunTimePrefChangedCallback("dom.max_chrome_script_run_time",
|
||||||
nsnull);
|
nsnull);
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("dom.report_all_js_exceptions",
|
Preferences::RegisterCallback(ReportAllJSExceptionsPrefChangedCallback,
|
||||||
ReportAllJSExceptionsPrefChangedCallback,
|
"dom.report_all_js_exceptions");
|
||||||
nsnull);
|
|
||||||
ReportAllJSExceptionsPrefChangedCallback("dom.report_all_js_exceptions",
|
ReportAllJSExceptionsPrefChangedCallback("dom.report_all_js_exceptions",
|
||||||
nsnull);
|
nsnull);
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("javascript.options.mem.high_water_mark",
|
Preferences::RegisterCallback(SetMemoryHighWaterMarkPrefChangedCallback,
|
||||||
SetMemoryHighWaterMarkPrefChangedCallback,
|
"javascript.options.mem.high_water_mark");
|
||||||
nsnull);
|
|
||||||
SetMemoryHighWaterMarkPrefChangedCallback("javascript.options.mem.high_water_mark",
|
SetMemoryHighWaterMarkPrefChangedCallback("javascript.options.mem.high_water_mark",
|
||||||
nsnull);
|
nsnull);
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("javascript.options.mem.max",
|
Preferences::RegisterCallback(SetMemoryMaxPrefChangedCallback,
|
||||||
SetMemoryMaxPrefChangedCallback,
|
"javascript.options.mem.max");
|
||||||
nsnull);
|
|
||||||
SetMemoryMaxPrefChangedCallback("javascript.options.mem.max",
|
SetMemoryMaxPrefChangedCallback("javascript.options.mem.max",
|
||||||
nsnull);
|
nsnull);
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("javascript.options.mem.gc_per_compartment",
|
Preferences::RegisterCallback(SetMemoryGCModePrefChangedCallback,
|
||||||
SetMemoryGCModePrefChangedCallback,
|
"javascript.options.mem.gc_per_compartment");
|
||||||
nsnull);
|
|
||||||
SetMemoryGCModePrefChangedCallback("javascript.options.mem.gc_per_compartment",
|
SetMemoryGCModePrefChangedCallback("javascript.options.mem.gc_per_compartment",
|
||||||
nsnull);
|
nsnull);
|
||||||
|
|
||||||
|
@ -67,6 +67,9 @@
|
|||||||
#include "IndexedDatabaseManager.h"
|
#include "IndexedDatabaseManager.h"
|
||||||
#include "LazyIdleThread.h"
|
#include "LazyIdleThread.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
#define PREF_INDEXEDDB_QUOTA "dom.indexedDB.warningQuota"
|
#define PREF_INDEXEDDB_QUOTA "dom.indexedDB.warningQuota"
|
||||||
|
|
||||||
@ -536,8 +539,8 @@ IDBFactory::Create(nsPIDOMWindow* aWindow)
|
|||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentUtils::AddIntPrefVarCache(PREF_INDEXEDDB_QUOTA, &gIndexedDBQuota,
|
Preferences::AddIntVarCache(&gIndexedDBQuota, PREF_INDEXEDDB_QUOTA,
|
||||||
DEFAULT_QUOTA);
|
DEFAULT_QUOTA);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRefPtr<IDBFactory> factory = new IDBFactory();
|
nsRefPtr<IDBFactory> factory = new IDBFactory();
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
#include "PluginIdentifierParent.h"
|
#include "PluginIdentifierParent.h"
|
||||||
|
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
@ -127,7 +126,7 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
|
|||||||
NS_ERROR("Out of memory");
|
NS_ERROR("Out of memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback(kTimeoutPref, TimeoutChanged, this);
|
Preferences::RegisterCallback(TimeoutChanged, kTimeoutPref, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginModuleParent::~PluginModuleParent()
|
PluginModuleParent::~PluginModuleParent()
|
||||||
@ -152,7 +151,7 @@ PluginModuleParent::~PluginModuleParent()
|
|||||||
mSubprocess = nsnull;
|
mSubprocess = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsContentUtils::UnregisterPrefCallback(kTimeoutPref, TimeoutChanged, this);
|
Preferences::UnregisterCallback(TimeoutChanged, kTimeoutPref, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
@ -518,16 +518,13 @@ nsresult nsGeolocationService::Init()
|
|||||||
{
|
{
|
||||||
mTimeout = Preferences::GetInt("geo.timeout", 6000);
|
mTimeout = Preferences::GetInt("geo.timeout", 6000);
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("geo.ignore.location_filter",
|
Preferences::RegisterCallback(GeoIgnoreLocationFilterChangedCallback,
|
||||||
GeoIgnoreLocationFilterChangedCallback,
|
"geo.ignore.location_filter");
|
||||||
nsnull);
|
|
||||||
|
|
||||||
GeoIgnoreLocationFilterChangedCallback("geo.ignore.location_filter", nsnull);
|
GeoIgnoreLocationFilterChangedCallback("geo.ignore.location_filter", nsnull);
|
||||||
|
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback("geo.enabled",
|
Preferences::RegisterCallback(GeoEnabledChangedCallback, "geo.enabled");
|
||||||
GeoEnabledChangedCallback,
|
|
||||||
nsnull);
|
|
||||||
|
|
||||||
GeoEnabledChangedCallback("geo.enabled", nsnull);
|
GeoEnabledChangedCallback("geo.enabled", nsnull);
|
||||||
|
|
||||||
|
@ -1567,8 +1567,7 @@ nsDOMThreadService::RegisterPrefCallbacks()
|
|||||||
{
|
{
|
||||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||||
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(sPrefsToWatch); index++) {
|
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(sPrefsToWatch); index++) {
|
||||||
nsContentUtils::RegisterPrefCallback(sPrefsToWatch[index], PrefCallback,
|
Preferences::RegisterCallback(PrefCallback, sPrefsToWatch[index]);
|
||||||
nsnull);
|
|
||||||
PrefCallback(sPrefsToWatch[index], nsnull);
|
PrefCallback(sPrefsToWatch[index], nsnull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1578,8 +1577,7 @@ nsDOMThreadService::UnregisterPrefCallbacks()
|
|||||||
{
|
{
|
||||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||||
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(sPrefsToWatch); index++) {
|
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(sPrefsToWatch); index++) {
|
||||||
nsContentUtils::UnregisterPrefCallback(sPrefsToWatch[index], PrefCallback,
|
Preferences::UnregisterCallback(PrefCallback, sPrefsToWatch[index]);
|
||||||
nsnull);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,13 +196,11 @@ nsPlaintextEditor::GetDefaultEditorPrefs(PRInt32 &aNewlineHandling,
|
|||||||
PRInt32 &aCaretStyle)
|
PRInt32 &aCaretStyle)
|
||||||
{
|
{
|
||||||
if (sNewlineHandlingPref == -1) {
|
if (sNewlineHandlingPref == -1) {
|
||||||
nsContentUtils::RegisterPrefCallback("editor.singleLine.pasteNewlines",
|
Preferences::RegisterCallback(EditorPrefsChangedCallback,
|
||||||
EditorPrefsChangedCallback,
|
"editor.singleLine.pasteNewlines");
|
||||||
nsnull);
|
|
||||||
EditorPrefsChangedCallback("editor.singleLine.pasteNewlines", nsnull);
|
EditorPrefsChangedCallback("editor.singleLine.pasteNewlines", nsnull);
|
||||||
nsContentUtils::RegisterPrefCallback("layout.selection.caret_style",
|
Preferences::RegisterCallback(EditorPrefsChangedCallback,
|
||||||
EditorPrefsChangedCallback,
|
"layout.selection.caret_style");
|
||||||
nsnull);
|
|
||||||
EditorPrefsChangedCallback("layout.selection.caret_style", nsnull);
|
EditorPrefsChangedCallback("layout.selection.caret_style", nsnull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ LayerManagerD3D9::Initialize()
|
|||||||
/* XXX: this preference and blacklist code should move out of the layer manager */
|
/* XXX: this preference and blacklist code should move out of the layer manager */
|
||||||
PRBool forceAccelerate = PR_FALSE;
|
PRBool forceAccelerate = PR_FALSE;
|
||||||
if (prefs) {
|
if (prefs) {
|
||||||
// we should use AddBoolPrefVarCache
|
// we should use Preferences::AddBoolVarCache
|
||||||
prefs->GetBoolPref("layers.acceleration.force-enabled",
|
prefs->GetBoolPref("layers.acceleration.force-enabled",
|
||||||
&forceAccelerate);
|
&forceAccelerate);
|
||||||
}
|
}
|
||||||
|
@ -289,42 +289,44 @@ nsPresContext::~nsPresContext()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unregister preference callbacks
|
// Unregister preference callbacks
|
||||||
nsContentUtils::UnregisterPrefCallback("font.",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"font.",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("browser.display.",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.display.",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("browser.underline_anchors",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.underline_anchors",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("browser.anchor_color",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.anchor_color",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("browser.active_color",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.active_color",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("browser.visited_color",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.visited_color",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("image.animation_mode",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"image.animation_mode",
|
||||||
this);
|
this);
|
||||||
#ifdef IBMBIDI
|
#ifdef IBMBIDI
|
||||||
nsContentUtils::UnregisterPrefCallback("bidi.", PrefChangedCallback, this);
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
|
"bidi.",
|
||||||
|
this);
|
||||||
#endif // IBMBIDI
|
#endif // IBMBIDI
|
||||||
nsContentUtils::UnregisterPrefCallback("dom.send_after_paint_to_content",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"dom.send_after_paint_to_content",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("gfx.font_rendering.",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"gfx.font_rendering.",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("layout.css.dpi",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"layout.css.dpi",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::UnregisterPrefCallback("layout.css.devPixelsPerPx",
|
Preferences::UnregisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"layout.css.devPixelsPerPx",
|
||||||
this);
|
this);
|
||||||
|
|
||||||
NS_IF_RELEASE(mDeviceContext);
|
NS_IF_RELEASE(mDeviceContext);
|
||||||
NS_IF_RELEASE(mLookAndFeel);
|
NS_IF_RELEASE(mLookAndFeel);
|
||||||
@ -955,42 +957,44 @@ nsPresContext::Init(nsDeviceContext* aDeviceContext)
|
|||||||
mLangService = do_GetService(NS_LANGUAGEATOMSERVICE_CONTRACTID);
|
mLangService = do_GetService(NS_LANGUAGEATOMSERVICE_CONTRACTID);
|
||||||
|
|
||||||
// Register callbacks so we're notified when the preferences change
|
// Register callbacks so we're notified when the preferences change
|
||||||
nsContentUtils::RegisterPrefCallback("font.",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"font.",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("browser.display.",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.display.",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("browser.underline_anchors",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.underline_anchors",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("browser.anchor_color",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.anchor_color",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("browser.active_color",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.active_color",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("browser.visited_color",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"browser.visited_color",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("image.animation_mode",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"image.animation_mode",
|
||||||
this);
|
this);
|
||||||
#ifdef IBMBIDI
|
#ifdef IBMBIDI
|
||||||
nsContentUtils::RegisterPrefCallback("bidi.", PrefChangedCallback,
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
this);
|
"bidi.",
|
||||||
|
this);
|
||||||
#endif
|
#endif
|
||||||
nsContentUtils::RegisterPrefCallback("dom.send_after_paint_to_content",
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
nsPresContext::PrefChangedCallback,
|
"dom.send_after_paint_to_content",
|
||||||
this);
|
this);
|
||||||
nsContentUtils::RegisterPrefCallback("gfx.font_rendering.", PrefChangedCallback,
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
this);
|
"gfx.font_rendering.",
|
||||||
nsContentUtils::RegisterPrefCallback("layout.css.dpi",
|
this);
|
||||||
nsPresContext::PrefChangedCallback,
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
this);
|
"layout.css.dpi",
|
||||||
nsContentUtils::RegisterPrefCallback("layout.css.devPixelsPerPx",
|
this);
|
||||||
nsPresContext::PrefChangedCallback,
|
Preferences::RegisterCallback(nsPresContext::PrefChangedCallback,
|
||||||
this);
|
"layout.css.devPixelsPerPx",
|
||||||
|
this);
|
||||||
|
|
||||||
rv = mEventManager->Init();
|
rv = mEventManager->Init();
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
@ -1720,8 +1720,8 @@ PresShell::PresShell()
|
|||||||
if (!registeredReporter) {
|
if (!registeredReporter) {
|
||||||
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(LayoutPresShell));
|
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(LayoutPresShell));
|
||||||
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(LayoutBidi));
|
NS_RegisterMemoryReporter(new NS_MEMORY_REPORTER_NAME(LayoutBidi));
|
||||||
nsContentUtils::AddBoolPrefVarCache("layout.reflow.synthMouseMove",
|
Preferences::AddBoolVarCache(&sSynthMouseMove,
|
||||||
&sSynthMouseMove, PR_TRUE);
|
"layout.reflow.synthMouseMove", PR_TRUE);
|
||||||
registeredReporter = true;
|
registeredReporter = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ static PRBool sPrecisePref;
|
|||||||
/* static */ void
|
/* static */ void
|
||||||
nsRefreshDriver::InitializeStatics()
|
nsRefreshDriver::InitializeStatics()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddBoolPrefVarCache("layout.frame_rate.precise",
|
Preferences::AddBoolVarCache(&sPrecisePref,
|
||||||
&sPrecisePref,
|
"layout.frame_rate.precise",
|
||||||
PR_FALSE);
|
PR_FALSE);
|
||||||
}
|
}
|
||||||
// Compute the interval to use for the refresh driver timer, in
|
// Compute the interval to use for the refresh driver timer, in
|
||||||
// milliseconds
|
// milliseconds
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsFrameSetFrame.h"
|
#include "nsFrameSetFrame.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "nsGenericHTMLElement.h"
|
#include "nsGenericHTMLElement.h"
|
||||||
#include "nsLeafFrame.h"
|
#include "nsLeafFrame.h"
|
||||||
#include "nsHTMLContainerFrame.h"
|
#include "nsHTMLContainerFrame.h"
|
||||||
@ -241,8 +240,8 @@ nsHTMLFramesetFrame::~nsHTMLFramesetFrame()
|
|||||||
delete[] mChildFrameborder;
|
delete[] mChildFrameborder;
|
||||||
delete[] mChildBorderColors;
|
delete[] mChildBorderColors;
|
||||||
|
|
||||||
nsContentUtils::UnregisterPrefCallback(kFrameResizePref,
|
Preferences::UnregisterCallback(FrameResizePrefCallback,
|
||||||
FrameResizePrefCallback, this);
|
kFrameResizePref, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_QUERYFRAME_HEAD(nsHTMLFramesetFrame)
|
NS_QUERYFRAME_HEAD(nsHTMLFramesetFrame)
|
||||||
@ -974,8 +973,8 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool firstTime = (GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0;
|
PRBool firstTime = (GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0;
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
nsContentUtils::RegisterPrefCallback(kFrameResizePref,
|
Preferences::RegisterCallback(FrameResizePrefCallback,
|
||||||
FrameResizePrefCallback, this);
|
kFrameResizePref, this);
|
||||||
mForceFrameResizability = Preferences::GetBool(kFrameResizePref);
|
mForceFrameResizability = Preferences::GetBool(kFrameResizePref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@
|
|||||||
#include "nsTableCellFrame.h"
|
#include "nsTableCellFrame.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsIPercentHeightObserver.h"
|
#include "nsIPercentHeightObserver.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#ifdef IBMBIDI
|
#ifdef IBMBIDI
|
||||||
@ -1626,8 +1625,7 @@ static PRBool BlinkIsAllowed(void)
|
|||||||
{
|
{
|
||||||
if (!sPrefIsLoaded) {
|
if (!sPrefIsLoaded) {
|
||||||
// Set up a listener and check the initial value
|
// Set up a listener and check the initial value
|
||||||
nsContentUtils::RegisterPrefCallback("browser.blink_allowed", PrefsChanged,
|
Preferences::RegisterCallback(PrefsChanged, "browser.blink_allowed");
|
||||||
nsnull);
|
|
||||||
PrefsChanged(nsnull, nsnull);
|
PrefsChanged(nsnull, nsnull);
|
||||||
sPrefIsLoaded = PR_TRUE;
|
sPrefIsLoaded = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -962,10 +962,8 @@ NS_IMPL_ISUPPORTS1(nsCSSRuleProcessor, nsIStyleRuleProcessor)
|
|||||||
/* static */ nsresult
|
/* static */ nsresult
|
||||||
nsCSSRuleProcessor::Startup()
|
nsCSSRuleProcessor::Startup()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddBoolPrefVarCache(VISITED_PSEUDO_PREF,
|
Preferences::AddBoolVarCache(&gSupportVisitedPseudo, VISITED_PSEUDO_PREF,
|
||||||
&gSupportVisitedPseudo);
|
PR_TRUE);
|
||||||
// We want to default to true, not false as AddBoolPrefVarCache does.
|
|
||||||
gSupportVisitedPseudo = Preferences::GetBool(VISITED_PSEUDO_PREF, PR_TRUE);
|
|
||||||
|
|
||||||
gPrivateBrowsingObserver = new nsPrivateBrowsingObserver();
|
gPrivateBrowsingObserver = new nsPrivateBrowsingObserver();
|
||||||
NS_ENSURE_TRUE(gPrivateBrowsingObserver, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(gPrivateBrowsingObserver, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include "nsIConsoleService.h"
|
#include "nsIConsoleService.h"
|
||||||
#include "nsIScriptError.h"
|
#include "nsIScriptError.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsIDocument.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/css/Loader.h"
|
#include "mozilla/css/Loader.h"
|
||||||
#include "nsCSSStyleSheet.h"
|
#include "nsCSSStyleSheet.h"
|
||||||
@ -348,7 +348,7 @@ nsCSSScanner::InitGlobals()
|
|||||||
NS_ASSERTION(gConsoleService && gScriptErrorFactory,
|
NS_ASSERTION(gConsoleService && gScriptErrorFactory,
|
||||||
"unexpected null pointer without failure");
|
"unexpected null pointer without failure");
|
||||||
|
|
||||||
nsContentUtils::RegisterPrefCallback(CSS_ERRORS_PREF, CSSErrorsPrefChanged, nsnull);
|
Preferences::RegisterCallback(CSSErrorsPrefChanged, CSS_ERRORS_PREF);
|
||||||
CSSErrorsPrefChanged(CSS_ERRORS_PREF, nsnull);
|
CSSErrorsPrefChanged(CSS_ERRORS_PREF, nsnull);
|
||||||
#endif
|
#endif
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
@ -358,7 +358,7 @@ nsCSSScanner::InitGlobals()
|
|||||||
nsCSSScanner::ReleaseGlobals()
|
nsCSSScanner::ReleaseGlobals()
|
||||||
{
|
{
|
||||||
#ifdef CSS_REPORT_PARSE_ERRORS
|
#ifdef CSS_REPORT_PARSE_ERRORS
|
||||||
nsContentUtils::UnregisterPrefCallback(CSS_ERRORS_PREF, CSSErrorsPrefChanged, nsnull);
|
Preferences::UnregisterCallback(CSSErrorsPrefChanged, CSS_ERRORS_PREF);
|
||||||
NS_IF_RELEASE(gConsoleService);
|
NS_IF_RELEASE(gConsoleService);
|
||||||
NS_IF_RELEASE(gScriptErrorFactory);
|
NS_IF_RELEASE(gScriptErrorFactory);
|
||||||
NS_IF_RELEASE(gStringBundle);
|
NS_IF_RELEASE(gStringBundle);
|
||||||
|
@ -189,7 +189,7 @@ NS_SMILEnabled()
|
|||||||
if (!sInitialized) {
|
if (!sInitialized) {
|
||||||
/* check and register ourselves with the pref */
|
/* check and register ourselves with the pref */
|
||||||
gSMILEnabled = Preferences::GetBool(SMIL_PREF_STR);
|
gSMILEnabled = Preferences::GetBool(SMIL_PREF_STR);
|
||||||
nsContentUtils::RegisterPrefCallback(SMIL_PREF_STR, SMILPrefChanged, nsnull);
|
Preferences::RegisterCallback(SMILPrefChanged, SMIL_PREF_STR);
|
||||||
|
|
||||||
sInitialized = PR_TRUE;
|
sInitialized = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
#include "nsIPrivateDOMEvent.h"
|
#include "nsIPrivateDOMEvent.h"
|
||||||
#include "nsIScriptContext.h"
|
#include "nsIScriptContext.h"
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#ifdef MOZ_XUL
|
#ifdef MOZ_XUL
|
||||||
#include "nsXULPopupManager.h"
|
#include "nsXULPopupManager.h"
|
||||||
#endif
|
#endif
|
||||||
@ -82,8 +81,8 @@ nsXULTooltipListener::nsXULTooltipListener()
|
|||||||
{
|
{
|
||||||
if (sTooltipListenerCount++ == 0) {
|
if (sTooltipListenerCount++ == 0) {
|
||||||
// register the callback so we get notified of updates
|
// register the callback so we get notified of updates
|
||||||
nsContentUtils::RegisterPrefCallback("browser.chrome.toolbar_tips",
|
Preferences::RegisterCallback(ToolbarTipsPrefChanged,
|
||||||
ToolbarTipsPrefChanged, nsnull);
|
"browser.chrome.toolbar_tips");
|
||||||
|
|
||||||
// Call the pref callback to initialize our state.
|
// Call the pref callback to initialize our state.
|
||||||
ToolbarTipsPrefChanged("browser.chrome.toolbar_tips", nsnull);
|
ToolbarTipsPrefChanged("browser.chrome.toolbar_tips", nsnull);
|
||||||
@ -99,8 +98,8 @@ nsXULTooltipListener::~nsXULTooltipListener()
|
|||||||
|
|
||||||
if (--sTooltipListenerCount == 0) {
|
if (--sTooltipListenerCount == 0) {
|
||||||
// Unregister our pref observer
|
// Unregister our pref observer
|
||||||
nsContentUtils::UnregisterPrefCallback("browser.chrome.toolbar_tips",
|
Preferences::UnregisterCallback(ToolbarTipsPrefChanged,
|
||||||
ToolbarTipsPrefChanged, nsnull);
|
"browser.chrome.toolbar_tips");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,11 @@ class nsString;
|
|||||||
class nsAdoptingString;
|
class nsAdoptingString;
|
||||||
class nsAdoptingCString;
|
class nsAdoptingCString;
|
||||||
|
|
||||||
|
#ifndef have_PrefChangedFunc_typedef
|
||||||
|
typedef int (*PR_CALLBACK PrefChangedFunc)(const char *, void *);
|
||||||
|
#define have_PrefChangedFunc_typedef
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
class Preferences : public nsIPrefService,
|
class Preferences : public nsIPrefService,
|
||||||
@ -204,6 +209,32 @@ public:
|
|||||||
static nsresult RemoveObservers(nsIObserver* aObserver,
|
static nsresult RemoveObservers(nsIObserver* aObserver,
|
||||||
const char** aPrefs);
|
const char** aPrefs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers/Unregisters the callback function for the aPref.
|
||||||
|
*/
|
||||||
|
static nsresult RegisterCallback(PrefChangedFunc aCallback,
|
||||||
|
const char* aPref,
|
||||||
|
void* aClosure = nsnull);
|
||||||
|
static nsresult UnregisterCallback(PrefChangedFunc aCallback,
|
||||||
|
const char* aPref,
|
||||||
|
void* aClosure = nsnull);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the aVariable to cache table. aVariable must be a pointer for a
|
||||||
|
* static variable. The value will be modified when the pref value is
|
||||||
|
* changed but note that even if you modified it, the value isn't assigned to
|
||||||
|
* the pref.
|
||||||
|
*/
|
||||||
|
static nsresult AddBoolVarCache(PRBool* aVariable,
|
||||||
|
const char* aPref,
|
||||||
|
PRBool aDefault = PR_FALSE);
|
||||||
|
static nsresult AddIntVarCache(PRInt32* aVariable,
|
||||||
|
const char* aPref,
|
||||||
|
PRInt32 aDefault = 0);
|
||||||
|
static nsresult AddUintVarCache(PRUint32* aVariable,
|
||||||
|
const char* aPref,
|
||||||
|
PRUint32 aDefault = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsresult NotifyServiceObservers(const char *aSubject);
|
nsresult NotifyServiceObservers(const char *aSubject);
|
||||||
nsresult UseDefaultPrefFile();
|
nsresult UseDefaultPrefFile();
|
||||||
|
@ -73,6 +73,9 @@
|
|||||||
#include "mozilla/Omnijar.h"
|
#include "mozilla/Omnijar.h"
|
||||||
#include "nsZipArchive.h"
|
#include "nsZipArchive.h"
|
||||||
|
|
||||||
|
#include "nsTArray.h"
|
||||||
|
#include "nsRefPtrHashtable.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
// Definitions
|
// Definitions
|
||||||
@ -87,6 +90,105 @@ static nsresult pref_LoadPrefsInDirList(const char *listId);
|
|||||||
Preferences* Preferences::sPreferences = nsnull;
|
Preferences* Preferences::sPreferences = nsnull;
|
||||||
PRBool Preferences::sShutdown = PR_FALSE;
|
PRBool Preferences::sShutdown = PR_FALSE;
|
||||||
|
|
||||||
|
class ValueObserverHashKey : public PLDHashEntryHdr {
|
||||||
|
public:
|
||||||
|
typedef ValueObserverHashKey* KeyType;
|
||||||
|
typedef const ValueObserverHashKey* KeyTypePointer;
|
||||||
|
|
||||||
|
static const ValueObserverHashKey* KeyToPointer(ValueObserverHashKey *aKey)
|
||||||
|
{
|
||||||
|
return aKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PLDHashNumber HashKey(const ValueObserverHashKey *aKey)
|
||||||
|
{
|
||||||
|
PRUint32 strHash = nsCRT::HashCode(aKey->mPrefName.BeginReading(),
|
||||||
|
aKey->mPrefName.Length());
|
||||||
|
return PR_ROTATE_LEFT32(strHash, 4) ^ NS_PTR_TO_UINT32(aKey->mCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
ValueObserverHashKey(const char *aPref, PrefChangedFunc aCallback) :
|
||||||
|
mPrefName(aPref), mCallback(aCallback) { }
|
||||||
|
|
||||||
|
ValueObserverHashKey(const ValueObserverHashKey *aOther) :
|
||||||
|
mPrefName(aOther->mPrefName), mCallback(aOther->mCallback)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
PRBool KeyEquals(const ValueObserverHashKey *aOther) const
|
||||||
|
{
|
||||||
|
return mCallback == aOther->mCallback && mPrefName == aOther->mPrefName;
|
||||||
|
}
|
||||||
|
|
||||||
|
ValueObserverHashKey *GetKey() const
|
||||||
|
{
|
||||||
|
return const_cast<ValueObserverHashKey*>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum { ALLOW_MEMMOVE = PR_TRUE };
|
||||||
|
|
||||||
|
nsCString mPrefName;
|
||||||
|
PrefChangedFunc mCallback;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ValueObserver : public nsIObserver,
|
||||||
|
public ValueObserverHashKey
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NS_DECL_ISUPPORTS
|
||||||
|
NS_DECL_NSIOBSERVER
|
||||||
|
|
||||||
|
ValueObserver(const char *aPref, PrefChangedFunc aCallback)
|
||||||
|
: ValueObserverHashKey(aPref, aCallback) { }
|
||||||
|
|
||||||
|
~ValueObserver() {
|
||||||
|
Preferences::RemoveObserver(this, mPrefName.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppendClosure(void *aClosure) {
|
||||||
|
mClosures.AppendElement(aClosure);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveClosure(void *aClosure) {
|
||||||
|
mClosures.RemoveElement(aClosure);
|
||||||
|
}
|
||||||
|
|
||||||
|
PRBool HasNoClosures() {
|
||||||
|
return mClosures.Length() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsTArray<void*> mClosures;
|
||||||
|
};
|
||||||
|
|
||||||
|
NS_IMPL_ISUPPORTS1(ValueObserver, nsIObserver)
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
ValueObserver::Observe(nsISupports *aSubject,
|
||||||
|
const char *aTopic,
|
||||||
|
const PRUnichar *aData)
|
||||||
|
{
|
||||||
|
NS_ASSERTION(!nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID),
|
||||||
|
"invalid topic");
|
||||||
|
NS_ConvertUTF16toUTF8 data(aData);
|
||||||
|
for (PRUint32 i = 0; i < mClosures.Length(); i++) {
|
||||||
|
mCallback(data.get(), mClosures.ElementAt(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct CacheData {
|
||||||
|
void* cacheLocation;
|
||||||
|
union {
|
||||||
|
PRBool defaultValueBool;
|
||||||
|
PRInt32 defaultValueInt;
|
||||||
|
PRUint32 defaultValueUint;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
static nsTArray<nsAutoPtr<CacheData> >* gCacheData = nsnull;
|
||||||
|
static nsRefPtrHashtable<ValueObserverHashKey,
|
||||||
|
ValueObserver>* gObserverTable = nsnull;
|
||||||
|
|
||||||
// static
|
// static
|
||||||
Preferences*
|
Preferences*
|
||||||
Preferences::GetInstance()
|
Preferences::GetInstance()
|
||||||
@ -115,8 +217,15 @@ Preferences::InitStaticMembers()
|
|||||||
NS_ADDREF(sPreferences);
|
NS_ADDREF(sPreferences);
|
||||||
if (NS_FAILED(sPreferences->Init()) || !sPreferences->mRootBranch) {
|
if (NS_FAILED(sPreferences->Init()) || !sPreferences->mRootBranch) {
|
||||||
NS_RELEASE(sPreferences);
|
NS_RELEASE(sPreferences);
|
||||||
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
return sPreferences != nsnull;
|
|
||||||
|
gCacheData = new nsTArray<nsAutoPtr<CacheData> >();
|
||||||
|
|
||||||
|
gObserverTable = new nsRefPtrHashtable<ValueObserverHashKey, ValueObserver>();
|
||||||
|
gObserverTable->Init();
|
||||||
|
|
||||||
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@ -125,6 +234,12 @@ Preferences::Shutdown()
|
|||||||
{
|
{
|
||||||
sShutdown = PR_TRUE; // Don't create the singleton instance after here.
|
sShutdown = PR_TRUE; // Don't create the singleton instance after here.
|
||||||
NS_IF_RELEASE(sPreferences);
|
NS_IF_RELEASE(sPreferences);
|
||||||
|
|
||||||
|
delete gCacheData;
|
||||||
|
gCacheData = nsnull;
|
||||||
|
|
||||||
|
delete gObserverTable;
|
||||||
|
gObserverTable = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -1233,4 +1348,120 @@ Preferences::RemoveObservers(nsIObserver* aObserver,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
nsresult
|
||||||
|
Preferences::RegisterCallback(PrefChangedFunc aCallback,
|
||||||
|
const char* aPref,
|
||||||
|
void* aClosure)
|
||||||
|
{
|
||||||
|
NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
|
||||||
|
|
||||||
|
ValueObserverHashKey hashKey(aPref, aCallback);
|
||||||
|
nsRefPtr<ValueObserver> observer;
|
||||||
|
gObserverTable->Get(&hashKey, getter_AddRefs(observer));
|
||||||
|
if (observer) {
|
||||||
|
observer->AppendClosure(aClosure);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
observer = new ValueObserver(aPref, aCallback);
|
||||||
|
observer->AppendClosure(aClosure);
|
||||||
|
nsresult rv = AddStrongObserver(observer, aPref);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
return gObserverTable->Put(observer, observer) ? NS_OK :
|
||||||
|
NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
nsresult
|
||||||
|
Preferences::UnregisterCallback(PrefChangedFunc aCallback,
|
||||||
|
const char* aPref,
|
||||||
|
void* aClosure)
|
||||||
|
{
|
||||||
|
NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
|
||||||
|
|
||||||
|
ValueObserverHashKey hashKey(aPref, aCallback);
|
||||||
|
nsRefPtr<ValueObserver> observer;
|
||||||
|
gObserverTable->Get(&hashKey, getter_AddRefs(observer));
|
||||||
|
if (!observer) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
observer->RemoveClosure(aClosure);
|
||||||
|
if (observer->HasNoClosures()) {
|
||||||
|
// Delete the callback since its list of closures is empty.
|
||||||
|
gObserverTable->Remove(observer);
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int BoolVarChanged(const char* aPref, void* aClosure)
|
||||||
|
{
|
||||||
|
CacheData* cache = static_cast<CacheData*>(aClosure);
|
||||||
|
*((PRBool*)cache->cacheLocation) =
|
||||||
|
Preferences::GetBool(aPref, cache->defaultValueBool);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
nsresult
|
||||||
|
Preferences::AddBoolVarCache(PRBool* aCache,
|
||||||
|
const char* aPref,
|
||||||
|
PRBool aDefault)
|
||||||
|
{
|
||||||
|
NS_ASSERTION(aCache, "aCache must not be NULL");
|
||||||
|
*aCache = GetBool(aPref, aDefault);
|
||||||
|
CacheData* data = new CacheData();
|
||||||
|
data->cacheLocation = aCache;
|
||||||
|
data->defaultValueBool = aDefault;
|
||||||
|
gCacheData->AppendElement(data);
|
||||||
|
return RegisterCallback(BoolVarChanged, aPref, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int IntVarChanged(const char* aPref, void* aClosure)
|
||||||
|
{
|
||||||
|
CacheData* cache = static_cast<CacheData*>(aClosure);
|
||||||
|
*((PRInt32*)cache->cacheLocation) =
|
||||||
|
Preferences::GetInt(aPref, cache->defaultValueInt);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
nsresult
|
||||||
|
Preferences::AddIntVarCache(PRInt32* aCache,
|
||||||
|
const char* aPref,
|
||||||
|
PRInt32 aDefault)
|
||||||
|
{
|
||||||
|
NS_ASSERTION(aCache, "aCache must not be NULL");
|
||||||
|
*aCache = Preferences::GetInt(aPref, aDefault);
|
||||||
|
CacheData* data = new CacheData();
|
||||||
|
data->cacheLocation = aCache;
|
||||||
|
data->defaultValueInt = aDefault;
|
||||||
|
gCacheData->AppendElement(data);
|
||||||
|
return RegisterCallback(IntVarChanged, aPref, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UintVarChanged(const char* aPref, void* aClosure)
|
||||||
|
{
|
||||||
|
CacheData* cache = static_cast<CacheData*>(aClosure);
|
||||||
|
*((PRUint32*)cache->cacheLocation) =
|
||||||
|
Preferences::GetUint(aPref, cache->defaultValueUint);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
nsresult
|
||||||
|
Preferences::AddUintVarCache(PRUint32* aCache,
|
||||||
|
const char* aPref,
|
||||||
|
PRUint32 aDefault)
|
||||||
|
{
|
||||||
|
NS_ASSERTION(aCache, "aCache must not be NULL");
|
||||||
|
*aCache = Preferences::GetUint(aPref, aDefault);
|
||||||
|
CacheData* data = new CacheData();
|
||||||
|
data->cacheLocation = aCache;
|
||||||
|
data->defaultValueUint = aDefault;
|
||||||
|
gCacheData->AppendElement(data);
|
||||||
|
return RegisterCallback(UintVarChanged, aPref, data);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "nsContentUtils.h"
|
|
||||||
#include "nsHtml5AttributeName.h"
|
#include "nsHtml5AttributeName.h"
|
||||||
#include "nsHtml5ElementName.h"
|
#include "nsHtml5ElementName.h"
|
||||||
#include "nsHtml5HtmlAttributes.h"
|
#include "nsHtml5HtmlAttributes.h"
|
||||||
@ -49,6 +48,9 @@
|
|||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
// static
|
// static
|
||||||
PRBool nsHtml5Module::sEnabled = PR_FALSE;
|
PRBool nsHtml5Module::sEnabled = PR_FALSE;
|
||||||
@ -60,8 +62,8 @@ nsIThread* nsHtml5Module::sMainThread = nsnull;
|
|||||||
void
|
void
|
||||||
nsHtml5Module::InitializeStatics()
|
nsHtml5Module::InitializeStatics()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddBoolPrefVarCache("html5.parser.enable", &sEnabled);
|
Preferences::AddBoolVarCache(&sEnabled, "html5.parser.enable");
|
||||||
nsContentUtils::AddBoolPrefVarCache("html5.offmainthread", &sOffMainThread);
|
Preferences::AddBoolVarCache(&sOffMainThread, "html5.offmainthread");
|
||||||
nsHtml5Atoms::AddRefAtoms();
|
nsHtml5Atoms::AddRefAtoms();
|
||||||
nsHtml5AttributeName::initializeStatics();
|
nsHtml5AttributeName::initializeStatics();
|
||||||
nsHtml5ElementName::initializeStatics();
|
nsHtml5ElementName::initializeStatics();
|
||||||
|
@ -65,10 +65,10 @@ PRInt32 nsHtml5StreamParser::sTimerSubsequentDelay = 120;
|
|||||||
void
|
void
|
||||||
nsHtml5StreamParser::InitializeStatics()
|
nsHtml5StreamParser::InitializeStatics()
|
||||||
{
|
{
|
||||||
nsContentUtils::AddIntPrefVarCache("html5.flushtimer.initialdelay",
|
Preferences::AddIntVarCache(&sTimerInitialDelay,
|
||||||
&sTimerInitialDelay);
|
"html5.flushtimer.initialdelay");
|
||||||
nsContentUtils::AddIntPrefVarCache("html5.flushtimer.subsequentdelay",
|
Preferences::AddIntVarCache(&sTimerSubsequentDelay,
|
||||||
&sTimerSubsequentDelay);
|
"html5.flushtimer.subsequentdelay");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user