mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237783 - Make sure we correctly turn off appcache. r=ehsan
This commit is contained in:
parent
61107b5fc9
commit
bb3147ef68
@ -69,7 +69,7 @@ typedef any Transferable;
|
||||
#ifdef HAVE_SIDEBAR
|
||||
[Replaceable, Throws] readonly attribute External external;
|
||||
#endif
|
||||
[Throws] readonly attribute ApplicationCache applicationCache;
|
||||
[Throws, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
|
||||
|
||||
// user prompts
|
||||
[Throws, UnsafeInPrerendering] void alert();
|
||||
|
@ -52,6 +52,7 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nullptr;
|
||||
static bool sAllowOfflineCache = true;
|
||||
|
||||
nsTHashtable<nsCStringHashKey>* nsOfflineCacheUpdateService::mAllowedDomains = nullptr;
|
||||
|
||||
@ -247,6 +248,10 @@ nsOfflineCacheUpdateService::nsOfflineCacheUpdateService()
|
||||
, mUpdateRunning(false)
|
||||
, mLowFreeSpace(false)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
Preferences::AddBoolVarCache(&sAllowOfflineCache,
|
||||
"browser.cache.offline.enable",
|
||||
true);
|
||||
}
|
||||
|
||||
nsOfflineCacheUpdateService::~nsOfflineCacheUpdateService()
|
||||
@ -605,6 +610,10 @@ OfflineAppPermForPrincipal(nsIPrincipal *aPrincipal,
|
||||
{
|
||||
*aAllowed = false;
|
||||
|
||||
if (!sAllowOfflineCache) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!aPrincipal)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
@ -696,6 +705,10 @@ nsOfflineCacheUpdateService::AllowOfflineApp(nsIPrincipal *aPrincipal)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if (!sAllowOfflineCache) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
if (GeckoProcessType_Default != XRE_GetProcessType()) {
|
||||
ContentChild* child = ContentChild::GetSingleton();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user