Bug 1585582 - Simplify exposure of AppCache interface for SecureContext r=baku

Differential Revision: https://phabricator.services.mozilla.com/D47959

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kingston 2019-10-21 09:35:19 +00:00
parent c034560cf3
commit bbf5b145a3
4 changed files with 2 additions and 11 deletions

View File

@ -2987,12 +2987,6 @@ bool nsGlobalWindowInner::IsPrivilegedChromeWindow(JSContext* aCx,
nsContentUtils::GetSystemPrincipal();
}
/* static */
bool nsGlobalWindowInner::OfflineCacheAllowedForContext(JSContext* aCx,
JSObject* aObj) {
return IsSecureContextOrObjectIsFromSecureContext(aCx, aObj);
}
/* static */
bool nsGlobalWindowInner::IsRequestIdleCallbackEnabled(JSContext* aCx,
JSObject* aObj) {

View File

@ -389,9 +389,6 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
static bool IsPrivilegedChromeWindow(JSContext* /* unused */, JSObject* aObj);
static bool OfflineCacheAllowedForContext(JSContext* /* unused */,
JSObject* aObj);
static bool IsRequestIdleCallbackEnabled(JSContext* aCx,
JSObject* /* unused */);

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
[Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext",
[SecureContext, Pref="browser.cache.offline.enable",
Exposed=Window]
interface OfflineResourceList : EventTarget {
/**

View File

@ -72,7 +72,7 @@ typedef OfflineResourceList ApplicationCache;
#ifdef HAVE_SIDEBAR
[Replaceable, Throws] readonly attribute External external;
#endif
[Throws, Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext"] readonly attribute ApplicationCache applicationCache;
[Throws, SecureContext, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
// user prompts
[Throws, NeedsSubjectPrincipal] void alert();