Bug 1247117: De-namespace much of IndexedDB. r=baku
authorKyle Huey <khuey@kylehuey.com>
Tue, 16 Feb 2016 13:46:08 -0800
changeset 284413 320bbd5c08627c182009c1df8b4834cef600ba59
parent 284412 9817e865b1b69e04d62d74a4cd46be413926a831
child 284414 f3853089e25d5736022cd17c5a131ceb791b60d4
push id30003
push usercbook@mozilla.com
push dateWed, 17 Feb 2016 10:52:09 +0000
treeherdermozilla-central@15621f98b53b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1247117
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1247117: De-namespace much of IndexedDB. r=baku
dom/base/nsDOMWindowUtils.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/bindings/Bindings.conf
dom/datastore/DataStoreDB.cpp
dom/datastore/DataStoreDB.h
dom/datastore/DataStoreRevision.cpp
dom/datastore/DataStoreRevision.h
dom/datastore/DataStoreService.cpp
dom/indexedDB/ActorsChild.h
dom/indexedDB/FileSnapshot.h
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBCursor.h
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBDatabase.h
dom/indexedDB/IDBEvents.cpp
dom/indexedDB/IDBEvents.h
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBFactory.h
dom/indexedDB/IDBFileHandle.cpp
dom/indexedDB/IDBFileHandle.h
dom/indexedDB/IDBFileRequest.cpp
dom/indexedDB/IDBFileRequest.h
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBIndex.h
dom/indexedDB/IDBKeyRange.cpp
dom/indexedDB/IDBKeyRange.h
dom/indexedDB/IDBMutableFile.cpp
dom/indexedDB/IDBMutableFile.h
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBObjectStore.h
dom/indexedDB/IDBRequest.cpp
dom/indexedDB/IDBRequest.h
dom/indexedDB/IDBTransaction.cpp
dom/indexedDB/IDBTransaction.h
dom/indexedDB/IDBWrapperCache.cpp
dom/indexedDB/IDBWrapperCache.h
dom/indexedDB/IndexedDatabase.h
dom/indexedDB/IndexedDatabaseInlines.h
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/IndexedDatabaseManager.h
dom/indexedDB/PBackgroundIDBDatabase.ipdl
dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh
dom/indexedDB/SerializationHelpers.h
dom/indexedDB/moz.build
dom/ipc/Blob.cpp
dom/webidl/IDBDatabase.webidl
dom/webidl/IDBIndex.webidl
dom/webidl/IDBKeyRange.webidl
dom/workers/RuntimeService.cpp
dom/workers/ServiceWorkerManager.cpp
dom/workers/ServiceWorkerPrivate.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerScope.cpp
dom/workers/WorkerScope.h
js/xpconnect/src/Sandbox.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -72,18 +72,18 @@
 
 #include "Layers.h"
 #include "gfxPrefs.h"
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/IDBFactoryBinding.h"
 #include "mozilla/dom/IDBMutableFileBinding.h"
-#include "mozilla/dom/indexedDB/IDBMutableFile.h"
-#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
+#include "mozilla/dom/IDBMutableFile.h"
+#include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/quota/PersistenceType.h"
 #include "mozilla/dom/quota/QuotaManager.h"
 #include "mozilla/layers/FrameUniformityData.h"
 #include "mozilla/layers/ShadowLayers.h"
 #include "nsPrintfCString.h"
 #include "nsViewportInfo.h"
 #include "nsIFormControl.h"
@@ -2819,17 +2819,17 @@ nsDOMWindowUtils::GetFileId(JS::Handle<J
 {
   if (aFile.isPrimitive()) {
     *_retval = -1;
     return NS_OK;
   }
 
   JSObject* obj = aFile.toObjectOrNull();
 
-  indexedDB::IDBMutableFile* mutableFile = nullptr;
+  IDBMutableFile* mutableFile = nullptr;
   if (NS_SUCCEEDED(UNWRAP_OBJECT(IDBMutableFile, obj, mutableFile))) {
     *_retval = mutableFile->GetFileId();
     return NS_OK;
   }
 
   Blob* blob = nullptr;
   if (NS_SUCCEEDED(UNWRAP_OBJECT(Blob, obj, blob))) {
     *_retval = blob->GetFileId();
@@ -2887,18 +2887,17 @@ nsDOMWindowUtils::GetFileReferences(cons
   JS::Rooted<JS::Value> optionsVal(aCx, aOptions);
   if (!options.Init(aCx, optionsVal)) {
     return NS_ERROR_TYPE_ERR;
   }
 
   quota::PersistenceType persistenceType =
     quota::PersistenceTypeFromStorage(options.mStorage);
 
-  RefPtr<indexedDB::IndexedDatabaseManager> mgr =
-    indexedDB::IndexedDatabaseManager::Get();
+  RefPtr<IndexedDatabaseManager> mgr = IndexedDatabaseManager::Get();
 
   if (mgr) {
     rv = mgr->BlockAndGetFileReferences(persistenceType, origin, aDatabaseName,
                                         aId, aRefCnt, aDBRefCnt, aSliceRefCnt,
                                         aResult);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   else {
@@ -2907,18 +2906,16 @@ nsDOMWindowUtils::GetFileReferences(cons
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::FlushPendingFileDeletions()
 {
-  using mozilla::dom::indexedDB::IndexedDatabaseManager;
-
   RefPtr<IndexedDatabaseManager> mgr = IndexedDatabaseManager::Get();
   if (mgr) {
     nsresult rv = mgr->FlushPendingFileDeletions();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -178,18 +178,18 @@
 #include "mozilla/dom/Selection.h"
 #include "nsFrameLoader.h"
 #include "nsISupportsPrimitives.h"
 #include "nsXPCOMCID.h"
 #include "mozilla/Logging.h"
 #include "prenv.h"
 #include "prprf.h"
 
+#include "mozilla/dom/IDBFactory.h"
 #include "mozilla/dom/MessageChannel.h"
-#include "mozilla/dom/indexedDB/IDBFactory.h"
 #include "mozilla/dom/Promise.h"
 
 #ifdef MOZ_GAMEPAD
 #include "mozilla/dom/Gamepad.h"
 #include "mozilla/dom/GamepadService.h"
 #endif
 
 #include "mozilla/dom/VRDevice.h"
@@ -261,17 +261,16 @@ static const char kStorageEnabled[] = "d
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::dom::ipc;
 using mozilla::BasePrincipal;
 using mozilla::PrincipalOriginAttributes;
 using mozilla::TimeStamp;
 using mozilla::TimeDuration;
 using mozilla::dom::cache::CacheStorage;
-using mozilla::dom::indexedDB::IDBFactory;
 
 static LazyLogModule gDOMLeakPRLog("DOMLeak");
 
 nsGlobalWindow::WindowByIdTable *nsGlobalWindow::sWindowsById = nullptr;
 bool nsGlobalWindow::sWarnedAboutWindowInternal = false;
 bool nsGlobalWindow::sIdleObserversAPIFuzzTimeDisabled = false;
 
 static nsIEntropyCollector *gEntropyCollector          = nullptr;
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -119,19 +119,17 @@ class Selection;
 class SpeechSynthesis;
 class WakeLock;
 #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
 class WindowOrientationObserver;
 #endif
 namespace cache {
 class CacheStorage;
 } // namespace cache
-namespace indexedDB {
 class IDBFactory;
-} // namespace indexedDB
 } // namespace dom
 namespace gfx {
 class VRDeviceProxy;
 } // namespace gfx
 } // namespace mozilla
 
 extern already_AddRefed<nsIScriptTimeoutHandler>
 NS_CreateJSTimeoutHandler(JSContext* aCx, nsGlobalWindow *aWindow,
@@ -985,17 +983,17 @@ public:
             mozilla::ErrorResult& aError);
   void Btoa(const nsAString& aBinaryData, nsAString& aAsciiBase64String,
             mozilla::ErrorResult& aError);
   mozilla::dom::DOMStorage* GetSessionStorage(mozilla::ErrorResult& aError);
   mozilla::dom::DOMStorage* GetLocalStorage(mozilla::ErrorResult& aError);
   mozilla::dom::Selection* GetSelectionOuter();
   mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aError);
   already_AddRefed<nsISelection> GetSelection() override;
-  mozilla::dom::indexedDB::IDBFactory* GetIndexedDB(mozilla::ErrorResult& aError);
+  mozilla::dom::IDBFactory* GetIndexedDB(mozilla::ErrorResult& aError);
   already_AddRefed<nsICSSDeclaration>
     GetComputedStyle(mozilla::dom::Element& aElt, const nsAString& aPseudoElt,
                      mozilla::ErrorResult& aError) override;
   already_AddRefed<mozilla::dom::MediaQueryList> MatchMediaOuter(const nsAString& aQuery);
   already_AddRefed<mozilla::dom::MediaQueryList> MatchMedia(const nsAString& aQuery,
                                                             mozilla::ErrorResult& aError);
   nsScreen* GetScreen(mozilla::ErrorResult& aError);
   nsIDOMScreen* GetScreen() override;
@@ -1829,17 +1827,17 @@ protected:
   // mSuspendedDoc is only set on outer windows. It's useful when we get matched
   // EnterModalState/LeaveModalState calls, in which case the outer window is
   // responsible for unsuspending events on the document. If we don't (for
   // example, if the outer window is closed before the LeaveModalState call),
   // then the inner window whose mDoc is our mSuspendedDoc is responsible for
   // unsuspending it.
   nsCOMPtr<nsIDocument> mSuspendedDoc;
 
-  RefPtr<mozilla::dom::indexedDB::IDBFactory> mIndexedDB;
+  RefPtr<mozilla::dom::IDBFactory> mIndexedDB;
 
   // This counts the number of windows that have been opened in rapid succession
   // (i.e. within dom.successive_dialog_time_limit of each other). It is reset
   // to 0 once a dialog is opened after dom.successive_dialog_time_limit seconds
   // have elapsed without any other dialogs.
   uint32_t                      mDialogAbuseCount;
 
   // This holds the time when the last modal dialog was shown. If more than
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -603,89 +603,53 @@ DOMInterfaces = {
     }
 },
 
 'HTMLUListElement': {
     'nativeType' : 'mozilla::dom::HTMLSharedListElement'
 },
 
 'IDBCursor': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBCursor',
     'implicitJSContext': [ 'delete' ],
     'binaryNames': {
         'direction': 'getDirection'
     }
 },
 
 'IDBCursorWithValue': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBCursor',
-},
-
-'IDBDatabase': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBDatabase',
-},
-
-'IDBFactory': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBFactory',
-},
-
-'IDBFileHandle': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBFileHandle',
-},
-
-'IDBFileRequest': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBFileRequest',
+    'nativeType': 'mozilla::dom::IDBCursor',
 },
 
 'IDBIndex': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBIndex',
     'binaryNames': {
         'mozGetAll': 'getAll',
         'mozGetAllKeys': 'getAllKeys',
     }
 },
 
 'IDBKeyRange': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBKeyRange',
-    'headerFile': 'mozilla/dom/indexedDB/IDBKeyRange.h',
     'wrapperCache': False,
 },
 
 'IDBLocaleAwareKeyRange': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBLocaleAwareKeyRange',
-    'headerFile': 'mozilla/dom/indexedDB/IDBKeyRange.h',
+    'headerFile': 'IDBKeyRange.h',
     'wrapperCache': False,
 },
 
-'IDBMutableFile': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBMutableFile',
-},
-
 'IDBObjectStore': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBObjectStore',
     'binaryNames': {
         'mozGetAll': 'getAll'
     }
 },
 
 'IDBOpenDBRequest': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBOpenDBRequest',
     'headerFile': 'IDBRequest.h'
 },
 
-'IDBRequest': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBRequest',
-},
-
-'IDBTransaction': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBTransaction',
-},
-
 'IDBVersionChangeEvent': {
-    'nativeType': 'mozilla::dom::indexedDB::IDBVersionChangeEvent',
     'headerFile': 'IDBEvents.h',
 },
 
 'IID': {
     'nativeType': 'nsIJSID',
     'headerFile': 'xpcjsid.h',
 },
 
