mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1304966 - Enable Storage API only for nightly bulid, r=baku
This commit is contained in:
parent
d4c390f1b6
commit
d93d31503b
@ -88,7 +88,8 @@ SimpleTest.waitForExplicitFinish();
|
||||
SpecialPowers.pushPrefEnv({
|
||||
"set": [["dom.caches.enabled", true],
|
||||
["dom.caches.testing.enabled", true],
|
||||
["dom.quotaManager.testing", true]],
|
||||
["dom.quotaManager.testing", true],
|
||||
["dom.storageManager.enabled", true]],
|
||||
}, function() {
|
||||
var name = 'orphanedBodyOwner';
|
||||
var cache = null;
|
||||
|
@ -14,6 +14,6 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="runTest();"></body>
|
||||
<body onload="setup();"></body>
|
||||
|
||||
</html>
|
||||
|
@ -54,3 +54,10 @@ function testSteps()
|
||||
finishTest();
|
||||
yield undefined;
|
||||
}
|
||||
|
||||
function setup()
|
||||
{
|
||||
SpecialPowers.pushPrefEnv({
|
||||
"set": [["dom.storageManager.enabled", true]]
|
||||
}, runTest);
|
||||
}
|
||||
|
@ -332,6 +332,20 @@ StorageManager::Estimate(ErrorResult& aRv)
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
StorageManager::PrefEnabled(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
if (NS_IsMainThread()) {
|
||||
return Preferences::GetBool("dom.storageManager.enabled");
|
||||
}
|
||||
|
||||
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx);
|
||||
MOZ_ASSERT(workerPrivate);
|
||||
|
||||
return workerPrivate->StorageManagerEnabled();
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(StorageManager, mOwner)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(StorageManager)
|
||||
|
@ -25,6 +25,10 @@ class StorageManager final
|
||||
nsCOMPtr<nsIGlobalObject> mOwner;
|
||||
|
||||
public:
|
||||
// Return dom.quota.storageManager.enabled on main/worker thread.
|
||||
static bool
|
||||
PrefEnabled(JSContext* aCx, JSObject* aObj);
|
||||
|
||||
explicit
|
||||
StorageManager(nsIGlobalObject* aGlobal);
|
||||
|
||||
|
@ -88,6 +88,7 @@ interface NavigatorContentUtils {
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface NavigatorStorage {
|
||||
[Func="mozilla::dom::StorageManager::PrefEnabled"]
|
||||
readonly attribute StorageManager storage;
|
||||
};
|
||||
|
||||
|
@ -8,7 +8,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
[Exposed=(Window,Worker),
|
||||
Func="mozilla::dom::StorageManager::PrefEnabled"]
|
||||
interface StorageManager {
|
||||
// [Throws]
|
||||
// Promise<boolean> persisted();
|
||||
|
@ -34,6 +34,7 @@ WORKER_SIMPLE_PREF("dom.webnotifications.requireinteraction.enabled", DOMWorkerN
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.enabled", ServiceWorkersEnabled, SERVICEWORKERS_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.testing.enabled", ServiceWorkersTestingEnabled, SERVICEWORKERS_TESTING_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.serviceWorkers.openWindow.enabled", OpenWindowEnabled, OPEN_WINDOW_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.storageManager.enabled", StorageManagerEnabled, STORAGEMANAGER_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.push.enabled", PushEnabled, PUSH_ENABLED)
|
||||
WORKER_SIMPLE_PREF("dom.requestcontext.enabled", RequestContextEnabled, REQUESTCONTEXT_ENABLED)
|
||||
WORKER_SIMPLE_PREF("gfx.offscreencanvas.enabled", OffscreenCanvasEnabled, OFFSCREENCANVAS_ENABLED)
|
||||
|
@ -5513,3 +5513,10 @@ pref("security.mixed_content.use_hsts", false);
|
||||
// mixed-content blocking
|
||||
pref("security.mixed_content.use_hsts", true);
|
||||
#endif
|
||||
|
||||
// Disable Storage api in release builds.
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("dom.storageManager.enabled", true);
|
||||
#else
|
||||
pref("dom.storageManager.enabled", false);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user