Remove IndexedDB for content pref.

Tag Issue #765
This commit is contained in:
wolfbeast 2018-09-29 00:16:29 +02:00 committed by Roy Tam
commit 4b0b628cdd
3 changed files with 0 additions and 32 deletions

View file

@ -47,12 +47,6 @@ namespace dom {
using namespace mozilla::dom::quota;
using namespace mozilla::ipc;
namespace {
const char kPrefIndexedDBEnabled[] = "dom.indexedDB.enabled";
} // namespace
class IDBFactory::BackgroundCreateCallback final
: public nsIIPCBackgroundChildCreateCallback
{
@ -130,12 +124,6 @@ IDBFactory::CreateForWindow(nsPIDOMWindowInner* aWindow,
nsCOMPtr<nsIPrincipal> principal;
nsresult rv = AllowedForWindowInternal(aWindow, getter_AddRefs(principal));
if (!(NS_SUCCEEDED(rv) && nsContentUtils::IsSystemPrincipal(principal)) &&
NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
*aFactory = nullptr;
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
}
if (rv == NS_ERROR_DOM_NOT_SUPPORTED_ERR) {
NS_WARNING("IndexedDB is not permitted in a third-party window.");
*aFactory = nullptr;
@ -246,12 +234,6 @@ IDBFactory::CreateForMainThreadJSInternal(
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aPrincipalInfo);
if (aPrincipalInfo->type() != PrincipalInfo::TSystemPrincipalInfo &&
NS_WARN_IF(!Preferences::GetBool(kPrefIndexedDBEnabled, false))) {
*aFactory = nullptr;
return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
}
IndexedDatabaseManager* mgr = IndexedDatabaseManager::GetOrCreate();
if (NS_WARN_IF(!mgr)) {
IDB_REPORT_INTERNAL_ERR();