--- a/dom/datastore/DataStoreDB.cpp
+++ b/dom/datastore/DataStoreDB.cpp
@@ -4,25 +4,25 @@
  * 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/. */
 
 #include "DataStoreDB.h"
 
 #include "DataStoreCallbacks.h"
 #include "jsapi.h"
 #include "mozilla/dom/IDBDatabaseBinding.h"
+#include "mozilla/dom/IDBDatabase.h"
+#include "mozilla/dom/IDBEvents.h"
+#include "mozilla/dom/IDBFactory.h"
 #include "mozilla/dom/IDBFactoryBinding.h"
+#include "mozilla/dom/IDBIndex.h"
+#include "mozilla/dom/IDBObjectStore.h"
 #include "mozilla/dom/IDBObjectStoreBinding.h"
-#include "mozilla/dom/indexedDB/IDBDatabase.h"
-#include "mozilla/dom/indexedDB/IDBEvents.h"
-#include "mozilla/dom/indexedDB/IDBFactory.h"
-#include "mozilla/dom/indexedDB/IDBIndex.h"
-#include "mozilla/dom/indexedDB/IDBObjectStore.h"
-#include "mozilla/dom/indexedDB/IDBRequest.h"
-#include "mozilla/dom/indexedDB/IDBTransaction.h"
+#include "mozilla/dom/IDBRequest.h"
+#include "mozilla/dom/IDBTransaction.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsIDOMEvent.h"
 #include "nsIPrincipal.h"
 #include "nsIXPConnect.h"
 #include "nsNullPrincipal.h"
 
 #define DATASTOREDB_VERSION        1
@@ -349,17 +349,17 @@ DataStoreDB::Delete()
     mFactory->DeleteDatabase(mDatabaseName, IDBOpenDBOptions(), error);
   if (NS_WARN_IF(error.Failed())) {
     return error.StealNSResult();
   }
 
   return NS_OK;
 }
 
-indexedDB::IDBTransaction*
+IDBTransaction*
 DataStoreDB::Transaction() const
 {
   MOZ_ASSERT(mTransaction);
   MOZ_ASSERT(mTransaction->IsOpen());
   return mTransaction;
 }
 
 nsresult
