[IndexedDB] Refactor & clarify leveldb database creation & ownership

This refactors the way the LevelDB database is opened for IndexedDB.
Classes like IndexedDBBackingStore and LevelDBDatabase now accept their
dependencies on construction, instead of constructing/initializing their
dependencies on creation. This allows for much easier testing and
reasoning about state in the code.

TBR: [email protected]
Bug: 862456
Change-Id: I4202bd1e75915ef7eed86e3a2cc0ad7d4fdc5d06
Reviewed-on: https://chromium-review.googlesource.com/c/1357015
Commit-Queue: Daniel Murphy <[email protected]>
Reviewed-by: Mark Pearson <[email protected]>
Reviewed-by: Victor Costan <[email protected]>
Reviewed-by: Chase Phillips <[email protected]>
Cr-Commit-Position: refs/heads/master@{#620885}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 07f209d..b20ddba 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -1008,12 +1008,12 @@
     "indexed_db/indexed_db_transaction_coordinator.h",
     "indexed_db/indexed_db_value.cc",
     "indexed_db/indexed_db_value.h",
+    "indexed_db/leveldb/leveldb_comparator.cc",
     "indexed_db/leveldb/leveldb_comparator.h",
     "indexed_db/leveldb/leveldb_database.cc",
     "indexed_db/leveldb/leveldb_database.h",
     "indexed_db/leveldb/leveldb_env.cc",
     "indexed_db/leveldb/leveldb_env.h",
-    "indexed_db/leveldb/leveldb_factory.h",
     "indexed_db/leveldb/leveldb_iterator.cc",
     "indexed_db/leveldb/leveldb_iterator.h",
     "indexed_db/leveldb/leveldb_iterator_impl.cc",
@@ -1025,6 +1025,8 @@
     "indexed_db/list_set.h",
     "indexed_db/scopes/disjoint_range_lock_manager.cc",
     "indexed_db/scopes/disjoint_range_lock_manager.h",
+    "indexed_db/scopes/leveldb_state.cc",
+    "indexed_db/scopes/leveldb_state.h",
     "indexed_db/scopes/scope_lock.cc",
     "indexed_db/scopes/scope_lock.h",
     "indexed_db/scopes/scope_lock_range.cc",