[tbb-commits] [tor-browser/tor-browser-52.4.0esr-7.0-1] Revert "Bug 21308: Set indexedDB->null when dom.indexeddb.enabled=false"

gk at torproject.org gk at torproject.org
Tue Oct 17 13:04:46 UTC 2017


commit d3222cf5469b28bfb2b018055693d94254df9cd2
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Tue Oct 17 00:08:10 2017 -0700

    Revert "Bug 21308: Set indexedDB->null when dom.indexeddb.enabled=false"
    
    This reverts commit 31348e47a340494c4002b43d8fb509689f8f7e63.
---
 dom/indexedDB/IDBFactory.cpp                   |  4 ++--
 dom/indexedDB/test/mochitest.ini               |  1 -
 dom/indexedDB/test/test_disable_indexeddb.html | 28 --------------------------
 3 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp
index be17108057f9..1aeff8d1ebc4 100644
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -133,7 +133,7 @@ IDBFactory::CreateForWindow(nsPIDOMWindowInner* aWindow,
   if (!(NS_SUCCEEDED(rv) && nsContentUtils::IsSystemPrincipal(principal)) &&
       NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
     *aFactory = nullptr;
-    return NS_OK;
+    return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
   }
 
   if (rv == NS_ERROR_DOM_NOT_SUPPORTED_ERR) {
@@ -249,7 +249,7 @@ IDBFactory::CreateForMainThreadJSInternal(
   if (aPrincipalInfo->type() != PrincipalInfo::TSystemPrincipalInfo &&
       NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
     *aFactory = nullptr;
-    return NS_OK;
+    return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
   }
 
   IndexedDatabaseManager* mgr = IndexedDatabaseManager::GetOrCreate();
diff --git a/dom/indexedDB/test/mochitest.ini b/dom/indexedDB/test/mochitest.ini
index a4473b26839c..4ab55a9dc2b3 100644
--- a/dom/indexedDB/test/mochitest.ini
+++ b/dom/indexedDB/test/mochitest.ini
@@ -159,7 +159,6 @@ skip-if = e10s
 [test_deleteDatabase_interactions.html]
 [test_deleteDatabase_onblocked.html]
 [test_deleteDatabase_onblocked_duringVersionChange.html]
-[test_disable_indexeddb.html]
 [test_error_events_abort_transactions.html]
 [test_event_propagation.html]
 [test_event_source.html]
diff --git a/dom/indexedDB/test/test_disable_indexeddb.html b/dom/indexedDB/test/test_disable_indexeddb.html
deleted file mode 100644
index d8a691f9be18..000000000000
--- a/dom/indexedDB/test/test_disable_indexeddb.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>Indexed Database Disable Pref test</title>
-
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-
-</head>
-
-<body>
-  <script>
-   add_task(function* () {
-       for (let enable of [false, true]) {
-           yield SpecialPowers.pushPrefEnv(
-               {'set': [['dom.indexedDB.enabled', enable]]});
-           if (!enable) {
-               is(indexedDB, null, "indexedDB should be null");
-           } else {
-               isnot(indexedDB, null, "indexedDB should be non-null");
-           }
-       }
-   });
-  </script>
-</body>
-
-</html>





More information about the tbb-commits mailing list