--- a/dom/datastore/DataStoreDB.h
+++ b/dom/datastore/DataStoreDB.h
@@ -13,38 +13,35 @@
 #include "nsISupportsImpl.h"
 #include "nsString.h"
 
 #define DATASTOREDB_REVISION       "revision"
 
 namespace mozilla {
 namespace dom {
 
-namespace indexedDB {
+class DataStoreDBCallback;
 class IDBDatabase;
 class IDBFactory;
 class IDBOpenDBRequest;
 class IDBTransaction;
-} // namespace indexedDB
-
-class DataStoreDBCallback;
 
 class DataStoreDB final : public nsIDOMEventListener
 {
 public:
   NS_DECL_ISUPPORTS
 
   DataStoreDB(const nsAString& aManifestURL, const nsAString& aName);
 
   nsresult Open(IDBTransactionMode aMode, const Sequence<nsString>& aDb,
                 DataStoreDBCallback* aCallback);
 
   nsresult Delete();
 
-  indexedDB::IDBTransaction* Transaction() const;
+  IDBTransaction* Transaction() const;
 
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) override;
 
 private:
   ~DataStoreDB();
 
   nsresult CreateFactoryIfNeeded();
@@ -54,20 +51,20 @@ private:
   nsresult DatabaseOpened();
 
   nsresult AddEventListeners();
 
   nsresult RemoveEventListeners();
 
   nsString mDatabaseName;
 
-  RefPtr<indexedDB::IDBFactory> mFactory;
-  RefPtr<indexedDB::IDBOpenDBRequest> mRequest;
-  RefPtr<indexedDB::IDBDatabase> mDatabase;
-  RefPtr<indexedDB::IDBTransaction> mTransaction;
+  RefPtr<IDBFactory> mFactory;
+  RefPtr<IDBOpenDBRequest> mRequest;
+  RefPtr<IDBDatabase> mDatabase;
+  RefPtr<IDBTransaction> mTransaction;
 
   RefPtr<DataStoreDBCallback> mCallback;
 
   // Internal state to avoid strange use of this class.
   enum StateType {
     Inactive,
     Active
   } mState;
--- a/dom/datastore/DataStoreRevision.cpp
+++ b/dom/datastore/DataStoreRevision.cpp
@@ -4,26 +4,24 @@
  * 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/. */
 
 #include "DataStoreRevision.h"
 
 #include "DataStoreCallbacks.h"
 #include "DataStoreService.h"
 #include "mozilla/dom/DataStoreBinding.h"
+#include "mozilla/dom/IDBObjectStore.h"
+#include "mozilla/dom/IDBRequest.h"
 #include "mozilla/dom/ToJSValue.h"
-#include "mozilla/dom/indexedDB/IDBObjectStore.h"
-#include "mozilla/dom/indexedDB/IDBRequest.h"
 #include "nsIDOMEvent.h"
 
 namespace mozilla {
 namespace dom {
 
-using namespace indexedDB;
-
 NS_IMPL_ISUPPORTS(DataStoreRevision, nsIDOMEventListener)
 
 // Note: this code in it must not assume anything about the compartment cx is
 // in.
 nsresult
 DataStoreRevision::AddRevision(JSContext* aCx,
                                IDBObjectStore* aStore,
                                uint32_t aObjectId,
--- a/dom/datastore/DataStoreRevision.h
+++ b/dom/datastore/DataStoreRevision.h
@@ -10,44 +10,41 @@
 #include "jsapi.h"
 #include "nsAutoPtr.h"
 #include "nsIDOMEventListener.h"
 #include "nsString.h"
 
 namespace mozilla {
 namespace dom {
 
-namespace indexedDB {
+class DataStoreRevisionCallback;
 class IDBObjectStore;
 class IDBRequest;
-} // namespace indexedDB
-
-class DataStoreRevisionCallback;
 
 class DataStoreRevision final : public nsIDOMEventListener
 {
 public:
   NS_DECL_ISUPPORTS
 
   enum RevisionType {
     RevisionVoid
   };
 
   nsresult AddRevision(JSContext* aCx,
-                       indexedDB::IDBObjectStore* aStore,
+                       IDBObjectStore* aStore,
                        uint32_t aObjectId,
                        RevisionType aRevisionType,
                        DataStoreRevisionCallback* aCallback);
 
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) override;
 
 private:
   ~DataStoreRevision() {}
   RefPtr<DataStoreRevisionCallback> mCallback;
-  RefPtr<indexedDB::IDBRequest> mRequest;
+  RefPtr<IDBRequest> mRequest;
   nsString mRevisionID;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_DataStoreRevision_h
--- a/dom/datastore/DataStoreService.cpp
+++ b/dom/datastore/DataStoreService.cpp
@@ -16,20 +16,20 @@
 
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DOMError.h"
-#include "mozilla/dom/indexedDB/IDBCursor.h"
-#include "mozilla/dom/indexedDB/IDBObjectStore.h"
-#include "mozilla/dom/indexedDB/IDBRequest.h"
-#include "mozilla/dom/indexedDB/IDBTransaction.h"
+#include "mozilla/dom/IDBCursor.h"
+#include "mozilla/dom/IDBObjectStore.h"
+#include "mozilla/dom/IDBRequest.h"
+#include "mozilla/dom/IDBTransaction.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/unused.h"
 
 #include "mozIApplication.h"
 #include "mozIApplicationClearPrivateDataParams.h"
 #include "nsIAppsService.h"
 #include "nsIDOMEvent.h"
@@ -58,18 +58,16 @@
   }
 
 using mozilla::BasePrincipal;
 using mozilla::PrincipalOriginAttributes;
 
 namespace mozilla {
 namespace dom {
 
-using namespace indexedDB;
-
 // This class contains all the information about a DataStore.
 class DataStoreInfo
 {
 public:
   DataStoreInfo()
     : mReadOnly(true)
     , mEnabled(false)
   {}
--- a/dom/indexedDB/ActorsChild.h
+++ b/dom/indexedDB/ActorsChild.h
@@ -32,34 +32,36 @@ struct PRThread;
 namespace mozilla {
 namespace ipc {
 
 class BackgroundChildImpl;
 
 } // namespace ipc
 
 namespace dom {
-namespace indexedDB {
 
 class IDBCursor;
 class IDBDatabase;
 class IDBFactory;
 class IDBMutableFile;
 class IDBOpenDBRequest;
 class IDBRequest;
 class IndexedDatabaseManager;
+
+namespace indexedDB {
+
 class Key;
 class PermissionRequestChild;
 class PermissionRequestParent;
 class SerializedStructuredCloneReadInfo;
 
 class ThreadLocal
 {
   friend class nsAutoPtr<ThreadLocal>;
-  friend class IDBFactory;
+  friend IDBFactory;
 
   LoggingInfo mLoggingInfo;
   IDBTransaction* mCurrentTransaction;
   nsCString mLoggingIdString;
 
 #ifdef DEBUG
   PRThread* mOwningThread;
 #endif
@@ -144,17 +146,17 @@ private:
   ThreadLocal() = delete;
   ThreadLocal(const ThreadLocal& aOther) = delete;
 };
 
 class BackgroundFactoryChild final
   : public PBackgroundIDBFactoryChild
 {
   friend class mozilla::ipc::BackgroundChildImpl;
-  friend class IDBFactory;
+  friend IDBFactory;
 
   IDBFactory* mFactory;
 
 #ifdef DEBUG
   nsCOMPtr<nsIEventTarget> mOwningThread;
 #endif
 
 public:
@@ -237,17 +239,17 @@ protected:
 };
 
 class BackgroundFactoryRequestChild final
   : public BackgroundRequestChildBase
   , public PBackgroundIDBFactoryRequestChild
 {
   typedef mozilla::dom::quota::PersistenceType PersistenceType;
 
-  friend class IDBFactory;
+  friend IDBFactory;
   friend class BackgroundFactoryChild;
   friend class BackgroundDatabaseChild;
   friend class PermissionRequestChild;
   friend class PermissionRequestParent;
 
   RefPtr<IDBFactory> mFactory;
   const uint64_t mRequestedVersion;
   const bool mIsDeleteOp;
@@ -289,17 +291,17 @@ private:
   RecvBlocked(const uint64_t& aCurrentVersion) override;
 };
 
 class BackgroundDatabaseChild final
   : public PBackgroundIDBDatabaseChild
 {
   friend class BackgroundFactoryChild;
   friend class BackgroundFactoryRequestChild;
-  friend class IDBDatabase;
+  friend IDBDatabase;
 
   nsAutoPtr<DatabaseSpec> mSpec;
   RefPtr<IDBDatabase> mTemporaryStrongDatabase;
   BackgroundFactoryRequestChild* mOpenRequestActor;
   IDBDatabase* mDatabase;
 
 public:
   void
@@ -421,17 +423,17 @@ private:
   SendDeleteMe() = delete;
 };
 
 class BackgroundDatabaseRequestChild final
   : public BackgroundRequestChildBase
   , public PBackgroundIDBDatabaseRequestChild
 {
   friend class BackgroundDatabaseChild;
-  friend class IDBDatabase;
+  friend IDBDatabase;
 
   RefPtr<IDBDatabase> mDatabase;
 
 private:
   // Only created by IDBDatabase.
   BackgroundDatabaseRequestChild(IDBDatabase* aDatabase,
                                  IDBRequest* aRequest);
 
@@ -501,17 +503,17 @@ private:
   SetDOMTransaction(IDBTransaction* aDOMObject);
 };
 
 class BackgroundTransactionChild final
   : public BackgroundTransactionBase
   , public PBackgroundIDBTransactionChild
 {
   friend class BackgroundDatabaseChild;
-  friend class IDBDatabase;
+  friend IDBDatabase;
 
 public:
 #ifdef DEBUG
   virtual void
   AssertIsOnOwningThread() const override;
 #endif
 
   void
@@ -628,17 +630,17 @@ private:
 };
 
 class BackgroundRequestChild final
   : public BackgroundRequestChildBase
   , public PBackgroundIDBRequestChild
 {
   friend class BackgroundTransactionChild;
   friend class BackgroundVersionChangeTransactionChild;
-  friend class IDBTransaction;
+  friend IDBTransaction;
 
   RefPtr<IDBTransaction> mTransaction;
 
 private:
   // Only created by IDBTransaction.
   explicit
   BackgroundRequestChild(IDBRequest* aRequest);
 
@@ -810,17 +812,17 @@ private:
   bool
   SendDeleteMe() = delete;
 };
 
 class BackgroundUtilsChild final
   : public PBackgroundIndexedDBUtilsChild
 {
   friend class mozilla::ipc::BackgroundChildImpl;
-  friend class IndexedDatabaseManager;
+  friend IndexedDatabaseManager;
 
   IndexedDatabaseManager* mManager;
 
 #ifdef DEBUG
   nsCOMPtr<nsIEventTarget> mOwningThread;
 #endif
 
 public:
--- a/dom/indexedDB/FileSnapshot.h
+++ b/dom/indexedDB/FileSnapshot.h
@@ -24,20 +24,21 @@ public:
   virtual mozilla::dom::BlobImpl*
   GetBlobImpl() const = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(PIBlobImplSnapshot, FILEIMPLSNAPSHOT_IID)
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 class IDBFileHandle;
 
+namespace indexedDB {
+
 class BlobImplSnapshot final
   : public BlobImpl
   , public PIBlobImplSnapshot
 {
   RefPtr<BlobImpl> mBlobImpl;
   nsWeakPtr mFileHandle;
 
 public:
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -19,17 +19,18 @@
 #include "ProfilerHelpers.h"
 #include "ReportInternalError.h"
 
 // Include this last to avoid path problems on Windows.
 #include "ActorsChild.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
+
+using namespace indexedDB;
 
 IDBCursor::IDBCursor(Type aType,
                      BackgroundCursorChild* aBackgroundActor,
                      const Key& aKey)
   : mBackgroundActor(aBackgroundActor)
   , mRequest(aBackgroundActor->GetRequest())
   , mSourceObjectStore(aBackgroundActor->GetObjectStore())
   , mSourceIndex(aBackgroundActor->GetIndex())
@@ -891,11 +892,10 @@ IDBCursor::WrapObject(JSContext* aCx, JS
     case Type_IndexKey:
       return IDBCursorBinding::Wrap(aCx, this, aGivenProto);
 
     default:
       MOZ_CRASH("Bad type!");
   }
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBCursor.h
+++ b/dom/indexedDB/IDBCursor.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbcursor_h__
-#define mozilla_dom_indexeddb_idbcursor_h__
+#ifndef mozilla_dom_idbcursor_h__
+#define mozilla_dom_idbcursor_h__
 
 #include "IndexedDatabase.h"
 #include "js/RootingAPI.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDBCursorBinding.h"
 #include "mozilla/dom/indexedDB/Key.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
@@ -19,31 +19,34 @@
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
-class OwningIDBObjectStoreOrIDBIndex;
-
-namespace indexedDB {
-
-class BackgroundCursorChild;
 class IDBIndex;
 class IDBObjectStore;
 class IDBRequest;
 class IDBTransaction;
+class OwningIDBObjectStoreOrIDBIndex;
+
+namespace indexedDB {
+class BackgroundCursorChild;
+}
 
 class IDBCursor final
   : public nsISupports
   , public nsWrapperCache
 {
 public:
+  typedef indexedDB::Key Key;
+  typedef indexedDB::StructuredCloneReadInfo StructuredCloneReadInfo;
+
   enum Direction
   {
     NEXT = 0,
     NEXT_UNIQUE,
     PREV,
     PREV_UNIQUE,
 
     // Only needed for IPC serialization helper, should never be used in code.
@@ -54,17 +57,17 @@ private:
   enum Type
   {
     Type_ObjectStore,
     Type_ObjectStoreKey,
     Type_Index,
     Type_IndexKey,
   };
 
-  BackgroundCursorChild* mBackgroundActor;
+  indexedDB::BackgroundCursorChild* mBackgroundActor;
 
   RefPtr<IDBRequest> mRequest;
   RefPtr<IDBObjectStore> mSourceObjectStore;
   RefPtr<IDBIndex> mSourceIndex;
 
   // mSourceObjectStore or mSourceIndex will hold this alive.
   IDBTransaction* mTransaction;
 
@@ -87,33 +90,33 @@ private:
   bool mHaveCachedPrimaryKey : 1;
   bool mHaveCachedValue : 1;
   bool mRooted : 1;
   bool mContinueCalled : 1;
   bool mHaveValue : 1;
 
 public:
   static already_AddRefed<IDBCursor>
-  Create(BackgroundCursorChild* aBackgroundActor,
+  Create(indexedDB::BackgroundCursorChild* aBackgroundActor,
          const Key& aKey,
          StructuredCloneReadInfo&& aCloneInfo);
 
   static already_AddRefed<IDBCursor>
-  Create(BackgroundCursorChild* aBackgroundActor,
+  Create(indexedDB::BackgroundCursorChild* aBackgroundActor,
          const Key& aKey);
 
   static already_AddRefed<IDBCursor>
-  Create(BackgroundCursorChild* aBackgroundActor,
+  Create(indexedDB::BackgroundCursorChild* aBackgroundActor,
          const Key& aKey,
          const Key& aSortKey,
          const Key& aPrimaryKey,
          StructuredCloneReadInfo&& aCloneInfo);
 
   static already_AddRefed<IDBCursor>
-  Create(BackgroundCursorChild* aBackgroundActor,
+  Create(indexedDB::BackgroundCursorChild* aBackgroundActor,
          const Key& aKey,
          const Key& aSortKey,
          const Key& aPrimaryKey);
 
   static Direction
   ConvertDirection(IDBCursorDirection aDirection);
 
   void
@@ -189,17 +192,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IDBCursor)
 
   // nsWrapperCache
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 private:
   IDBCursor(Type aType,
-            BackgroundCursorChild* aBackgroundActor,
+            indexedDB::BackgroundCursorChild* aBackgroundActor,
             const Key& aKey);
 
   ~IDBCursor();
 
 #ifdef ENABLE_INTL_API
   // Checks if this is a locale aware cursor (ie. the index's sortKey is unset)
   bool
   IsLocaleAware() const;
@@ -207,13 +210,12 @@ private:
 
   void
   DropJSObjects();
 
   bool
   IsSourceDeleted() const;
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbcursor_h__
+#endif // mozilla_dom_idbcursor_h__
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -51,17 +51,16 @@
 #include "ReportInternalError.h"
 #include "nsQueryObject.h"
 
 // Include this last to avoid path problems on Windows.
 #include "ActorsChild.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 using namespace mozilla::dom::quota;
 using namespace mozilla::ipc;
 using namespace mozilla::services;
 
 namespace {
 
 const char kCycleCollectionObserverTopic[] = "cycle-collector-end";
@@ -1479,11 +1478,10 @@ Observer::Observe(nsISupports* aSubject,
 
     return NS_OK;
   }
 
   NS_WARNING("Unknown observer topic!");
   return NS_OK;
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBDatabase.h
+++ b/dom/indexedDB/IDBDatabase.h
@@ -1,21 +1,21 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbdatabase_h__
-#define mozilla_dom_indexeddb_idbdatabase_h__
+#ifndef mozilla_dom_idbdatabase_h__
+#define mozilla_dom_idbdatabase_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDBTransactionBinding.h"
 #include "mozilla/dom/StorageTypeBinding.h"
-#include "mozilla/dom/indexedDB/IDBWrapperCache.h"
+#include "mozilla/dom/IDBWrapperCache.h"
 #include "mozilla/dom/quota/PersistenceType.h"
 #include "nsAutoPtr.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "nsString.h"
 #include "nsTHashtable.h"
 
 class nsIDocument;
@@ -25,35 +25,36 @@ namespace mozilla {
 
 class ErrorResult;
 class EventChainPostVisitor;
 
 namespace dom {
 
 class Blob;
 class DOMStringList;
+class IDBFactory;
+class IDBMutableFile;
+class IDBObjectStore;
 struct IDBObjectStoreParameters;
+class IDBOpenDBRequest;
+class IDBRequest;
+class IDBTransaction;
 template <class> class Optional;
 class StringOrStringSequence;
 
 namespace indexedDB {
-
 class BackgroundDatabaseChild;
 class DatabaseSpec;
-class IDBFactory;
-class IDBMutableFile;
-class IDBObjectStore;
-class IDBOpenDBRequest;
-class IDBRequest;
-class IDBTransaction;
 class PBackgroundIDBDatabaseFileChild;
+}
 
 class IDBDatabase final
   : public IDBWrapperCache
 {
+  typedef mozilla::dom::indexedDB::DatabaseSpec DatabaseSpec;
   typedef mozilla::dom::StorageType StorageType;
   typedef mozilla::dom::quota::PersistenceType PersistenceType;
 
   class LogWarningRunnable;
   friend class LogWarningRunnable;
 
   class Observer;
   friend class Observer;
@@ -63,21 +64,21 @@ class IDBDatabase final
   // and the world will explode.
   RefPtr<IDBFactory> mFactory;
 
   nsAutoPtr<DatabaseSpec> mSpec;
 
   // Normally null except during a versionchange transaction.
   nsAutoPtr<DatabaseSpec> mPreviousSpec;
 
-  BackgroundDatabaseChild* mBackgroundActor;
+  indexedDB::BackgroundDatabaseChild* mBackgroundActor;
 
   nsTHashtable<nsPtrHashKey<IDBTransaction>> mTransactions;
 
-  nsDataHashtable<nsISupportsHashKey, PBackgroundIDBDatabaseFileChild*>
+  nsDataHashtable<nsISupportsHashKey, indexedDB::PBackgroundIDBDatabaseFileChild*>
     mFileActors;
 
   nsTHashtable<nsISupportsHashKey> mReceivedBlobs;
 
   RefPtr<Observer> mObserver;
 
   // Weak refs, IDBMutableFile strongly owns this IDBDatabase object.
   nsTArray<IDBMutableFile*> mLiveMutableFiles;
@@ -85,17 +86,17 @@ class IDBDatabase final
   const bool mFileHandleDisabled;
   bool mClosed;
   bool mInvalidated;
 
 public:
   static already_AddRefed<IDBDatabase>
   Create(IDBOpenDBRequest* aRequest,
          IDBFactory* aFactory,
-         BackgroundDatabaseChild* aActor,
+         indexedDB::BackgroundDatabaseChild* aActor,
          DatabaseSpec* aSpec);
 
 #ifdef DEBUG
   void
   AssertIsOnOwningThread() const;
 
   PRThread*
   OwningThread() const;
@@ -174,21 +175,21 @@ public:
   RegisterTransaction(IDBTransaction* aTransaction);
 
   void
   UnregisterTransaction(IDBTransaction* aTransaction);
 
   void
   AbortTransactions(bool aShouldWarn);
 
-  PBackgroundIDBDatabaseFileChild*
+  indexedDB::PBackgroundIDBDatabaseFileChild*
   GetOrCreateFileActorForBlob(Blob* aBlob);
 
   void
-  NoteFinishedFileActor(PBackgroundIDBDatabaseFileChild* aFileActor);
+  NoteFinishedFileActor(indexedDB::PBackgroundIDBDatabaseFileChild* aFileActor);
 
   void
   NoteReceivedBlob(Blob* aBlob);
 
   void
   DelayedMaybeExpireFileActors();
 
   // XXX This doesn't really belong here... It's only needed for IDBMutableFile
@@ -280,17 +281,17 @@ public:
 
   // nsWrapperCache
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 private:
   IDBDatabase(IDBOpenDBRequest* aRequest,
               IDBFactory* aFactory,
-              BackgroundDatabaseChild* aActor,
+              indexedDB::BackgroundDatabaseChild* aActor,
               DatabaseSpec* aSpec);
 
   ~IDBDatabase();
 
   void
   CloseInternal();
 
   void
@@ -315,13 +316,12 @@ private:
 
   void
   LogWarning(const char* aMessageName,
              const nsAString& aFilename,
              uint32_t aLineNumber,
              uint32_t aColumnNumber);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbdatabase_h__
+#endif // mozilla_dom_idbdatabase_h__
--- a/dom/indexedDB/IDBEvents.cpp
+++ b/dom/indexedDB/IDBEvents.cpp
@@ -39,16 +39,18 @@ CreateGenericEvent(EventTarget* aOwner,
                    aBubbles == eDoesBubble ? true : false,
                    aCancelable == eCancelable ? true : false);
 
   event->SetTrusted(true);
 
   return event.forget();
 }
 
+} // namespace indexedDB
+
 // static
 already_AddRefed<IDBVersionChangeEvent>
 IDBVersionChangeEvent::CreateInternal(EventTarget* aOwner,
                                       const nsAString& aType,
                                       uint64_t aOldVersion,
                                       Nullable<uint64_t> aNewVersion)
 {
   RefPtr<IDBVersionChangeEvent> event =
@@ -86,11 +88,10 @@ NS_INTERFACE_MAP_BEGIN(IDBVersionChangeE
 NS_INTERFACE_MAP_END_INHERITING(Event)
 
 JSObject*
 IDBVersionChangeEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return IDBVersionChangeEventBinding::Wrap(aCx, this, aGivenProto);
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBEvents.h
+++ b/dom/indexedDB/IDBEvents.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbevents_h__
-#define mozilla_dom_indexeddb_idbevents_h__
+#ifndef mozilla_dom_idbevents_h__
+#define mozilla_dom_idbevents_h__
 
 #include "js/RootingAPI.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/Nullable.h"
 
 #define IDBVERSIONCHANGEEVENT_IID \
   {0x3b65d4c3, 0x73ad, 0x492e, {0xb1, 0x2d, 0x15, 0xf9, 0xda, 0xc2, 0x08, 0x4b}}
@@ -49,16 +49,18 @@ extern const char16_t* kUpgradeNeededEve
 extern const char16_t* kVersionChangeEventType;
 
 already_AddRefed<nsIDOMEvent>
 CreateGenericEvent(EventTarget* aOwner,
                    const nsDependentString& aType,
                    Bubbles aBubbles,
                    Cancelable aCancelable);
 
+} // namespace indexedDB
+
 class IDBVersionChangeEvent final : public Event
 {
   uint64_t mOldVersion;
   Nullable<uint64_t> mNewVersion;
 
 public:
   static already_AddRefed<IDBVersionChangeEvent>
   Create(EventTarget* aOwner,
@@ -120,13 +122,12 @@ private:
   CreateInternal(EventTarget* aOwner,
                  const nsAString& aName,
                  uint64_t aOldVersion,
                  Nullable<uint64_t> aNewVersion);
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(IDBVersionChangeEvent, IDBVERSIONCHANGEEVENT_IID)
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbevents_h__
+#endif // mozilla_dom_idbevents_h__
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -38,17 +38,16 @@
 #include "ActorsChild.h"
 
 #ifdef DEBUG
 #include "nsContentUtils.h" // For assertions.
 #endif
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 using namespace mozilla::dom::quota;
 using namespace mozilla::ipc;
 
 namespace {
 
 const char kPrefIndexedDBEnabled[] = "dom.indexedDB.enabled";
 
@@ -950,11 +949,10 @@ IDBFactory::BackgroundCreateCallback::Ac
   MOZ_ASSERT(mFactory);
 
   RefPtr<IDBFactory> factory;
   mFactory.swap(factory);
 
   factory->BackgroundActorFailed();
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBFactory.h
+++ b/dom/indexedDB/IDBFactory.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbfactory_h__
-#define mozilla_dom_indexeddb_idbfactory_h__
+#ifndef mozilla_dom_idbfactory_h__
+#define mozilla_dom_idbfactory_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/StorageTypeBinding.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupports.h"
 #include "nsString.h"
@@ -30,25 +30,25 @@ namespace ipc {
 class PBackgroundChild;
 class PrincipalInfo;
 
 } // namespace ipc
 
 namespace dom {
 
 struct IDBOpenDBOptions;
+class IDBOpenDBRequest;
 template <typename> class Optional;
 class TabChild;
 
 namespace indexedDB {
-
 class BackgroundFactoryChild;
 class FactoryRequestParams;
-class IDBOpenDBRequest;
 class LoggingInfo;
+}
 
 class IDBFactory final
   : public nsISupports
   , public nsWrapperCache
 {
   typedef mozilla::dom::StorageType StorageType;
   typedef mozilla::ipc::PBackgroundChild PBackgroundChild;
   typedef mozilla::ipc::PrincipalInfo PrincipalInfo;
@@ -64,17 +64,17 @@ class IDBFactory final
   JS::Heap<JSObject*> mOwningObject;
 
   // This will only be set if the factory belongs to a window in a child
   // process.
   RefPtr<TabChild> mTabChild;
 
   nsTArray<nsAutoPtr<PendingRequestInfo>> mPendingRequests;
 
-  BackgroundFactoryChild* mBackgroundActor;
+  indexedDB::BackgroundFactoryChild* mBackgroundActor;
 
 #ifdef DEBUG
   PRThread* mOwningThread;
 #endif
 
   uint64_t mInnerWindowID;
 
   bool mBackgroundActorFailed;
@@ -235,23 +235,22 @@ private:
                const nsAString& aName,
                const Optional<uint64_t>& aVersion,
                const Optional<StorageType>& aStorageType,
                bool aDeleting,
                ErrorResult& aRv);
 
   nsresult
   BackgroundActorCreated(PBackgroundChild* aBackgroundActor,
-                         const LoggingInfo& aLoggingInfo);
+                         const indexedDB::LoggingInfo& aLoggingInfo);
 
   void
   BackgroundActorFailed();
 
   nsresult
   InitiateRequest(IDBOpenDBRequest* aRequest,
-                  const FactoryRequestParams& aParams);
+                  const indexedDB::FactoryRequestParams& aParams);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbfactory_h__
+#endif // mozilla_dom_idbfactory_h__
--- a/dom/indexedDB/IDBFileHandle.cpp
+++ b/dom/indexedDB/IDBFileHandle.cpp
@@ -12,17 +12,18 @@
 #include "mozilla/dom/IDBFileHandleBinding.h"
 #include "mozilla/dom/filehandle/ActorsChild.h"
 #include "mozilla/EventDispatcher.h"
 #include "nsServiceManagerUtils.h"
 #include "nsWidgetsCID.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
+
+using namespace mozilla::dom::indexedDB;
 
 IDBFileHandle::IDBFileHandle(FileMode aMode,
                              IDBMutableFile* aMutableFile)
   : FileHandleBase(DEBUGONLY(aMutableFile->OwningThread(),)
                    aMode)
   , mMutableFile(aMutableFile)
 {
   AssertIsOnOwningThread();
@@ -189,11 +190,10 @@ already_AddRefed<mozilla::dom::FileReque
 IDBFileHandle::GenerateFileRequest()
 {
   AssertIsOnOwningThread();
 
   return IDBFileRequest::Create(GetOwner(), this,
                                 /* aWrapAsDOMRequest */ false);
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBFileHandle.h
+++ b/dom/indexedDB/IDBFileHandle.h
@@ -1,35 +1,32 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbfilehandle_h__
-#define mozilla_dom_indexeddb_idbfilehandle_h__
+#ifndef mozilla_dom_idbfilehandle_h__
+#define mozilla_dom_idbfilehandle_h__
 
 #include "IDBFileRequest.h"
 #include "js/TypeDecls.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/FileHandleBase.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIRunnable.h"
 #include "nsWeakReference.h"
 
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 namespace dom {
 
 struct IDBFileMetadataParameters;
-
-namespace indexedDB {
-
 class IDBFileRequest;
 class IDBMutableFile;
 
 class IDBFileHandle final
   : public DOMEventTargetHelper
   , public nsIRunnable
   , public FileHandleBase
   , public nsSupportsWeakReference
@@ -141,13 +138,12 @@ private:
   // FileHandleBase
   virtual bool
   CheckWindow() override;
 
   virtual already_AddRefed<FileRequestBase>
   GenerateFileRequest() override;
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbfilehandle_h__
+#endif // mozilla_dom_idbfilehandle_h__
--- a/dom/indexedDB/IDBFileRequest.cpp
+++ b/dom/indexedDB/IDBFileRequest.cpp
@@ -16,17 +16,18 @@
 #include "mozilla/EventDispatcher.h"
 #include "nsCOMPtr.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsLiteralString.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
+
+using namespace mozilla::dom::indexedDB;
 
 IDBFileRequest::IDBFileRequest(nsPIDOMWindowInner* aWindow,
                                IDBFileHandle* aFileHandle,
                                bool aWrapAsDOMRequest)
   : DOMRequest(aWindow)
   , FileRequestBase(DEBUGONLY(aFileHandle->OwningThread()))
   , mFileHandle(aFileHandle)
   , mWrapAsDOMRequest(aWrapAsDOMRequest)
@@ -147,11 +148,10 @@ IDBFileRequest::FireProgressEvent(uint64
   init.mLoaded = aLoaded;
   init.mTotal = aTotal;
 
   RefPtr<ProgressEvent> event =
     ProgressEvent::Constructor(this, NS_LITERAL_STRING("progress"), init);
   DispatchTrustedEvent(event);
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBFileRequest.h
+++ b/dom/indexedDB/IDBFileRequest.h
@@ -1,33 +1,32 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbfilerequest_h__
-#define mozilla_dom_indexeddb_idbfilerequest_h__
+#ifndef mozilla_dom_idbfilerequest_h__
+#define mozilla_dom_idbfilerequest_h__
 
 #include "DOMRequest.h"
 #include "js/TypeDecls.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/FileRequestBase.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 
 template <class> struct already_AddRefed;
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 
 class EventChainPreVisitor;
 
 namespace dom {
-namespace indexedDB {
 
 class IDBFileHandle;
 
 class IDBFileRequest final : public DOMRequest,
                              public FileRequestBase
 {
   RefPtr<IDBFileHandle> mFileHandle;
 
@@ -85,13 +84,12 @@ private:
                  bool aWrapAsDOMRequest);
 
   ~IDBFileRequest();
 
   void
   FireProgressEvent(uint64_t aLoaded, uint64_t aTotal);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbfilerequest_h__
+#endif // mozilla_dom_idbfilerequest_h__
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -20,17 +20,16 @@
 #include "ProfilerHelpers.h"
 #include "ReportInternalError.h"
 
 // Include this last to avoid path problems on Windows.
 #include "ActorsChild.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 namespace {
 
 already_AddRefed<IDBRequest>
 GenerateRequest(IDBIndex* aIndex)
 {
   MOZ_ASSERT(aIndex);
   aIndex->AssertIsOnOwningThread();
@@ -172,17 +171,17 @@ bool
 IDBIndex::LocaleAware() const
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mMetadata);
 
   return mMetadata->locale().IsEmpty();
 }
 
-const KeyPath&
+const indexedDB::KeyPath&
 IDBIndex::GetKeyPath() const
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mMetadata);
 
   return mMetadata->keyPath();
 }
 
@@ -616,11 +615,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ID
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 JSObject*
 IDBIndex::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return IDBIndexBinding::Wrap(aCx, this, aGivenProto);
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBIndex.h
+++ b/dom/indexedDB/IDBIndex.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbindex_h__
-#define mozilla_dom_indexeddb_idbindex_h__
+#ifndef mozilla_dom_idbindex_h__
+#define mozilla_dom_idbindex_h__
 
 #include "js/RootingAPI.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDBCursorBinding.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupports.h"
 #include "nsTArrayForwardDeclare.h"
@@ -19,50 +19,49 @@
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
+class IDBObjectStore;
+class IDBRequest;
 template <typename> class Sequence;
 
 namespace indexedDB {
-
-class IDBObjectStore;
-class IDBRequest;
 class IndexMetadata;
-class Key;
 class KeyPath;
+} // namespace indexedDB
 
 class IDBIndex final
   : public nsISupports
   , public nsWrapperCache
 {
   RefPtr<IDBObjectStore> mObjectStore;
 
   JS::Heap<JS::Value> mCachedKeyPath;
 
   // This normally points to the IndexMetadata owned by the parent IDBDatabase
   // object. However, if this index is part of a versionchange transaction and
   // it gets deleted then the metadata is copied into mDeletedMetadata and
   // mMetadata is set to point at mDeletedMetadata.
-  const IndexMetadata* mMetadata;
-  nsAutoPtr<IndexMetadata> mDeletedMetadata;
+  const indexedDB::IndexMetadata* mMetadata;
+  nsAutoPtr<indexedDB::IndexMetadata> mDeletedMetadata;
 
   const int64_t mId;
   bool mRooted;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IDBIndex)
 
   static already_AddRefed<IDBIndex>
-  Create(IDBObjectStore* aObjectStore, const IndexMetadata& aMetadata);
+  Create(IDBObjectStore* aObjectStore, const indexedDB::IndexMetadata& aMetadata);
 
   int64_t
   Id() const
   {
     AssertIsOnOwningThread();
 
     return mId;
   }
@@ -74,17 +73,17 @@ public:
   Unique() const;
 
   bool
   MultiEntry() const;
 
   bool
   LocaleAware() const;
 
-  const KeyPath&
+  const indexedDB::KeyPath&
   GetKeyPath() const;
 
   void
   GetLocale(nsString& aLocale) const;
 
   const nsCString&
   Locale() const;
 
@@ -196,17 +195,17 @@ public:
   { }
 #endif
 
   // nsWrapperCache
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 private:
-  IDBIndex(IDBObjectStore* aObjectStore, const IndexMetadata* aMetadata);
+  IDBIndex(IDBObjectStore* aObjectStore, const indexedDB::IndexMetadata* aMetadata);
 
   ~IDBIndex();
 
   already_AddRefed<IDBRequest>
   GetInternal(bool aKeyOnly,
               JSContext* aCx,
               JS::Handle<JS::Value> aKey,
               ErrorResult& aRv);
@@ -221,13 +220,12 @@ private:
   already_AddRefed<IDBRequest>
   OpenCursorInternal(bool aKeysOnly,
                      JSContext* aCx,
                      JS::Handle<JS::Value> aRange,
                      IDBCursorDirection aDirection,
                      ErrorResult& aRv);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbindex_h__
+#endif // mozilla_dom_idbindex_h__
--- a/dom/indexedDB/IDBKeyRange.cpp
+++ b/dom/indexedDB/IDBKeyRange.cpp
@@ -9,17 +9,18 @@
 #include "Key.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/IDBKeyRangeBinding.h"
 #include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
+
+using namespace mozilla::dom::indexedDB;
 
 namespace {
 
 nsresult
 GetKeyFromJSVal(JSContext* aCx,
                 JS::Handle<JS::Value> aVal,
                 Key& aKey,
                 bool aAllowUnset = false)
@@ -442,11 +443,10 @@ IDBLocaleAwareKeyRange::Bound(const Glob
   if (keyRange->Lower() == keyRange->Upper() && (aLowerOpen || aUpperOpen)) {
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
     return nullptr;
   }
 
   return keyRange.forget();
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBKeyRange.h
+++ b/dom/indexedDB/IDBKeyRange.h
@@ -1,21 +1,21 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbkeyrange_h__
-#define mozilla_dom_indexeddb_idbkeyrange_h__
+#ifndef mozilla_dom_idbkeyrange_h__
+#define mozilla_dom_idbkeyrange_h__
 
 #include "js/RootingAPI.h"
 #include "js/Value.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
+#include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/dom/indexedDB/Key.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupports.h"
 #include "nsString.h"
 
 class mozIStorageStatement;
 struct PRThread;
@@ -24,26 +24,26 @@ namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 class GlobalObject;
 
 namespace indexedDB {
-
 class SerializedKeyRange;
+} // namespace indexedDB
 
 class IDBKeyRange
   : public nsISupports
 {
 protected:
   nsCOMPtr<nsISupports> mGlobal;
-  Key mLower;
-  Key mUpper;
+  indexedDB::Key mLower;
+  indexedDB::Key mUpper;
   JS::Heap<JS::Value> mCachedLowerVal;
   JS::Heap<JS::Value> mCachedUpperVal;
 
   const bool mLowerOpen : 1;
   const bool mUpperOpen : 1;
   const bool mIsOnly : 1;
   bool mHaveCachedLowerVal : 1;
   bool mHaveCachedUpperVal : 1;
@@ -58,17 +58,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IDBKeyRange)
 
   static nsresult
   FromJSVal(JSContext* aCx,
             JS::Handle<JS::Value> aVal,
             IDBKeyRange** aKeyRange);
 
   static already_AddRefed<IDBKeyRange>
-  FromSerialized(const SerializedKeyRange& aKeyRange);
+  FromSerialized(const indexedDB::SerializedKeyRange& aKeyRange);
 
   static already_AddRefed<IDBKeyRange>
   Only(const GlobalObject& aGlobal,
        JS::Handle<JS::Value> aValue,
        ErrorResult& aRv);
 
   static already_AddRefed<IDBKeyRange>
   LowerBound(const GlobalObject& aGlobal,
@@ -94,37 +94,37 @@ public:
   AssertIsOnOwningThread() const
 #ifdef DEBUG
   ;
 #else
   { }
 #endif
 
   void
-  ToSerialized(SerializedKeyRange& aKeyRange) const;
+  ToSerialized(indexedDB::SerializedKeyRange& aKeyRange) const;
 
-  const Key&
+  const indexedDB::Key&
   Lower() const
   {
     return mLower;
   }
 
-  Key&
+  indexedDB::Key&
   Lower()
   {
     return mLower;
   }
 
-  const Key&
+  const indexedDB::Key&
   Upper() const
   {
     return mIsOnly ? mLower : mUpper;
   }
 
-  Key&
+  indexedDB::Key&
   Upper()
   {
     return mIsOnly ? mLower : mUpper;
   }
 
   bool
   IsOnly() const
   {
@@ -201,13 +201,12 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // WebIDL
   bool
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbkeyrange_h__
+#endif // mozilla_dom_idbkeyrange_h__
--- a/dom/indexedDB/IDBMutableFile.cpp
+++ b/dom/indexedDB/IDBMutableFile.cpp
@@ -29,18 +29,18 @@
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsIInputStream.h"
 #include "nsIPrincipal.h"
 #include "ReportInternalError.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
+using namespace mozilla::dom::indexedDB;
 using namespace mozilla::dom::quota;
 
 IDBMutableFile::IDBMutableFile(IDBDatabase* aDatabase,
                                BackgroundMutableFileChild* aActor,
                                const nsAString& aName,
                                const nsAString& aType)
   : DOMEventTargetHelper(aDatabase)
   , MutableFileBase(DEBUGONLY(aDatabase->OwningThread(),)
@@ -274,11 +274,10 @@ IDBMutableFile::CreateFileFor(BlobImpl* 
 
   RefPtr<BlobImpl> blobImplSnapshot =
     new BlobImplSnapshot(aBlobImpl, static_cast<IDBFileHandle*>(aFileHandle));
 
   RefPtr<File> file = File::Create(GetOwner(), blobImplSnapshot);
   return file.forget();
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBMutableFile.h
+++ b/dom/indexedDB/IDBMutableFile.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbmutablefile_h__
-#define mozilla_dom_indexeddb_idbmutablefile_h__
+#ifndef mozilla_dom_idbmutablefile_h__
+#define mozilla_dom_idbmutablefile_h__
 
 #include "js/TypeDecls.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/dom/FileModeBinding.h"
 #include "mozilla/dom/MutableFileBase.h"
 #include "nsAutoPtr.h"
@@ -24,39 +24,39 @@ class nsPIDOMWindowInner;
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 class DOMRequest;
 class File;
+class IDBDatabase;
+class IDBFileHandle;
 
 namespace indexedDB {
-
 class BackgroundMutableFileChild;
-class IDBDatabase;
-class IDBFileHandle;
+}
 
 class IDBMutableFile final
   : public DOMEventTargetHelper
   , public MutableFileBase
 {
   RefPtr<IDBDatabase> mDatabase;
 
   nsTHashtable<nsPtrHashKey<IDBFileHandle>> mFileHandles;
 
   nsString mName;
   nsString mType;
 
   Atomic<bool> mInvalidated;
 
 public:
   IDBMutableFile(IDBDatabase* aDatabase,
-                 BackgroundMutableFileChild* aActor,
+                 indexedDB::BackgroundMutableFileChild* aActor,
                  const nsAString& aName,
                  const nsAString& aType);
 
   void
   SetLazyData(const nsAString& aName,
               const nsAString& aType)
   {
     mName = aName;
@@ -129,13 +129,12 @@ public:
   virtual already_AddRefed<File>
   CreateFileFor(BlobImpl* aBlobImpl,
                 FileHandleBase* aFileHandle) override;
 
 private:
   ~IDBMutableFile();
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbmutablefile_h__
+#endif // mozilla_dom_idbmutablefile_h__
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -49,17 +49,16 @@
 #include "WorkerPrivate.h"
 #include "WorkerScope.h"
 
 // Include this last to avoid path problems on Windows.
 #include "ActorsChild.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 using namespace mozilla::dom::quota;
 using namespace mozilla::dom::workers;
 using namespace mozilla::ipc;
 
 struct IDBObjectStore::StructuredCloneWriteInfo
 {
   struct BlobOrMutableFile
@@ -2269,17 +2268,17 @@ bool
 IDBObjectStore::AutoIncrement() const
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mSpec);
 
   return mSpec->metadata().autoIncrement();
 }
 
-const KeyPath&
+const indexedDB::KeyPath&
 IDBObjectStore::GetKeyPath() const
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mSpec);
 
   return mSpec->metadata().keyPath();
 }
 
@@ -2287,11 +2286,10 @@ bool
 IDBObjectStore::HasValidKeyPath() const
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mSpec);
 
   return GetKeyPath().IsValid();
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBObjectStore.h
+++ b/dom/indexedDB/IDBObjectStore.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbobjectstore_h__
-#define mozilla_dom_indexeddb_idbobjectstore_h__
+#ifndef mozilla_dom_idbobjectstore_h__
+#define mozilla_dom_idbobjectstore_h__
 
 #include "js/RootingAPI.h"
 #include "mozilla/dom/IDBCursorBinding.h"
 #include "mozilla/dom/IDBIndexBinding.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupports.h"
 #include "nsString.h"
@@ -22,35 +22,41 @@ class nsPIDOMWindowInner;
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 class DOMStringList;
+class IDBCursor;
+class IDBRequest;
+class IDBTransaction;
 template <typename> class Sequence;
 
 namespace indexedDB {
-
-class IDBCursor;
-class IDBRequest;
-class IDBTransaction;
-class IndexUpdateInfo;
 class Key;
 class KeyPath;
+class IndexUpdateInfo;
 class ObjectStoreSpec;
 struct StructuredCloneReadInfo;
+} // namespace indexedDB
 
 class IDBObjectStore final
   : public nsISupports
   , public nsWrapperCache
 {
+  typedef indexedDB::IndexUpdateInfo IndexUpdateInfo;
+  typedef indexedDB::Key Key;
+  typedef indexedDB::KeyPath KeyPath;
+  typedef indexedDB::ObjectStoreSpec ObjectStoreSpec;
+  typedef indexedDB::StructuredCloneReadInfo StructuredCloneReadInfo;
+
   // For AddOrPut() and DeleteInternal().
-  friend class IDBCursor; 
+  friend class IDBCursor;
 
   static const JSClass sDummyPropJSClass;
 
   RefPtr<IDBTransaction> mTransaction;
   JS::Heap<JS::Value> mCachedKeyPath;
 
   // This normally points to the ObjectStoreSpec owned by the parent IDBDatabase
   // object. However, if this objectStore is part of a versionchange transaction
@@ -334,13 +340,12 @@ private:
   already_AddRefed<IDBRequest>
   OpenCursorInternal(bool aKeysOnly,
                      JSContext* aCx,
                      JS::Handle<JS::Value> aRange,
                      IDBCursorDirection aDirection,
                      ErrorResult& aRv);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbobjectstore_h__
+#endif // mozilla_dom_idbobjectstore_h__
--- a/dom/indexedDB/IDBRequest.cpp
+++ b/dom/indexedDB/IDBRequest.cpp
@@ -33,18 +33,18 @@
 #include "WorkerFeature.h"
 #include "WorkerPrivate.h"
 
 // Include this last to avoid path problems on Windows.
 #include "ActorsChild.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
+using namespace mozilla::dom::indexedDB;
 using namespace mozilla::dom::workers;
 using namespace mozilla::ipc;
 
 namespace {
 
 NS_DEFINE_IID(kIDBRequestIID, PRIVATE_IDBREQUEST_IID);
 
 } // namespace
@@ -655,11 +655,10 @@ WorkerFeature::Notify(JSContext* aCx, St
   MOZ_ASSERT(aStatus > Running);
 
   // There's nothing we can really do here at the moment...
   NS_WARNING("Worker closing but IndexedDB is waiting to open a database!");
 
   return true;
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBRequest.h
+++ b/dom/indexedDB/IDBRequest.h
@@ -1,49 +1,46 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbrequest_h__
-#define mozilla_dom_indexeddb_idbrequest_h__
+#ifndef mozilla_dom_idbrequest_h__
+#define mozilla_dom_idbrequest_h__
 
 #include "js/RootingAPI.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/IDBRequestBinding.h"
-#include "mozilla/dom/indexedDB/IDBWrapperCache.h"
+#include "mozilla/dom/IDBWrapperCache.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 
 #define PRIVATE_IDBREQUEST_IID \
   {0xe68901e5, 0x1d50, 0x4ee9, {0xaf, 0x49, 0x90, 0x99, 0x4a, 0xff, 0xc8, 0x39}}
 
 class nsPIDOMWindowInner;
 struct PRThread;
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 class DOMError;
-template <typename> struct Nullable;
-class OwningIDBObjectStoreOrIDBIndexOrIDBCursor;
-
-namespace indexedDB {
-
 class IDBCursor;
 class IDBDatabase;
 class IDBFactory;
 class IDBIndex;
 class IDBObjectStore;
 class IDBTransaction;
+template <typename> struct Nullable;
+class OwningIDBObjectStoreOrIDBIndexOrIDBCursor;
 
 class IDBRequest
   : public IDBWrapperCache
 {
 protected:
   // mSourceAsObjectStore and mSourceAsIndex are exclusive and one must always
   // be set. mSourceAsCursor is sometimes set also.
   RefPtr<IDBObjectStore> mSourceAsObjectStore;
@@ -280,13 +277,12 @@ public:
 private:
   IDBOpenDBRequest(IDBFactory* aFactory,
                    nsPIDOMWindowInner* aOwner,
                    bool aFileHandleDisabled);
 
   ~IDBOpenDBRequest();
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbrequest_h__
+#endif // mozilla_dom_idbrequest_h__
--- a/dom/indexedDB/IDBTransaction.cpp
+++ b/dom/indexedDB/IDBTransaction.cpp
@@ -24,18 +24,18 @@
 #include "WorkerFeature.h"
 #include "WorkerPrivate.h"
 
 // Include this last to avoid path problems on Windows.
 #include "ActorsChild.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
+using namespace mozilla::dom::indexedDB;
 using namespace mozilla::dom::workers;
 using namespace mozilla::ipc;
 
 class IDBTransaction::WorkerFeature final
   : public mozilla::dom::workers::WorkerFeature
 {
   WorkerPrivate* mWorkerPrivate;
 
@@ -274,17 +274,17 @@ IDBTransaction::AssertIsOnOwningThread()
 {
   MOZ_ASSERT(mDatabase);
   mDatabase->AssertIsOnOwningThread();
 }
 
 #endif // DEBUG
 
 void
-IDBTransaction::SetBackgroundActor(BackgroundTransactionChild* aBackgroundActor)
+IDBTransaction::SetBackgroundActor(indexedDB::BackgroundTransactionChild* aBackgroundActor)
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(aBackgroundActor);
   MOZ_ASSERT(!mBackgroundActor.mNormalBackgroundActor);
   MOZ_ASSERT(mMode != VERSION_CHANGE);
 
   mBackgroundActor.mNormalBackgroundActor = aBackgroundActor;
 }
@@ -565,17 +565,17 @@ IDBTransaction::DeleteObjectStore(int64_
       mObjectStores.RemoveElementAt(index);
       break;
     }
   }
 }
 
 void
 IDBTransaction::CreateIndex(IDBObjectStore* aObjectStore,
-                            const IndexMetadata& aMetadata)
+                            const indexedDB::IndexMetadata& aMetadata)
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(aObjectStore);
   MOZ_ASSERT(aMetadata.id());
   MOZ_ASSERT(VERSION_CHANGE == mMode);
   MOZ_ASSERT(mBackgroundActor.mVersionChangeBackgroundActor);
   MOZ_ASSERT(IsOpen());
 
@@ -1007,11 +1007,10 @@ WorkerFeature::Notify(JSContext* aCx, St
       IDB_REPORT_INTERNAL_ERR();
       transaction->AbortInternal(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR, nullptr);
     }
   }
 
   return true;
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBTransaction.h
+++ b/dom/indexedDB/IDBTransaction.h
@@ -1,20 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbtransaction_h__
-#define mozilla_dom_indexeddb_idbtransaction_h__
+#ifndef mozilla_dom_idbtransaction_h__
+#define mozilla_dom_idbtransaction_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/IDBTransactionBinding.h"
-#include "mozilla/dom/indexedDB/IDBWrapperCache.h"
+#include "mozilla/dom/IDBWrapperCache.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIRunnable.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 class nsPIDOMWindowInner;
 
@@ -22,38 +22,38 @@ namespace mozilla {
 
 class ErrorResult;
 class EventChainPreVisitor;
 
 namespace dom {
 
 class DOMError;
 class DOMStringList;
+class IDBDatabase;
+class IDBObjectStore;
+class IDBOpenDBRequest;
+class IDBRequest;
 
 namespace indexedDB {
-
 class BackgroundCursorChild;
 class BackgroundRequestChild;
 class BackgroundTransactionChild;
 class BackgroundVersionChangeTransactionChild;
-class IDBDatabase;
-class IDBObjectStore;
-class IDBOpenDBRequest;
-class IDBRequest;
 class IndexMetadata;
 class ObjectStoreSpec;
 class OpenCursorParams;
 class RequestParams;
+}
 
 class IDBTransaction final
   : public IDBWrapperCache
   , public nsIRunnable
 {
-  friend class BackgroundCursorChild;
-  friend class BackgroundRequestChild;
+  friend class indexedDB::BackgroundCursorChild;
+  friend class indexedDB::BackgroundRequestChild;
 
   class WorkerFeature;
   friend class WorkerFeature;
 
 public:
   enum Mode
   {
     READ_ONLY = 0,
@@ -80,18 +80,18 @@ private:
   nsTArray<RefPtr<IDBObjectStore>> mObjectStores;
   nsTArray<RefPtr<IDBObjectStore>> mDeletedObjectStores;
   nsAutoPtr<WorkerFeature> mWorkerFeature;
 
   // Tagged with mMode. If mMode is VERSION_CHANGE then mBackgroundActor will be
   // a BackgroundVersionChangeTransactionChild. Otherwise it will be a
   // BackgroundTransactionChild.
   union {
-    BackgroundTransactionChild* mNormalBackgroundActor;
-    BackgroundVersionChangeTransactionChild* mVersionChangeBackgroundActor;
+    indexedDB::BackgroundTransactionChild* mNormalBackgroundActor;
+    indexedDB::BackgroundVersionChangeTransactionChild* mVersionChangeBackgroundActor;
   } mBackgroundActor;
 
   const int64_t mLoggingSerialNumber;
 
   // Only used for VERSION_CHANGE transactions.
   int64_t mNextObjectStoreId;
   int64_t mNextIndexId;
 
@@ -112,17 +112,17 @@ private:
 #ifdef DEBUG
   bool mSentCommitOrAbort;
   bool mFiredCompleteOrAbort;
 #endif
 
 public:
   static already_AddRefed<IDBTransaction>
   CreateVersionChange(IDBDatabase* aDatabase,
-                      BackgroundVersionChangeTransactionChild* aActor,
+                      indexedDB::BackgroundVersionChangeTransactionChild* aActor,
                       IDBOpenDBRequest* aOpenRequest,
                       int64_t aNextObjectStoreId,
                       int64_t aNextIndexId);
 
   static already_AddRefed<IDBTransaction>
   Create(IDBDatabase* aDatabase,
          const nsTArray<nsString>& aObjectStoreNames,
          Mode aMode);
@@ -134,36 +134,36 @@ public:
   AssertIsOnOwningThread() const
 #ifdef DEBUG
   ;
 #else
   { }
 #endif
 
   void
-  SetBackgroundActor(BackgroundTransactionChild* aBackgroundActor);
+  SetBackgroundActor(indexedDB::BackgroundTransactionChild* aBackgroundActor);
 
   void
   ClearBackgroundActor()
   {
     AssertIsOnOwningThread();
 
     if (mMode == VERSION_CHANGE) {
       mBackgroundActor.mVersionChangeBackgroundActor = nullptr;
     } else {
       mBackgroundActor.mNormalBackgroundActor = nullptr;
     }
   }
 
-  BackgroundRequestChild*
-  StartRequest(IDBRequest* aRequest, const RequestParams& aParams);
+  indexedDB::BackgroundRequestChild*
+  StartRequest(IDBRequest* aRequest, const indexedDB::RequestParams& aParams);
 
   void
-  OpenCursor(BackgroundCursorChild* aBackgroundActor,
-             const OpenCursorParams& aParams);
+  OpenCursor(indexedDB::BackgroundCursorChild* aBackgroundActor,
+             const indexedDB::OpenCursorParams& aParams);
 
   void
   RefreshSpec(bool aMayDelete);
 
   bool
   IsOpen() const;
 
   bool
@@ -233,23 +233,23 @@ public:
   const nsTArray<nsString>&
   ObjectStoreNamesInternal() const
   {
     AssertIsOnOwningThread();
     return mObjectStoreNames;
   }
 
   already_AddRefed<IDBObjectStore>
-  CreateObjectStore(const ObjectStoreSpec& aSpec);
+  CreateObjectStore(const indexedDB::ObjectStoreSpec& aSpec);
 
   void
   DeleteObjectStore(int64_t aObjectStoreId);
 
   void
-  CreateIndex(IDBObjectStore* aObjectStore, const IndexMetadata& aMetadata);
+  CreateIndex(IDBObjectStore* aObjectStore, const indexedDB::IndexMetadata& aMetadata);
 
   void
   DeleteIndex(IDBObjectStore* aObjectStore, int64_t aIndexId);
 
   void
   Abort(IDBRequest* aRequest);
 
   void
@@ -325,13 +325,12 @@ private:
 
   void
   OnNewRequest();
 
   void
   OnRequestFinished(bool aActorDestroyedNormally);
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbtransaction_h__
+#endif // mozilla_dom_idbtransaction_h__
--- a/dom/indexedDB/IDBWrapperCache.cpp
+++ b/dom/indexedDB/IDBWrapperCache.cpp
@@ -8,17 +8,16 @@
 
 #include "mozilla/HoldDropJSObjects.h"
 #include "nsCOMPtr.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsPIDOMWindow.h"
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(IDBWrapperCache)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBWrapperCache,
                                                   DOMEventTargetHelper)
   // Don't need NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS because
   // DOMEventTargetHelper does it for us.
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
@@ -72,11 +71,10 @@ IDBWrapperCache::SetScriptOwner(JSObject
 void
 IDBWrapperCache::AssertIsRooted() const
 {
   MOZ_ASSERT(IsJSHolder(const_cast<IDBWrapperCache*>(this)),
              "Why aren't we rooted?!");
 }
 #endif
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBWrapperCache.h
+++ b/dom/indexedDB/IDBWrapperCache.h
@@ -1,27 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_idbwrappercache_h__
-#define mozilla_dom_indexeddb_idbwrappercache_h__
+#ifndef mozilla_dom_idbwrappercache_h__
+#define mozilla_dom_idbwrappercache_h__
 
 #include "js/RootingAPI.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 
 class nsPIDOMWindowInnter;
 
 namespace mozilla {
 namespace dom {
-namespace indexedDB {
 
 class IDBWrapperCache : public DOMEventTargetHelper
 {
   JS::Heap<JSObject*> mScriptOwner;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(IDBWrapperCache,
@@ -45,13 +44,12 @@ public:
 
 protected:
   explicit IDBWrapperCache(DOMEventTargetHelper* aOwner);
   explicit IDBWrapperCache(nsPIDOMWindowInner* aOwner);
 
   virtual ~IDBWrapperCache();
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_idbwrappercache_h__
+#endif // mozilla_dom_idbwrappercache_h__
--- a/dom/indexedDB/IndexedDatabase.h
+++ b/dom/indexedDB/IndexedDatabase.h
@@ -1,32 +1,32 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
-#define mozilla_dom_indexeddb_indexeddatabase_h__
+#ifndef mozilla_dom_indexeddatabase_h__
+#define mozilla_dom_indexeddatabase_h__
 
 #include "js/StructuredClone.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
 
 class Blob;
+class IDBDatabase;
+class IDBMutableFile;
 
 namespace indexedDB {
 
 class FileInfo;
-class IDBDatabase;
-class IDBMutableFile;
 class SerializedStructuredCloneReadInfo;
 
 struct StructuredCloneFile
 {
   RefPtr<Blob> mBlob;
   RefPtr<IDBMutableFile> mMutableFile;
   RefPtr<FileInfo> mFileInfo;
   bool mMutable;
@@ -69,9 +69,9 @@ struct StructuredCloneReadInfo
   inline
   MOZ_IMPLICIT StructuredCloneReadInfo(SerializedStructuredCloneReadInfo&& aOther);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_indexeddatabase_h__
+#endif // mozilla_dom_indexeddatabase_h__
--- a/dom/indexedDB/IndexedDatabaseInlines.h
+++ b/dom/indexedDB/IndexedDatabaseInlines.h
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef IndexedDatabaseInlines_h
 #define IndexedDatabaseInlines_h
 
-#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
+#ifndef mozilla_dom_indexeddatabase_h__
 #error Must include IndexedDatabase.h first
 #endif
 
 #include "FileInfo.h"
 #include "IDBMutableFile.h"
 #include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"
 #include "mozilla/dom/File.h"
 #include "nsIInputStream.h"
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -117,16 +117,20 @@ private:
     return const_cast<FileManagerInfo*>(this)->GetArray(aPersistenceType);
   }
 
   nsTArray<RefPtr<FileManager> > mPersistentStorageFileManagers;
   nsTArray<RefPtr<FileManager> > mTemporaryStorageFileManagers;
   nsTArray<RefPtr<FileManager> > mDefaultStorageFileManagers;
 };
 
+} // namespace indexedDB
+
+using namespace mozilla::dom::indexedDB;
+
 namespace {
 
 NS_DEFINE_IID(kIDBRequestIID, PRIVATE_IDBREQUEST_IID);
 
 const uint32_t kDeleteTimeoutMs = 1000;
 
 #define IDB_PREF_BRANCH_ROOT "dom.indexedDB."
 
@@ -1349,11 +1353,10 @@ DeleteFilesRunnable::UnblockOpen()
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(mState == State_UnblockingOpen);
 
   mDirectoryLock = nullptr;
 
   mState = State_Completed;
 }
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IndexedDatabaseManager.h
+++ b/dom/indexedDB/IndexedDatabaseManager.h
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-#ifndef mozilla_dom_indexeddb_indexeddatabasemanager_h__
-#define mozilla_dom_indexeddb_indexeddatabasemanager_h__
+#ifndef mozilla_dom_indexeddatabasemanager_h__
+#define mozilla_dom_indexeddatabasemanager_h__
 
 #include "nsIObserver.h"
 
 #include "js/TypeDecls.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/dom/quota/PersistenceType.h"
 #include "mozilla/Mutex.h"
 #include "nsClassHashtable.h"
@@ -21,28 +21,33 @@
 class nsIEventTarget;
 
 namespace mozilla {
 
 class EventChainPostVisitor;
 
 namespace dom {
 
+class IDBFactory;
+
 namespace indexedDB {
 
 class BackgroundUtilsChild;
 class FileManager;
 class FileManagerInfo;
-class IDBFactory;
+
+} // namespace indexedDB
 
 class IndexedDatabaseManager final
   : public nsIObserver
   , public nsITimerCallback
 {
   typedef mozilla::dom::quota::PersistenceType PersistenceType;
+  typedef mozilla::dom::indexedDB::FileManager FileManager;
+  typedef mozilla::dom::indexedDB::FileManagerInfo FileManagerInfo;
 
 public:
   enum LoggingMode
   {
     Logging_Disabled = 0,
     Logging_Concise,
     Logging_Detailed,
     Logging_ConciseProfilerMarks,
@@ -216,22 +221,21 @@ private:
   // It's s also used to atomically update FileInfo.mRefCnt, FileInfo.mDBRefCnt
   // and FileInfo.mSliceRefCnt
   mozilla::Mutex mFileMutex;
 
 #ifdef ENABLE_INTL_API
   nsCString mLocale;
 #endif
 
-  BackgroundUtilsChild* mBackgroundActor;
+  indexedDB::BackgroundUtilsChild* mBackgroundActor;
 
   static bool sIsMainProcess;
   static bool sFullSynchronousMode;
   static LazyLogModule sLoggingModule;
   static Atomic<LoggingMode> sLoggingMode;
   static mozilla::Atomic<bool> sLowDiskSpaceMode;
 };
 
-} // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_indexeddb_indexeddatabasemanager_h__
+#endif // mozilla_dom_indexeddatabasemanager_h__
--- a/dom/indexedDB/PBackgroundIDBDatabase.ipdl
+++ b/dom/indexedDB/PBackgroundIDBDatabase.ipdl
@@ -13,18 +13,18 @@ include protocol PBlob;
 include InputStreamParams;
 include PBackgroundIDBSharedTypes;
 
 include "mozilla/dom/indexedDB/SerializationHelpers.h";
 
 using struct mozilla::null_t
   from "ipc/IPCMessageUtils.h";
 
-using mozilla::dom::indexedDB::IDBTransaction::Mode
-  from "mozilla/dom/indexedDB/IDBTransaction.h";
+using mozilla::dom::IDBTransaction::Mode
+  from "mozilla/dom/IDBTransaction.h";
 
 namespace mozilla {
 namespace dom {
 namespace indexedDB {
 
 struct CreateFileParams
 {
   nsString name;
--- a/dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh
+++ b/dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh
@@ -12,18 +12,18 @@ include "mozilla/dom/indexedDB/Serializa
 include "mozilla/dom/quota/SerializationHelpers.h";
 
 using struct mozilla::null_t
   from "ipc/IPCMessageUtils.h";
 
 using struct mozilla::void_t
   from "ipc/IPCMessageUtils.h";
 
-using mozilla::dom::indexedDB::IDBCursor::Direction
-  from "mozilla/dom/indexedDB/IDBCursor.h";
+using mozilla::dom::IDBCursor::Direction
+  from "mozilla/dom/IDBCursor.h";
 
 using class mozilla::dom::indexedDB::Key
   from "mozilla/dom/indexedDB/Key.h";
 
 using class mozilla::dom::indexedDB::KeyPath
   from "mozilla/dom/indexedDB/KeyPath.h";
 
 using mozilla::dom::quota::PersistenceType
--- a/dom/indexedDB/SerializationHelpers.h
+++ b/dom/indexedDB/SerializationHelpers.h
@@ -6,18 +6,18 @@
 
 #ifndef mozilla_dom_indexeddb_serializationhelpers_h__
 #define mozilla_dom_indexeddb_serializationhelpers_h__
 
 #include "ipc/IPCMessageUtils.h"
 
 #include "mozilla/dom/indexedDB/Key.h"
 #include "mozilla/dom/indexedDB/KeyPath.h"
-#include "mozilla/dom/indexedDB/IDBCursor.h"
-#include "mozilla/dom/indexedDB/IDBTransaction.h"
+#include "mozilla/dom/IDBCursor.h"
+#include "mozilla/dom/IDBTransaction.h"
 
 namespace IPC {
 
 template <>
 struct ParamTraits<mozilla::dom::indexedDB::Key>
 {
   typedef mozilla::dom::indexedDB::Key paramType;
 
@@ -63,26 +63,26 @@ struct ParamTraits<mozilla::dom::indexed
 
   static void Log(const paramType& aParam, std::wstring* aLog)
   {
     LogParam(aParam.mStrings, aLog);
   }
 };
 
 template <>
-struct ParamTraits<mozilla::dom::indexedDB::IDBCursor::Direction> :
+struct ParamTraits<mozilla::dom::IDBCursor::Direction> :
   public ContiguousEnumSerializer<
-                          mozilla::dom::indexedDB::IDBCursor::Direction,
-                          mozilla::dom::indexedDB::IDBCursor::NEXT,
-                          mozilla::dom::indexedDB::IDBCursor::DIRECTION_INVALID>
+                          mozilla::dom::IDBCursor::Direction,
+                          mozilla::dom::IDBCursor::NEXT,
+                          mozilla::dom::IDBCursor::DIRECTION_INVALID>
 { };
 
 template <>
-struct ParamTraits<mozilla::dom::indexedDB::IDBTransaction::Mode> :
+struct ParamTraits<mozilla::dom::IDBTransaction::Mode> :
   public ContiguousEnumSerializer<
-                          mozilla::dom::indexedDB::IDBTransaction::Mode,
-                          mozilla::dom::indexedDB::IDBTransaction::READ_ONLY,
-                          mozilla::dom::indexedDB::IDBTransaction::MODE_INVALID>
+                          mozilla::dom::IDBTransaction::Mode,
+                          mozilla::dom::IDBTransaction::READ_ONLY,
+                          mozilla::dom::IDBTransaction::MODE_INVALID>
 { };
 
 } // namespace IPC
 
 #endif // mozilla_dom_indexeddb_serializationhelpers_h__
--- a/dom/indexedDB/moz.build
+++ b/dom/indexedDB/moz.build
@@ -15,34 +15,37 @@ MOCHITEST_CHROME_MANIFESTS += ['test/chr
 XPCSHELL_TESTS_MANIFESTS += [
     'test/unit/xpcshell-child-process.ini',
     'test/unit/xpcshell-parent-process.ini'
 ]
 
 if CONFIG['ENABLE_INTL_API']:
     MOCHITEST_MANIFESTS += ['test/mochitest-intl-api.ini']
 
-EXPORTS.mozilla.dom.indexedDB += [
-    'ActorsParent.h',
-    'FileSnapshot.h',
+EXPORTS.mozilla.dom += [
     'IDBCursor.h',
     'IDBDatabase.h',
     'IDBEvents.h',
     'IDBFactory.h',
     'IDBFileHandle.h',
     'IDBFileRequest.h',
     'IDBIndex.h',
     'IDBKeyRange.h',
     'IDBMutableFile.h',
     'IDBObjectStore.h',
     'IDBRequest.h',
     'IDBTransaction.h',
     'IDBWrapperCache.h',
     'IndexedDatabase.h',
     'IndexedDatabaseManager.h',
+]
+
+EXPORTS.mozilla.dom.indexedDB += [
+    'ActorsParent.h',
+    'FileSnapshot.h',
     'Key.h',
     'KeyPath.h',
     'SerializationHelpers.h',
 ]
 
 UNIFIED_SOURCES += [
     'ActorsChild.cpp',
     'FileInfo.cpp',
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -19,17 +19,17 @@
 #include "mozilla/Mutex.h"
 #include "mozilla/unused.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/nsIContentParent.h"
 #include "mozilla/dom/nsIContentChild.h"
 #include "mozilla/dom/PBlobStreamChild.h"
 #include "mozilla/dom/PBlobStreamParent.h"
 #include "mozilla/dom/indexedDB/FileSnapshot.h"
-#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
+#include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/ipc/PBackgroundParent.h"
 #include "mozilla/ipc/PFileDescriptorSetParent.h"
 #include "MultipartBlobImpl.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "nsID.h"
--- a/dom/webidl/IDBDatabase.webidl
+++ b/dom/webidl/IDBDatabase.webidl
@@ -30,17 +30,17 @@ interface IDBDatabase : EventTarget {
     void           close ();
 
                 attribute EventHandler       onabort;
                 attribute EventHandler       onerror;
                 attribute EventHandler       onversionchange;
 };
 
 partial interface IDBDatabase {
-    [Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+    [Func="mozilla::dom::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
     readonly    attribute StorageType        storage;
 
     [Exposed=Window, Throws]
     IDBRequest createMutableFile (DOMString name, optional DOMString type);
 
     // this is deprecated due to renaming in the spec
     [Exposed=Window, Throws]
     IDBRequest mozCreateFileHandle (DOMString name, optional DOMString type); // now createMutableFile
--- a/dom/webidl/IDBIndex.webidl
+++ b/dom/webidl/IDBIndex.webidl
@@ -27,20 +27,20 @@ interface IDBIndex {
     readonly    attribute any            keyPath;
 
     readonly    attribute boolean        multiEntry;
     readonly    attribute boolean        unique;
 
     // <null>:   Not locale-aware, uses normal JS sorting.
     // <string>: Sorted based on the rules of the specified locale.
     //           Note: never returns "auto", only the current locale.
-    [Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+    [Func="mozilla::dom::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
     readonly attribute DOMString? locale;
 
-    [Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+    [Func="mozilla::dom::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
     readonly attribute boolean isAutoLocale;
 
     [Throws]
     IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
 
     [Throws]
     IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
 
--- a/dom/webidl/IDBKeyRange.webidl
+++ b/dom/webidl/IDBKeyRange.webidl
@@ -25,13 +25,13 @@ interface IDBKeyRange {
   static IDBKeyRange lowerBound (any lower, optional boolean open = false);
   [NewObject, Throws]
   static IDBKeyRange upperBound (any upper, optional boolean open = false);
   [NewObject, Throws]
   static IDBKeyRange bound (any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
 };
 
 [Exposed=(Window,Worker),
- Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ Func="mozilla::dom::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
 interface IDBLocaleAwareKeyRange : IDBKeyRange {
   [NewObject, Throws]
   static IDBLocaleAwareKeyRange bound (any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
 };
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -33,17 +33,17 @@
 #include "mozilla/dom/AtomList.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/ErrorEventBinding.h"
 #include "mozilla/dom/EventTargetBinding.h"
 #include "mozilla/dom/MessageChannel.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/WorkerBinding.h"
 #include "mozilla/dom/ScriptSettings.h"
-#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
+#include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/Navigator.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollector.h"
 #include "nsDOMJSUtils.h"
 #include "nsIIPCBackgroundChildCreateCallback.h"
@@ -77,17 +77,16 @@ using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 
 USING_WORKERS_NAMESPACE
 
 using mozilla::MutexAutoLock;
 using mozilla::MutexAutoUnlock;
 using mozilla::Preferences;
-using mozilla::dom::indexedDB::IndexedDatabaseManager;
 
 // The size of the worker runtime heaps in bytes. May be changed via pref.
 #define WORKER_DEFAULT_RUNTIME_HEAPSIZE 32 * 1024 * 1024
 
 // The size of the generational GC nursery for workers, in bytes.
 #define WORKER_DEFAULT_NURSERY_SIZE 1 * 1024 * 1024
 
 // The size of the worker JS allocation threshold in MB. May be changed via pref.
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -33,18 +33,16 @@
 #include "mozilla/ErrorNames.h"
 #include "mozilla/LoadContext.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DOMError.h"
 #include "mozilla/dom/ErrorEvent.h"
 #include "mozilla/dom/Headers.h"
-#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
-#include "mozilla/dom/indexedDB/IDBFactory.h"
 #include "mozilla/dom/InternalHeaders.h"
 #include "mozilla/dom/Navigator.h"
 #include "mozilla/dom/NotificationEvent.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/Request.h"
 #include "mozilla/dom/RootedDictionary.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundChild.h"
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -4,16 +4,17 @@
  * 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/. */
 
 #include "ServiceWorkerPrivate.h"
 #include "ServiceWorkerManager.h"
 #include "nsStreamUtils.h"
 #include "nsStringStream.h"
 #include "mozilla/dom/FetchUtil.h"
+#include "mozilla/dom/IndexedDatabaseManager.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 BEGIN_WORKERS_NAMESPACE
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ServiceWorkerPrivate)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ServiceWorkerPrivate)
@@ -1386,17 +1387,17 @@ ServiceWorkerPrivate::SpawnWorkerIfNeede
   if (NS_WARN_IF(!mInfo)) {
     NS_WARNING("Trying to wake up a dead service worker.");
     return NS_ERROR_FAILURE;
   }
 
   // TODO(catalinb): Bug 1192138 - Add telemetry for service worker wake-ups.
 
   // Ensure that the IndexedDatabaseManager is initialized
-  NS_WARN_IF(!indexedDB::IndexedDatabaseManager::GetOrCreate());
+  NS_WARN_IF(!IndexedDatabaseManager::GetOrCreate());
 
   WorkerLoadInfo info;
   nsresult rv = NS_NewURI(getter_AddRefs(info.mBaseURI), mInfo->ScriptSpec(),
                           nullptr, nullptr);
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -57,17 +57,16 @@
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseDebugging.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/StructuredCloneHolder.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/WorkerBinding.h"
 #include "mozilla/dom/WorkerDebuggerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerGlobalScopeBinding.h"
-#include "mozilla/dom/indexedDB/IDBFactory.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TimelineConsumers.h"
 #include "mozilla/WorkerTimelineMarker.h"
 #include "nsAlgorithm.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollector.h"
 #include "nsError.h"
 #include "nsDOMJSUtils.h"
@@ -4102,17 +4101,16 @@ nsresult
 WorkerPrivate::GetLoadInfo(JSContext* aCx, nsPIDOMWindowInner* aWindow,
                            WorkerPrivate* aParent, const nsAString& aScriptURL,
                            bool aIsChromeWorker,
                            LoadGroupBehavior aLoadGroupBehavior,
                            WorkerType aWorkerType,
                            WorkerLoadInfo* aLoadInfo)
 {
   using namespace mozilla::dom::workers::scriptloader;
-  using mozilla::dom::indexedDB::IDBFactory;
 
   MOZ_ASSERT(aCx);
   MOZ_ASSERT_IF(NS_IsMainThread(), aCx == nsContentUtils::GetCurrentJSContext());
 
   if (aWindow) {
     AssertIsOnMainThread();
   }
 
@@ -4159,17 +4157,17 @@ WorkerPrivate::GetLoadInfo(JSContext* aC
     loadInfo.mStorageAllowed = aParent->IsStorageAllowed();
     loadInfo.mPrivateBrowsing = aParent->IsInPrivateBrowsing();
     loadInfo.mServiceWorkersTestingInWindow =
       aParent->ServiceWorkersTestingInWindow();
   } else {
     AssertIsOnMainThread();
 
     // Make sure that the IndexedDatabaseManager is set up
-    NS_WARN_IF(!indexedDB::IndexedDatabaseManager::GetOrCreate());
+    NS_WARN_IF(!IndexedDatabaseManager::GetOrCreate());
 
     nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
     MOZ_ASSERT(ssm);
 
     bool isChrome = nsContentUtils::IsCallerChrome();
 
     // First check to make sure the caller has permission to make a privileged
     // worker if they called the ChromeWorker/ChromeSharedWorker constructor.
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -8,25 +8,25 @@
 
 #include "jsapi.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/Console.h"
 #include "mozilla/dom/DedicatedWorkerGlobalScopeBinding.h"
 #include "mozilla/dom/Fetch.h"
 #include "mozilla/dom/FunctionBinding.h"
+#include "mozilla/dom/IDBFactory.h"
 #include "mozilla/dom/ImageBitmap.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseWorkerProxy.h"
 #include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
 #include "mozilla/dom/SharedWorkerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerDebuggerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerGlobalScopeBinding.h"
 #include "mozilla/dom/cache/CacheStorage.h"
-#include "mozilla/dom/indexedDB/IDBFactory.h"
 #include "mozilla/Services.h"
 #include "nsServiceManagerUtils.h"
 
 #include "nsIDocument.h"
 #include "nsIServiceWorkerManager.h"
 
 #ifdef ANDROID
 #include <android/log.h>
@@ -48,17 +48,16 @@
 #undef PostMessage
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 USING_WORKERS_NAMESPACE
 
 using mozilla::dom::cache::CacheStorage;
-using mozilla::dom::indexedDB::IDBFactory;
 using mozilla::ipc::PrincipalInfo;
 
 BEGIN_WORKERS_NAMESPACE
 
 WorkerGlobalScope::WorkerGlobalScope(WorkerPrivate* aWorkerPrivate)
 : mWindowInteractionsAllowed(0)
 , mWorkerPrivate(aWorkerPrivate)
 {
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -14,48 +14,42 @@
 #include "nsWeakReference.h"
 #include "mozilla/dom/ImageBitmapSource.h"
 
 namespace mozilla {
 namespace dom {
 
 class Console;
 class Function;
+class IDBFactory;
 class Promise;
 class RequestOrUSVString;
 class ServiceWorkerRegistrationWorkerThread;
 
 namespace cache {
 
 class CacheStorage;
 
 } // namespace cache
-
-namespace indexedDB {
-
-class IDBFactory;
-
-} // namespace indexedDB
-
 } // namespace dom
 } // namespace mozilla
 
 BEGIN_WORKERS_NAMESPACE
 
 class ServiceWorkerClients;
 class WorkerPrivate;
 class WorkerLocation;
 class WorkerNavigator;
 class Performance;
 
 class WorkerGlobalScope : public DOMEventTargetHelper,
                           public nsIGlobalObject,
                           public nsSupportsWeakReference
 {
-  typedef mozilla::dom::indexedDB::IDBFactory IDBFactory;
+  typedef mozilla::dom::IDBFactory IDBFactory;
 
   RefPtr<Console> mConsole;
   RefPtr<WorkerLocation> mLocation;
   RefPtr<WorkerNavigator> mNavigator;
   RefPtr<Performance> mPerformance;
   RefPtr<IDBFactory> mIndexedDB;
   RefPtr<cache::CacheStorage> mCacheStorage;
 
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -26,17 +26,17 @@
 #include "xpcprivate.h"
 #include "XPCWrapper.h"
 #include "XrayWrapper.h"
 #include "Crypto.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/dom/CSSBinding.h"
-#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
+#include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/dom/Fetch.h"
 #include "mozilla/dom/FileBinding.h"
 #include "mozilla/dom/PromiseBinding.h"
 #include "mozilla/dom/RequestBinding.h"
 #include "mozilla/dom/ResponseBinding.h"
 #ifdef MOZ_WEBRTC
 #include "mozilla/dom/RTCIdentityProviderRegistrar.h"
 #endif
@@ -48,17 +48,17 @@
 #include "mozilla/dom/URLBinding.h"
 #include "mozilla/dom/URLSearchParamsBinding.h"
 
 using namespace mozilla;
 using namespace JS;
 using namespace xpc;
 
 using mozilla::dom::DestroyProtoAndIfaceCache;
-using mozilla::dom::indexedDB::IndexedDatabaseManager;
+using mozilla::dom::IndexedDatabaseManager;
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(SandboxPrivate)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SandboxPrivate)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
   tmp->UnlinkHostObjectURIs();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END