Backed out changeset 97d88752079f (bug 1540401) for causing a nightly startup crash a=backout
authorCiure Andrei <aciure@mozilla.com>
Thu, 04 Apr 2019 04:45:08 +0300
changeset 526504 82ba38c4aa6acc7b322bcb56c417c0f64d5d3660
parent 526503 74be8815ccfce81f1ca6568f8cfebfc847a83ba2
child 526703 b72c02e3426199c098f542aba3ff0ef197e347d4
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1540401
milestone68.0a1
backs out97d88752079fb70b1dbce174ba866dac0042228f
first release with
nightly linux32
82ba38c4aa6a / 68.0a1 / 20190404014638 / files
nightly linux64
82ba38c4aa6a / 68.0a1 / 20190404014638 / files
nightly mac
82ba38c4aa6a / 68.0a1 / 20190404014638 / files
nightly win32
82ba38c4aa6a / 68.0a1 / 20190404014638 / files
nightly win64
82ba38c4aa6a / 68.0a1 / 20190404014638 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 97d88752079f (bug 1540401) for causing a nightly startup crash a=backout
dom/localstorage/ActorsChild.cpp
dom/localstorage/ActorsParent.cpp
dom/localstorage/LSDatabase.cpp
dom/localstorage/LSDatabase.h
dom/localstorage/LSObject.cpp
dom/localstorage/LSObserver.cpp
dom/localstorage/LSObserver.h
dom/localstorage/LSSnapshot.cpp
dom/localstorage/LSSnapshot.h
dom/localstorage/LocalStorageCommon.cpp
dom/localstorage/LocalStorageManager2.cpp
--- a/dom/localstorage/ActorsChild.cpp
+++ b/dom/localstorage/ActorsChild.cpp
@@ -16,17 +16,17 @@ namespace mozilla {
 namespace dom {
 
 /*******************************************************************************
  * LSDatabaseChild
  ******************************************************************************/
 
 LSDatabaseChild::LSDatabaseChild(LSDatabase* aDatabase) : mDatabase(aDatabase) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
+  MOZ_ASSERT(aDatabase);
 
   MOZ_COUNT_CTOR(LSDatabaseChild);
 }
 
 LSDatabaseChild::~LSDatabaseChild() {
   AssertIsOnOwningThread();
 
   MOZ_COUNT_DTOR(LSDatabaseChild);
@@ -73,29 +73,29 @@ PBackgroundLSSnapshotChild* LSDatabaseCh
     const nsString& aDocumentURI, const bool& aIncreasePeakUsage,
     const int64_t& aRequestedSize, const int64_t& aMinSize,
     LSSnapshotInitInfo* aInitInfo) {
   MOZ_CRASH("PBackgroundLSSnapshotChild actor should be manually constructed!");
 }
 
 bool LSDatabaseChild::DeallocPBackgroundLSSnapshotChild(
     PBackgroundLSSnapshotChild* aActor) {
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
+  MOZ_ASSERT(aActor);
 
   delete aActor;
   return true;
 }
 
 /*******************************************************************************
  * LSObserverChild
  ******************************************************************************/
 
 LSObserverChild::LSObserverChild(LSObserver* aObserver) : mObserver(aObserver) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObserver);
+  MOZ_ASSERT(aObserver);
 
   MOZ_COUNT_CTOR(LSObserverChild);
 }
 
 LSObserverChild::~LSObserverChild() {
   AssertIsOnOwningThread();
 
   MOZ_COUNT_DTOR(LSObserverChild);
@@ -174,17 +174,17 @@ bool LSRequestChild::Finishing() const {
 
 void LSRequestChild::ActorDestroy(ActorDestroyReason aWhy) {
   AssertIsOnOwningThread();
 }
 
 mozilla::ipc::IPCResult LSRequestChild::Recv__delete__(
     const LSRequestResponse& aResponse) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mCallback);
+  MOZ_ASSERT(mCallback);
 
   mCallback->OnResponse(aResponse);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult LSRequestChild::RecvReady() {
   AssertIsOnOwningThread();
@@ -199,17 +199,17 @@ mozilla::ipc::IPCResult LSRequestChild::
 /*******************************************************************************
  * LSSimpleRequestChild
  ******************************************************************************/
 
 LSSimpleRequestChild::LSSimpleRequestChild(
     LSSimpleRequestChildCallback* aCallback)
     : mCallback(aCallback) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aCallback);
+  MOZ_ASSERT(aCallback);
 
   MOZ_COUNT_CTOR(LSSimpleRequestChild);
 }
 
 LSSimpleRequestChild::~LSSimpleRequestChild() {
   AssertIsOnOwningThread();
 
   MOZ_COUNT_DTOR(LSSimpleRequestChild);
@@ -229,17 +229,17 @@ mozilla::ipc::IPCResult LSSimpleRequestC
 }
 
 /*******************************************************************************
  * LSSnapshotChild
  ******************************************************************************/
 
 LSSnapshotChild::LSSnapshotChild(LSSnapshot* aSnapshot) : mSnapshot(aSnapshot) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aSnapshot);
+  MOZ_ASSERT(aSnapshot);
 
   MOZ_COUNT_CTOR(LSSnapshotChild);
 }
 
 LSSnapshotChild::~LSSnapshotChild() {
   AssertIsOnOwningThread();
 
   MOZ_COUNT_DTOR(LSSnapshotChild);
--- a/dom/localstorage/ActorsParent.cpp
+++ b/dom/localstorage/ActorsParent.cpp
@@ -49,17 +49,17 @@
 
 #define DISABLE_ASSERTS_FOR_FUZZING 0
 
 #if DISABLE_ASSERTS_FOR_FUZZING
 #  define ASSERT_UNLESS_FUZZING(...) \
     do {                             \
     } while (0)
 #else
-#  define ASSERT_UNLESS_FUZZING(...) MOZ_DIAGNOSTIC_ASSERT(false, __VA_ARGS__)
+#  define ASSERT_UNLESS_FUZZING(...) MOZ_ASSERT(false, __VA_ARGS__)
 #endif
 
 #define LS_LOG_TEST() MOZ_LOG_TEST(GetLocalStorageLogger(), LogLevel::Info)
 #define LS_LOG(_args) MOZ_LOG(GetLocalStorageLogger(), LogLevel::Info, _args)
 
 #if defined(MOZ_WIDGET_ANDROID)
 #  define LS_MOBILE
 #endif
@@ -268,17 +268,17 @@ int32_t MakeSchemaVersion(uint32_t aMajo
 
 nsCString GetArchivedOriginHashKey(const nsACString& aOriginSuffix,
                                    const nsACString& aOriginNoSuffix) {
   return aOriginSuffix + NS_LITERAL_CSTRING(":") + aOriginNoSuffix;
 }
 
 nsresult CreateTables(mozIStorageConnection* aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   // Table `database`
   nsresult rv = aConnection->ExecuteSimpleSQL(
       NS_LITERAL_CSTRING("CREATE TABLE database"
                          "( origin TEXT NOT NULL"
                          ", usage INTEGER NOT NULL DEFAULT 0"
                          ", last_vacuum_time INTEGER NOT NULL DEFAULT 0"
                          ", last_analyze_time INTEGER NOT NULL DEFAULT 0"
@@ -305,17 +305,17 @@ nsresult CreateTables(mozIStorageConnect
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult UpgradeSchemaFrom1_0To2_0(mozIStorageConnection* aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
       "ALTER TABLE database ADD COLUMN usage INTEGER NOT NULL DEFAULT 0;"));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
@@ -331,17 +331,17 @@ nsresult UpgradeSchemaFrom1_0To2_0(mozIS
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult SetDefaultPragmas(mozIStorageConnection* aConnection) {
   MOZ_ASSERT(!NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   nsresult rv = aConnection->ExecuteSimpleSQL(
       NS_LITERAL_CSTRING("PRAGMA synchronous = FULL;"));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
 #ifndef LS_MOBILE
@@ -359,20 +359,20 @@ nsresult SetDefaultPragmas(mozIStorageCo
   return NS_OK;
 }
 
 nsresult CreateStorageConnection(nsIFile* aDBFile, nsIFile* aUsageFile,
                                  const nsACString& aOrigin,
                                  mozIStorageConnection** aConnection,
                                  bool* aRemovedUsageFile) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDBFile);
-  MOZ_DIAGNOSTIC_ASSERT(aUsageFile);
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
-  MOZ_DIAGNOSTIC_ASSERT(aRemovedUsageFile);
+  MOZ_ASSERT(aDBFile);
+  MOZ_ASSERT(aUsageFile);
+  MOZ_ASSERT(aConnection);
+  MOZ_ASSERT(aRemovedUsageFile);
 
   // aRemovedUsageFile has to be initialized even when this method fails.
   *aRemovedUsageFile = false;
 
   nsresult rv;
 
   nsCOMPtr<mozIStorageService> ss =
       do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv);
@@ -455,19 +455,18 @@ nsresult CreateStorageConnection(nsIFile
         connection, false, mozIStorageConnection::TRANSACTION_IMMEDIATE);
 
     if (newDatabase) {
       rv = CreateTables(connection);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
-      MOZ_DIAGNOSTIC_ASSERT(
-          NS_SUCCEEDED(connection->GetSchemaVersion(&schemaVersion)));
-      MOZ_DIAGNOSTIC_ASSERT(schemaVersion == kSQLiteSchemaVersion);
+      MOZ_ASSERT(NS_SUCCEEDED(connection->GetSchemaVersion(&schemaVersion)));
+      MOZ_ASSERT(schemaVersion == kSQLiteSchemaVersion);
 
       nsCOMPtr<mozIStorageStatement> stmt;
       nsresult rv = connection->CreateStatement(
           NS_LITERAL_CSTRING("INSERT INTO database (origin) "
                              "VALUES (:origin)"),
           getter_AddRefs(stmt));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
@@ -502,17 +501,17 @@ nsresult CreateStorageConnection(nsIFile
         }
 
         rv = connection->GetSchemaVersion(&schemaVersion);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
       }
 
-      MOZ_DIAGNOSTIC_ASSERT(schemaVersion == kSQLiteSchemaVersion);
+      MOZ_ASSERT(schemaVersion == kSQLiteSchemaVersion);
     }
 
     rv = transaction.Commit();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     if (newDatabase) {
@@ -524,20 +523,20 @@ nsresult CreateStorageConnection(nsIFile
       }
 
       int64_t fileSize;
       rv = aDBFile->GetFileSize(&fileSize);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
-      MOZ_DIAGNOSTIC_ASSERT(fileSize > 0);
+      MOZ_ASSERT(fileSize > 0);
 
       PRTime vacuumTime = PR_Now();
-      MOZ_DIAGNOSTIC_ASSERT(vacuumTime);
+      MOZ_ASSERT(vacuumTime);
 
       nsCOMPtr<mozIStorageStatement> vacuumTimeStmt;
       rv = connection->CreateStatement(
           NS_LITERAL_CSTRING("UPDATE database "
                              "SET last_vacuum_time = :time"
                              ", last_vacuum_size = :size;"),
           getter_AddRefs(vacuumTimeStmt));
       if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -565,20 +564,19 @@ nsresult CreateStorageConnection(nsIFile
 
   connection.forget(aConnection);
   return NS_OK;
 }
 
 nsresult GetStorageConnection(const nsAString& aDatabaseFilePath,
                               mozIStorageConnection** aConnection) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aDatabaseFilePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(
-      StringEndsWith(aDatabaseFilePath, NS_LITERAL_STRING(".sqlite")));
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(!aDatabaseFilePath.IsEmpty());
+  MOZ_ASSERT(StringEndsWith(aDatabaseFilePath, NS_LITERAL_STRING(".sqlite")));
+  MOZ_ASSERT(aConnection);
 
   nsCOMPtr<nsIFile> databaseFile;
   nsresult rv =
       NS_NewLocalFile(aDatabaseFilePath, false, getter_AddRefs(databaseFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -610,18 +608,18 @@ nsresult GetStorageConnection(const nsAS
   }
 
   connection.forget(aConnection);
   return NS_OK;
 }
 
 nsresult GetArchiveFile(const nsAString& aStoragePath, nsIFile** aArchiveFile) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aStoragePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aArchiveFile);
+  MOZ_ASSERT(!aStoragePath.IsEmpty());
+  MOZ_ASSERT(aArchiveFile);
 
   nsCOMPtr<nsIFile> archiveFile;
   nsresult rv =
       NS_NewLocalFile(aStoragePath, false, getter_AddRefs(archiveFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -632,31 +630,29 @@ nsresult GetArchiveFile(const nsAString&
 
   archiveFile.forget(aArchiveFile);
   return NS_OK;
 }
 
 nsresult CreateArchiveStorageConnection(const nsAString& aStoragePath,
                                         mozIStorageConnection** aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aStoragePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(!aStoragePath.IsEmpty());
+  MOZ_ASSERT(aConnection);
 
   nsCOMPtr<nsIFile> archiveFile;
   nsresult rv = GetArchiveFile(aStoragePath, getter_AddRefs(archiveFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
   // QuotaManager ensures this file always exists.
-  bool exists;
-  MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(archiveFile->Exists(&exists)));
-  MOZ_DIAGNOSTIC_ASSERT(exists);
-#endif
+  DebugOnly<bool> exists;
+  MOZ_ASSERT(NS_SUCCEEDED(archiveFile->Exists(&exists)));
+  MOZ_ASSERT(exists);
 
   bool isDirectory;
   rv = archiveFile->IsDirectory(&isDirectory);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (isDirectory) {
@@ -692,33 +688,33 @@ nsresult CreateArchiveStorageConnection(
 
   connection.forget(aConnection);
   return NS_OK;
 }
 
 nsresult AttachArchiveDatabase(const nsAString& aStoragePath,
                                mozIStorageConnection* aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aStoragePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(!aStoragePath.IsEmpty());
+  MOZ_ASSERT(aConnection);
   nsCOMPtr<nsIFile> archiveFile;
 
   nsresult rv = GetArchiveFile(aStoragePath, getter_AddRefs(archiveFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool exists;
   rv = archiveFile->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(exists);
+  MOZ_ASSERT(exists);
 #endif
 
   nsString path;
   rv = archiveFile->GetPath(path);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -740,31 +736,31 @@ nsresult AttachArchiveDatabase(const nsA
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult DetachArchiveDatabase(mozIStorageConnection* aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   nsresult rv = aConnection->ExecuteSimpleSQL(
       NS_LITERAL_CSTRING("DETACH DATABASE archive"));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult GetShadowFile(const nsAString& aBasePath, nsIFile** aArchiveFile) {
   MOZ_ASSERT(IsOnIOThread() || IsOnConnectionThread());
-  MOZ_DIAGNOSTIC_ASSERT(!aBasePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aArchiveFile);
+  MOZ_ASSERT(!aBasePath.IsEmpty());
+  MOZ_ASSERT(aArchiveFile);
 
   nsCOMPtr<nsIFile> archiveFile;
   nsresult rv = NS_NewLocalFile(aBasePath, false, getter_AddRefs(archiveFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = archiveFile->Append(NS_LITERAL_STRING(WEB_APPS_STORE_FILE_NAME));
@@ -773,17 +769,17 @@ nsresult GetShadowFile(const nsAString& 
   }
 
   archiveFile.forget(aArchiveFile);
   return NS_OK;
 }
 
 nsresult SetShadowJournalMode(mozIStorageConnection* aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   // Try enabling WAL mode. This can fail in various circumstances so we have to
   // check the results here.
   NS_NAMED_LITERAL_CSTRING(journalModeQueryStart, "PRAGMA journal_mode = ");
   NS_NAMED_LITERAL_CSTRING(journalModeWAL, "wal");
 
   nsCOMPtr<mozIStorageStatement> stmt;
   nsresult rv = aConnection->CreateStatement(
@@ -793,17 +789,17 @@ nsresult SetShadowJournalMode(mozIStorag
   }
 
   bool hasResult;
   rv = stmt->ExecuteStep(&hasResult);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(hasResult);
+  MOZ_ASSERT(hasResult);
 
   nsCString journalMode;
   rv = stmt->GetUTF8String(0, journalMode);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (journalMode.Equals(journalModeWAL)) {
@@ -818,25 +814,25 @@ nsresult SetShadowJournalMode(mozIStorag
     }
 
     bool hasResult;
     rv = stmt->ExecuteStep(&hasResult);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(hasResult);
+    MOZ_ASSERT(hasResult);
 
     int32_t pageSize;
     rv = stmt->GetInt32(0, &pageSize);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(pageSize >= 512 && pageSize <= 65536);
+    MOZ_ASSERT(pageSize >= 512 && pageSize <= 65536);
 
     nsAutoCString pageCount;
     pageCount.AppendInt(static_cast<int32_t>(kShadowMaxWALSize / pageSize));
 
     rv = aConnection->ExecuteSimpleSQL(
         NS_LITERAL_CSTRING("PRAGMA wal_autocheckpoint = ") + pageCount);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
@@ -861,18 +857,18 @@ nsresult SetShadowJournalMode(mozIStorag
   }
 
   return NS_OK;
 }
 
 nsresult CreateShadowStorageConnection(const nsAString& aBasePath,
                                        mozIStorageConnection** aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aBasePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(!aBasePath.IsEmpty());
+  MOZ_ASSERT(aConnection);
 
   nsCOMPtr<nsIFile> shadowFile;
   nsresult rv = GetShadowFile(aBasePath, getter_AddRefs(shadowFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   nsCOMPtr<mozIStorageService> ss =
@@ -930,18 +926,18 @@ nsresult CreateShadowStorageConnection(c
 
   connection.forget(aConnection);
   return NS_OK;
 }
 
 nsresult GetShadowStorageConnection(const nsAString& aBasePath,
                                     mozIStorageConnection** aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aBasePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(!aBasePath.IsEmpty());
+  MOZ_ASSERT(aConnection);
 
   nsCOMPtr<nsIFile> shadowFile;
   nsresult rv = GetShadowFile(aBasePath, getter_AddRefs(shadowFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   bool exists;
@@ -968,33 +964,33 @@ nsresult GetShadowStorageConnection(cons
 
   connection.forget(aConnection);
   return NS_OK;
 }
 
 nsresult AttachShadowDatabase(const nsAString& aBasePath,
                               mozIStorageConnection* aConnection) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aBasePath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(!aBasePath.IsEmpty());
+  MOZ_ASSERT(aConnection);
 
   nsCOMPtr<nsIFile> shadowFile;
   nsresult rv = GetShadowFile(aBasePath, getter_AddRefs(shadowFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool exists;
   rv = shadowFile->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(exists);
+  MOZ_ASSERT(exists);
 #endif
 
   nsString path;
   rv = shadowFile->GetPath(path);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -1016,31 +1012,31 @@ nsresult AttachShadowDatabase(const nsAS
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult DetachShadowDatabase(mozIStorageConnection* aConnection) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   nsresult rv = aConnection->ExecuteSimpleSQL(
       NS_LITERAL_CSTRING("DETACH DATABASE shadow"));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult GetUsageFile(const nsAString& aDirectoryPath, nsIFile** aUsageFile) {
   MOZ_ASSERT(IsOnIOThread() || IsOnConnectionThread());
-  MOZ_DIAGNOSTIC_ASSERT(!aDirectoryPath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aUsageFile);
+  MOZ_ASSERT(!aDirectoryPath.IsEmpty());
+  MOZ_ASSERT(aUsageFile);
 
   nsCOMPtr<nsIFile> usageFile;
   nsresult rv =
       NS_NewLocalFile(aDirectoryPath, false, getter_AddRefs(usageFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -1051,18 +1047,18 @@ nsresult GetUsageFile(const nsAString& a
 
   usageFile.forget(aUsageFile);
   return NS_OK;
 }
 
 nsresult GetUsageJournalFile(const nsAString& aDirectoryPath,
                              nsIFile** aUsageJournalFile) {
   MOZ_ASSERT(IsOnIOThread() || IsOnConnectionThread());
-  MOZ_DIAGNOSTIC_ASSERT(!aDirectoryPath.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aUsageJournalFile);
+  MOZ_ASSERT(!aDirectoryPath.IsEmpty());
+  MOZ_ASSERT(aUsageJournalFile);
 
   nsCOMPtr<nsIFile> usageJournalFile;
   nsresult rv =
       NS_NewLocalFile(aDirectoryPath, false, getter_AddRefs(usageJournalFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -1073,19 +1069,19 @@ nsresult GetUsageJournalFile(const nsASt
 
   usageJournalFile.forget(aUsageJournalFile);
   return NS_OK;
 }
 
 nsresult UpdateUsageFile(nsIFile* aUsageFile, nsIFile* aUsageJournalFile,
                          int64_t aUsage) {
   MOZ_ASSERT(IsOnIOThread() || IsOnConnectionThread());
-  MOZ_DIAGNOSTIC_ASSERT(aUsageFile);
-  MOZ_DIAGNOSTIC_ASSERT(aUsageJournalFile);
-  MOZ_DIAGNOSTIC_ASSERT(aUsage >= 0);
+  MOZ_ASSERT(aUsageFile);
+  MOZ_ASSERT(aUsageJournalFile);
+  MOZ_ASSERT(aUsage >= 0);
 
   nsresult rv = aUsageJournalFile->Create(nsIFile::NORMAL_FILE_TYPE, 0644);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   nsCOMPtr<nsIOutputStream> stream;
   rv = NS_NewLocalFileOutputStream(getter_AddRefs(stream), aUsageFile);
@@ -1111,18 +1107,18 @@ nsresult UpdateUsageFile(nsIFile* aUsage
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult LoadUsageFile(nsIFile* aUsageFile, int64_t* aUsage) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aUsageFile);
-  MOZ_DIAGNOSTIC_ASSERT(aUsage);
+  MOZ_ASSERT(aUsageFile);
+  MOZ_ASSERT(aUsage);
 
   int64_t fileSize;
   nsresult rv = aUsageFile->GetFileSize(&fileSize);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (NS_WARN_IF(fileSize != kUsageFileSize)) {
@@ -1191,17 +1187,17 @@ class WriteOptimizer final {
   int64_t mTotalDelta;
 
  public:
   WriteOptimizer() : mTotalDelta(0) {}
 
   WriteOptimizer(WriteOptimizer&& aWriteOptimizer)
       : mClearInfo(std::move(aWriteOptimizer.mClearInfo)) {
     AssertIsOnBackgroundThread();
-    MOZ_DIAGNOSTIC_ASSERT(&aWriteOptimizer != this);
+    MOZ_ASSERT(&aWriteOptimizer != this);
 
     mWriteInfos.SwapElements(aWriteOptimizer.mWriteInfos);
     mTotalDelta = aWriteOptimizer.mTotalDelta;
     aWriteOptimizer.mTotalDelta = 0;
   }
 
   void AddItem(const nsString& aKey, const nsString& aValue,
                int64_t aDelta = 0);
@@ -1305,45 +1301,45 @@ class WriteOptimizer::ClearInfo final : 
 class DatastoreOperationBase : public Runnable {
   nsCOMPtr<nsIEventTarget> mOwningEventTarget;
   nsresult mResultCode;
   Atomic<bool> mMayProceedOnNonOwningThread;
   bool mMayProceed;
 
  public:
   nsIEventTarget* OwningEventTarget() const {
-    MOZ_DIAGNOSTIC_ASSERT(mOwningEventTarget);
+    MOZ_ASSERT(mOwningEventTarget);
 
     return mOwningEventTarget;
   }
 
   bool IsOnOwningThread() const {
-    MOZ_DIAGNOSTIC_ASSERT(mOwningEventTarget);
+    MOZ_ASSERT(mOwningEventTarget);
 
     bool current;
     return NS_SUCCEEDED(mOwningEventTarget->IsOnCurrentThread(&current)) &&
            current;
   }
 
   void AssertIsOnOwningThread() const {
     MOZ_ASSERT(IsOnBackgroundThread());
     MOZ_ASSERT(IsOnOwningThread());
   }
 
   nsresult ResultCode() const { return mResultCode; }
 
   void SetFailureCode(nsresult aErrorCode) {
-    MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(mResultCode));
-    MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(aErrorCode));
+    MOZ_ASSERT(NS_SUCCEEDED(mResultCode));
+    MOZ_ASSERT(NS_FAILED(aErrorCode));
 
     mResultCode = aErrorCode;
   }
 
   void MaybeSetFailureCode(nsresult aErrorCode) {
-    MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(aErrorCode));
+    MOZ_ASSERT(NS_FAILED(aErrorCode));
 
     if (NS_SUCCEEDED(mResultCode)) {
       mResultCode = aErrorCode;
     }
   }
 
   void NoteComplete() {
     AssertIsOnOwningThread();
@@ -1367,17 +1363,17 @@ class DatastoreOperationBase : public Ru
  protected:
   DatastoreOperationBase()
       : Runnable("dom::DatastoreOperationBase"),
         mOwningEventTarget(GetCurrentThreadEventTarget()),
         mResultCode(NS_OK),
         mMayProceedOnNonOwningThread(true),
         mMayProceed(true) {}
 
-  ~DatastoreOperationBase() override { MOZ_DIAGNOSTIC_ASSERT(!mMayProceed); }
+  ~DatastoreOperationBase() override { MOZ_ASSERT(!mMayProceed); }
 };
 
 class ConnectionDatastoreOperationBase : public DatastoreOperationBase {
  protected:
   RefPtr<Connection> mConnection;
 
  public:
   // This callback will be called on the background thread before releasing the
@@ -1425,17 +1421,17 @@ class Connection final {
   nsCOMPtr<mozIStorageConnection> mStorageConnection;
   nsAutoPtr<ArchivedOriginScope> mArchivedOriginScope;
   nsInterfaceHashtable<nsCStringHashKey, mozIStorageStatement>
       mCachedStatements;
   WriteOptimizer mWriteOptimizer;
   const nsCString mOrigin;
   const nsString mDirectoryPath;
   bool mFlushScheduled;
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool mInUpdateBatch;
 #endif
 
  public:
   NS_INLINE_DECL_REFCOUNTING(mozilla::dom::Connection)
 
   void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(Connection); }
 
@@ -1472,17 +1468,17 @@ class Connection final {
 
   //////////////////////////////////////////////////////////////////////////////
   // Methods which can only be called on the connection thread.
 
   nsresult EnsureStorageConnection();
 
   mozIStorageConnection* StorageConnection() const {
     AssertIsOnConnectionThread();
-    MOZ_DIAGNOSTIC_ASSERT(mStorageConnection);
+    MOZ_ASSERT(mStorageConnection);
 
     return mStorageConnection;
   }
 
   void CloseStorageConnection();
 
   nsresult GetCachedStatement(const nsACString& aQuery,
                               CachedStatement* aCachedStatement);
@@ -1561,16 +1557,18 @@ class ConnectionThread final {
   ConnectionThread();
 
   void AssertIsOnOwningThread() const {
     NS_ASSERT_OWNINGTHREAD(ConnectionThread);
   }
 
   bool IsOnConnectionThread();
 
+  void AssertIsOnConnectionThread();
+
   already_AddRefed<Connection> CreateConnection(
       const nsACString& aOrigin, const nsAString& aDirectoryPath,
       nsAutoPtr<ArchivedOriginScope>&& aArchivedOriginScope);
 
   void Shutdown();
 
   NS_INLINE_DECL_REFCOUNTING(ConnectionThread)
 
@@ -1630,17 +1628,17 @@ class Datastore final {
   WriteOptimizer mWriteOptimizer;
   const nsCString mOrigin;
   const uint32_t mPrivateBrowsingId;
   int64_t mUsage;
   int64_t mUpdateBatchUsage;
   int64_t mSizeOfKeys;
   int64_t mSizeOfItems;
   bool mClosed;
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool mInUpdateBatch;
 #endif
 
  public:
   // Created by PrepareDatastoreOp.
   Datastore(const nsACString& aOrigin, uint32_t aPrivateBrowsingId,
             int64_t aUsage, int64_t aSizeOfKeys, int64_t aSizeOfItems,
             already_AddRefed<DirectoryLock>&& aDirectoryLock,
@@ -1673,25 +1671,25 @@ class Datastore final {
   void NoteLivePrepareDatastoreOp(PrepareDatastoreOp* aPrepareDatastoreOp);
 
   void NoteFinishedPrepareDatastoreOp(PrepareDatastoreOp* aPrepareDatastoreOp);
 
   void NoteLivePreparedDatastore(PreparedDatastore* aPreparedDatastore);
 
   void NoteFinishedPreparedDatastore(PreparedDatastore* aPreparedDatastore);
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool HasLivePreparedDatastores() const;
 #endif
 
   void NoteLiveDatabase(Database* aDatabase);
 
   void NoteFinishedDatabase(Database* aDatabase);
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool HasLiveDatabases() const;
 #endif
 
   void NoteActiveDatabase(Database* aDatabase);
 
   void NoteInactiveDatabase(Database* aDatabase);
 
   void GetSnapshotInitInfo(nsTHashtable<nsStringHashKey>& aLoadedItems,
@@ -1773,38 +1771,38 @@ class PreparedDatastore {
       : mDatastore(aDatastore),
         mTimer(NS_NewTimer()),
         mContentParentId(aContentParentId),
         mOrigin(aOrigin),
         mDatastoreId(aDatastoreId),
         mForPreload(aForPreload),
         mInvalidated(false) {
     AssertIsOnBackgroundThread();
-    MOZ_DIAGNOSTIC_ASSERT(aDatastore);
-    MOZ_DIAGNOSTIC_ASSERT(mTimer);
+    MOZ_ASSERT(aDatastore);
+    MOZ_ASSERT(mTimer);
 
     aDatastore->NoteLivePreparedDatastore(this);
 
     MOZ_ALWAYS_SUCCEEDS(mTimer->InitWithNamedFuncCallback(
         TimerCallback, this, kPreparedDatastoreTimeoutMs,
         nsITimer::TYPE_ONE_SHOT, "PreparedDatastore::TimerCallback"));
   }
 
   ~PreparedDatastore() {
-    MOZ_DIAGNOSTIC_ASSERT(mDatastore);
-    MOZ_DIAGNOSTIC_ASSERT(mTimer);
+    MOZ_ASSERT(mDatastore);
+    MOZ_ASSERT(mTimer);
 
     mTimer->Cancel();
 
     mDatastore->NoteFinishedPreparedDatastore(this);
   }
 
   Datastore* GetDatastore() const {
     AssertIsOnBackgroundThread();
-    MOZ_DIAGNOSTIC_ASSERT(mDatastore);
+    MOZ_ASSERT(mDatastore);
 
     return mDatastore;
   }
 
   const Maybe<ContentParentId>& GetContentParentId() const {
     return mContentParentId;
   }
 
@@ -1847,17 +1845,17 @@ class Database final : public PBackgroun
   const Maybe<ContentParentId> mContentParentId;
   // Strings share buffers if possible, so it's not a problem to duplicate the
   // origin here.
   nsCString mOrigin;
   uint32_t mPrivateBrowsingId;
   bool mAllowedToClose;
   bool mActorDestroyed;
   bool mRequestedAllowToClose;
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool mActorWasAlive;
 #endif
 
  public:
   // Created in AllocPBackgroundLSDatabaseParent.
   Database(const PrincipalInfo& aPrincipalInfo,
            const Maybe<ContentParentId>& aContentParentId,
            const nsACString& aOrigin, uint32_t aPrivateBrowsingId);
@@ -2020,24 +2018,23 @@ class Snapshot final : public PBackgroun
  public:
   // Created in AllocPBackgroundLSSnapshotParent.
   Snapshot(Database* aDatabase, const nsAString& aDocumentURI);
 
   void Init(nsTHashtable<nsStringHashKey>& aLoadedItems, uint32_t aTotalLength,
             int64_t aInitialUsage, int64_t aPeakUsage,
             LSSnapshot::LoadState aLoadState) {
     AssertIsOnBackgroundThread();
-    MOZ_DIAGNOSTIC_ASSERT(aInitialUsage >= 0);
-    MOZ_DIAGNOSTIC_ASSERT(aPeakUsage >= aInitialUsage);
-    MOZ_DIAGNOSTIC_ASSERT_IF(
-        aLoadState == LSSnapshot::LoadState::AllOrderedItems,
-        aLoadedItems.Count() == 0);
-    MOZ_DIAGNOSTIC_ASSERT(mTotalLength == 0);
-    MOZ_DIAGNOSTIC_ASSERT(mUsage == -1);
-    MOZ_DIAGNOSTIC_ASSERT(mPeakUsage == -1);
+    MOZ_ASSERT(aInitialUsage >= 0);
+    MOZ_ASSERT(aPeakUsage >= aInitialUsage);
+    MOZ_ASSERT_IF(aLoadState == LSSnapshot::LoadState::AllOrderedItems,
+                  aLoadedItems.Count() == 0);
+    MOZ_ASSERT(mTotalLength == 0);
+    MOZ_ASSERT(mUsage == -1);
+    MOZ_ASSERT(mPeakUsage == -1);
 
     mLoadedItems.SwapElements(aLoadedItems);
     mTotalLength = aTotalLength;
     mUsage = aInitialUsage;
     mPeakUsage = aPeakUsage;
     if (aLoadState == LSSnapshot::LoadState::AllOrderedKeys) {
       mLoadKeysReceived = true;
     } else if (aLoadState == LSSnapshot::LoadState::AllOrderedItems) {
@@ -2269,34 +2266,34 @@ class PrepareDatastoreOp : public LSRequ
   int64_t mSizeOfKeys;
   int64_t mSizeOfItems;
   NestedState mNestedState;
   const bool mCreateIfNotExists;
   bool mDatabaseNotAvailable;
   bool mRequestedDirectoryLock;
   bool mInvalidated;
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   int64_t mDEBUGUsage;
 #endif
 
  public:
   PrepareDatastoreOp(nsIEventTarget* aMainEventTarget,
                      const LSRequestParams& aParams,
                      const Maybe<ContentParentId>& aContentParentId);
 
   bool OriginIsKnown() const {
     AssertIsOnOwningThread();
 
     return !mOrigin.IsEmpty();
   }
 
   const nsCString& Origin() const {
     AssertIsOnOwningThread();
-    MOZ_DIAGNOSTIC_ASSERT(OriginIsKnown());
+    MOZ_ASSERT(OriginIsKnown());
 
     return mOrigin;
   }
 
   bool RequestedDirectoryLock() const {
     AssertIsOnOwningThread();
 
     return mRequestedDirectoryLock;
@@ -2504,17 +2501,17 @@ class ArchivedOriginScope {
         : mPattern(MakeUnique<OriginAttributesPattern>(aPattern)) {}
 
     Pattern(const Pattern& aOther)
         : mPattern(MakeUnique<OriginAttributesPattern>(*aOther.mPattern)) {}
 
     Pattern(Pattern&& aOther) = default;
 
     const OriginAttributesPattern& GetPattern() const {
-      MOZ_DIAGNOSTIC_ASSERT(mPattern);
+      MOZ_ASSERT(mPattern);
       return *mPattern;
     }
   };
 
   struct Null {};
 
   using DataType = Variant<Origin, Pattern, Prefix, Null>;
 
@@ -2535,32 +2532,32 @@ class ArchivedOriginScope {
 
   bool IsPrefix() const { return mData.is<Prefix>(); }
 
   bool IsPattern() const { return mData.is<Pattern>(); }
 
   bool IsNull() const { return mData.is<Null>(); }
 
   const nsACString& OriginSuffix() const {
-    MOZ_DIAGNOSTIC_ASSERT(IsOrigin());
+    MOZ_ASSERT(IsOrigin());
 
     return mData.as<Origin>().OriginSuffix();
   }
 
   const nsACString& OriginNoSuffix() const {
-    MOZ_DIAGNOSTIC_ASSERT(IsOrigin() || IsPrefix());
+    MOZ_ASSERT(IsOrigin() || IsPrefix());
 
     if (IsOrigin()) {
       return mData.as<Origin>().OriginNoSuffix();
     }
     return mData.as<Prefix>().OriginNoSuffix();
   }
 
   const OriginAttributesPattern& GetPattern() const {
-    MOZ_DIAGNOSTIC_ASSERT(IsPattern());
+    MOZ_ASSERT(IsPattern());
 
     return mData.as<Pattern>().GetPattern();
   }
 
   void GetBindingClause(nsACString& aBindingClause) const;
 
   nsresult BindToStatement(mozIStorageStatement* aStatement) const;
 
@@ -2703,17 +2700,17 @@ class QuotaClient::MatchFunction final :
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEFUNCTION
 };
 
 /*******************************************************************************
  * Globals
  ******************************************************************************/
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
 bool gLocalStorageInitialized = false;
 #endif
 
 typedef nsTArray<PrepareDatastoreOp*> PrepareDatastoreOpArray;
 
 StaticAutoPtr<PrepareDatastoreOpArray> gPrepareDatastoreOps;
 
 typedef nsDataHashtable<nsCStringHashKey, Datastore*> DatastoreHashtable;
@@ -2756,47 +2753,50 @@ typedef nsDataHashtable<nsCStringHashKey
 StaticAutoPtr<UsageHashtable> gUsages;
 
 StaticAutoPtr<ArchivedOriginHashtable> gArchivedOrigins;
 
 // Can only be touched on the Quota Manager I/O thread.
 bool gInitializedShadowStorage = false;
 
 bool IsOnConnectionThread() {
-  MOZ_DIAGNOSTIC_ASSERT(gConnectionThread);
+  MOZ_ASSERT(gConnectionThread);
   return gConnectionThread->IsOnConnectionThread();
 }
 
-void AssertIsOnConnectionThread() { MOZ_ASSERT(IsOnConnectionThread()); }
+void AssertIsOnConnectionThread() {
+  MOZ_ASSERT(gConnectionThread);
+  gConnectionThread->AssertIsOnConnectionThread();
+}
 
 void InitUsageForOrigin(const nsACString& aOrigin, int64_t aUsage) {
   AssertIsOnIOThread();
 
   if (!gUsages) {
     gUsages = new UsageHashtable();
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(!gUsages->Contains(aOrigin));
+  MOZ_ASSERT(!gUsages->Contains(aOrigin));
   gUsages->Put(aOrigin, aUsage);
 }
 
 void UpdateUsageForOrigin(const nsACString& aOrigin, int64_t aUsage) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(gUsages);
-  MOZ_DIAGNOSTIC_ASSERT(gUsages->Contains(aOrigin));
+  MOZ_ASSERT(gUsages);
+  MOZ_ASSERT(gUsages->Contains(aOrigin));
 
   gUsages->Put(aOrigin, aUsage);
 }
 
 nsresult LoadArchivedOrigins() {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(!gArchivedOrigins);
+  MOZ_ASSERT(!gArchivedOrigins);
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   // Ensure that the webappsstore.sqlite is moved to new place.
   nsresult rv = quotaManager->EnsureStorageIsInitialized();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   nsCOMPtr<mozIStorageConnection> connection;
@@ -2855,18 +2855,18 @@ nsresult LoadArchivedOrigins() {
 
   gArchivedOrigins = archivedOrigins.forget();
   return NS_OK;
 }
 
 nsresult GetUsage(mozIStorageConnection* aConnection,
                   ArchivedOriginScope* aArchivedOriginScope, int64_t* aUsage) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
-  MOZ_DIAGNOSTIC_ASSERT(aUsage);
+  MOZ_ASSERT(aConnection);
+  MOZ_ASSERT(aUsage);
 
   nsresult rv;
 
   nsCOMPtr<mozIStorageStatement> stmt;
   if (aArchivedOriginScope) {
     rv = aConnection->CreateStatement(
         NS_LITERAL_CSTRING("SELECT "
                            "total(utf16Length(key) + utf16Length(value)) "
@@ -2905,57 +2905,57 @@ nsresult GetUsage(mozIStorageConnection*
   }
 
   *aUsage = usage;
   return NS_OK;
 }
 
 void ShadowWritesPrefChangedCallback(const char* aPrefName, void* aClosure) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!strcmp(aPrefName, kShadowWritesPref));
-  MOZ_DIAGNOSTIC_ASSERT(!aClosure);
+  MOZ_ASSERT(!strcmp(aPrefName, kShadowWritesPref));
+  MOZ_ASSERT(!aClosure);
 
   gShadowWrites = Preferences::GetBool(aPrefName, kDefaultShadowWrites);
 }
 
 void SnapshotPrefillPrefChangedCallback(const char* aPrefName, void* aClosure) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!strcmp(aPrefName, kSnapshotPrefillPref));
-  MOZ_DIAGNOSTIC_ASSERT(!aClosure);
+  MOZ_ASSERT(!strcmp(aPrefName, kSnapshotPrefillPref));
+  MOZ_ASSERT(!aClosure);
 
   int32_t snapshotPrefill =
       Preferences::GetInt(aPrefName, kDefaultSnapshotPrefill);
 
   // The magic -1 is for use only by tests.
   if (snapshotPrefill == -1) {
     snapshotPrefill = INT32_MAX;
   }
 
   gSnapshotPrefill = snapshotPrefill;
 }
 
 void ClientValidationPrefChangedCallback(const char* aPrefName,
                                          void* aClosure) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!strcmp(aPrefName, kClientValidationPref));
-  MOZ_DIAGNOSTIC_ASSERT(!aClosure);
+  MOZ_ASSERT(!strcmp(aPrefName, kClientValidationPref));
+  MOZ_ASSERT(!aClosure);
 
   gClientValidation = Preferences::GetBool(aPrefName, kDefaultClientValidation);
 }
 
 }  // namespace
 
 /*******************************************************************************
  * Exported functions
  ******************************************************************************/
 
 void InitializeLocalStorage() {
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!gLocalStorageInitialized);
+  MOZ_ASSERT(!gLocalStorageInitialized);
 
   if (!QuotaManager::IsRunningGTests()) {
     // This service has to be started on the main thread currently.
     nsCOMPtr<mozIStorageService> ss;
     if (NS_WARN_IF(!(ss = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID)))) {
       NS_WARNING("Failed to get storage service!");
     }
   }
@@ -2978,17 +2978,17 @@ void InitializeLocalStorage() {
                                        kShadowWritesPref);
 
   Preferences::RegisterCallbackAndCall(SnapshotPrefillPrefChangedCallback,
                                        kSnapshotPrefillPref);
 
   Preferences::RegisterCallbackAndCall(ClientValidationPrefChangedCallback,
                                        kClientValidationPref);
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   gLocalStorageInitialized = true;
 #endif
 }
 
 bool GetCurrentNextGenPrefValue() { return gNextGen; }
 
 PBackgroundLSDatabaseParent* AllocPBackgroundLSDatabaseParent(
     const PrincipalInfo& aPrincipalInfo, const uint32_t& aPrivateBrowsingId,
@@ -3024,28 +3024,28 @@ PBackgroundLSDatabaseParent* AllocPBackg
   return database.forget().take();
 }
 
 bool RecvPBackgroundLSDatabaseConstructor(PBackgroundLSDatabaseParent* aActor,
                                           const PrincipalInfo& aPrincipalInfo,
                                           const uint32_t& aPrivateBrowsingId,
                                           const uint64_t& aDatastoreId) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(gPreparedDatastores);
-  MOZ_DIAGNOSTIC_ASSERT(gPreparedDatastores->Get(aDatastoreId));
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(gPreparedDatastores);
+  MOZ_ASSERT(gPreparedDatastores->Get(aDatastoreId));
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
 
   // The actor is now completely built (it has a manager, channel and it's
   // registered as a subprotocol).
   // ActorDestroy will be called if we fail here.
 
   nsAutoPtr<PreparedDatastore> preparedDatastore;
   gPreparedDatastores->Remove(aDatastoreId, &preparedDatastore);
-  MOZ_DIAGNOSTIC_ASSERT(preparedDatastore);
+  MOZ_ASSERT(preparedDatastore);
 
   auto* database = static_cast<Database*>(aActor);
 
   database->SetActorAlive(preparedDatastore->GetDatastore());
 
   // It's possible that AbortOperations was called before the database actor
   // was created and became live. Let the child know that the database in no
   // longer valid.
@@ -3053,17 +3053,17 @@ bool RecvPBackgroundLSDatabaseConstructo
     database->RequestAllowToClose();
   }
 
   return true;
 }
 
 bool DeallocPBackgroundLSDatabaseParent(PBackgroundLSDatabaseParent* aActor) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
+  MOZ_ASSERT(aActor);
 
   // Transfer ownership back from IPDL.
   RefPtr<Database> actor = dont_AddRef(static_cast<Database*>(aActor));
 
   return true;
 }
 
 PBackgroundLSObserverParent* AllocPBackgroundLSObserverParent(
@@ -3089,23 +3089,23 @@ PBackgroundLSObserverParent* AllocPBackg
 
   // Transfer ownership to IPDL.
   return observer.forget().take();
 }
 
 bool RecvPBackgroundLSObserverConstructor(PBackgroundLSObserverParent* aActor,
                                           const uint64_t& aObserverId) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(gPreparedObsevers);
-  MOZ_DIAGNOSTIC_ASSERT(gPreparedObsevers->GetWeak(aObserverId));
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(gPreparedObsevers);
+  MOZ_ASSERT(gPreparedObsevers->GetWeak(aObserverId));
 
   RefPtr<Observer> observer;
   gPreparedObsevers->Remove(aObserverId, observer.StartAssignment());
-  MOZ_DIAGNOSTIC_ASSERT(observer);
+  MOZ_ASSERT(observer);
 
   if (!gPreparedObsevers->Count()) {
     gPreparedObsevers = nullptr;
   }
 
   if (!gObservers) {
     gObservers = new ObserverHashtable();
   }
@@ -3117,17 +3117,17 @@ bool RecvPBackgroundLSObserverConstructo
   }
   array->AppendElement(observer);
 
   return true;
 }
 
 bool DeallocPBackgroundLSObserverParent(PBackgroundLSObserverParent* aActor) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
+  MOZ_ASSERT(aActor);
 
   // Transfer ownership back from IPDL.
   RefPtr<Observer> actor = dont_AddRef(static_cast<Observer*>(aActor));
 
   return true;
 }
 
 bool VerifyPrincipalInfo(const Maybe<ContentParentId>& aContentParentId,
@@ -3172,17 +3172,17 @@ bool VerifyOriginKey(const nsACString& a
   }
 
   return true;
 }
 
 bool VerifyRequestParams(const Maybe<ContentParentId>& aContentParentId,
                          const LSRequestParams& aParams) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() != LSRequestParams::T__None);
+  MOZ_ASSERT(aParams.type() != LSRequestParams::T__None);
 
   switch (aParams.type()) {
     case LSRequestParams::TLSRequestPreloadDatastoreParams: {
       const LSRequestCommonParams& params =
           aParams.get_LSRequestPreloadDatastoreParams().commonParams();
 
       if (NS_WARN_IF(!VerifyPrincipalInfo(aContentParentId,
                                           params.principalInfo(), Nothing()))) {
@@ -3236,23 +3236,23 @@ bool VerifyRequestParams(const Maybe<Con
   }
 
   return true;
 }
 
 PBackgroundLSRequestParent* AllocPBackgroundLSRequestParent(
     PBackgroundParent* aBackgroundActor, const LSRequestParams& aParams) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() != LSRequestParams::T__None);
+  MOZ_ASSERT(aParams.type() != LSRequestParams::T__None);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread())) {
     return nullptr;
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   // Always verify parameters in DEBUG builds!
   bool trustParams = false;
 #else
   bool trustParams = !BackgroundParent::IsOtherProcessActor(aBackgroundActor);
 #endif
 
   Maybe<ContentParentId> contentParentId;
 
@@ -3307,19 +3307,19 @@ PBackgroundLSRequestParent* AllocPBackgr
 
   // Transfer ownership to IPDL.
   return actor.forget().take();
 }
 
 bool RecvPBackgroundLSRequestConstructor(PBackgroundLSRequestParent* aActor,
                                          const LSRequestParams& aParams) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() != LSRequestParams::T__None);
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(aParams.type() != LSRequestParams::T__None);
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
 
   // The actor is now completely built.
 
   auto* op = static_cast<LSRequestBase*>(aActor);
 
   op->Dispatch();
 
   return true;
@@ -3333,17 +3333,17 @@ bool DeallocPBackgroundLSRequestParent(P
       dont_AddRef(static_cast<LSRequestBase*>(aActor));
 
   return true;
 }
 
 bool VerifyRequestParams(const Maybe<ContentParentId>& aContentParentId,
                          const LSSimpleRequestParams& aParams) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
+  MOZ_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
 
   switch (aParams.type()) {
     case LSSimpleRequestParams::TLSSimpleRequestPreloadedParams: {
       const LSSimpleRequestPreloadedParams& params =
           aParams.get_LSSimpleRequestPreloadedParams();
 
       if (NS_WARN_IF(!VerifyPrincipalInfo(aContentParentId,
                                           params.principalInfo(), Nothing()))) {
@@ -3358,23 +3358,23 @@ bool VerifyRequestParams(const Maybe<Con
   }
 
   return true;
 }
 
 PBackgroundLSSimpleRequestParent* AllocPBackgroundLSSimpleRequestParent(
     PBackgroundParent* aBackgroundActor, const LSSimpleRequestParams& aParams) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
+  MOZ_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread())) {
     return nullptr;
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   // Always verify parameters in DEBUG builds!
   bool trustParams = false;
 #else
   bool trustParams = !BackgroundParent::IsOtherProcessActor(aBackgroundActor);
 #endif
 
   if (!trustParams) {
     Maybe<ContentParentId> contentParentId;
@@ -3408,19 +3408,19 @@ PBackgroundLSSimpleRequestParent* AllocP
   // Transfer ownership to IPDL.
   return actor.forget().take();
 }
 
 bool RecvPBackgroundLSSimpleRequestConstructor(
     PBackgroundLSSimpleRequestParent* aActor,
     const LSSimpleRequestParams& aParams) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
 
   // The actor is now completely built.
 
   auto* op = static_cast<LSSimpleRequestBase*>(aActor);
 
   op->Dispatch();
 
   return true;
@@ -3438,32 +3438,32 @@ bool DeallocPBackgroundLSSimpleRequestPa
 }
 
 bool RecvLSClearPrivateBrowsing() {
   AssertIsOnBackgroundThread();
 
   if (gDatastores) {
     for (auto iter = gDatastores->ConstIter(); !iter.Done(); iter.Next()) {
       Datastore* datastore = iter.Data();
-      MOZ_DIAGNOSTIC_ASSERT(datastore);
+      MOZ_ASSERT(datastore);
 
       if (datastore->PrivateBrowsingId()) {
         datastore->PrivateBrowsingClear();
       }
     }
   }
 
   return true;
 }
 
 namespace localstorage {
 
 already_AddRefed<mozilla::dom::quota::Client> CreateQuotaClient() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(CachedNextGenLocalStorageEnabled());
+  MOZ_ASSERT(CachedNextGenLocalStorageEnabled());
 
   RefPtr<QuotaClient> client = new QuotaClient();
   return client.forget();
 }
 
 }  // namespace localstorage
 
 /*******************************************************************************
@@ -3565,32 +3565,32 @@ void WriteOptimizer::ApplyWrites(nsTArra
           MOZ_CRASH("Bad type!");
       }
     }
   }
 
   for (auto iter = mWriteInfos.ConstIter(); !iter.Done(); iter.Next()) {
     WriteInfo* writeInfo = iter.Data();
 
-    MOZ_DIAGNOSTIC_ASSERT(writeInfo->GetType() == WriteInfo::AddItem);
+    MOZ_ASSERT(writeInfo->GetType() == WriteInfo::AddItem);
 
     auto addItemInfo = static_cast<AddItemInfo*>(writeInfo);
 
     LSItemInfo* itemInfo = aOrderedItems.AppendElement();
     itemInfo->key() = addItemInfo->GetKey();
     itemInfo->value() = addItemInfo->GetValue();
   }
 
   mWriteInfos.Clear();
 }
 
 nsresult WriteOptimizer::PerformWrites(Connection* aConnection,
                                        bool aShadowWrites, int64_t& aOutUsage) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   nsresult rv;
 
   if (mClearInfo) {
     rv = mClearInfo->Perform(aConnection, aShadowWrites);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
@@ -3647,17 +3647,17 @@ nsresult WriteOptimizer::PerformWrites(C
 
   aOutUsage = usage;
   return NS_OK;
 }
 
 nsresult WriteOptimizer::AddItemInfo::Perform(Connection* aConnection,
                                               bool aShadowWrites) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   Connection::CachedStatement stmt;
   nsresult rv = aConnection->GetCachedStatement(
       NS_LITERAL_CSTRING("INSERT OR REPLACE INTO data (key, value) "
                          "VALUES(:key, :value)"),
       &stmt);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -3724,17 +3724,17 @@ nsresult WriteOptimizer::AddItemInfo::Pe
   }
 
   return NS_OK;
 }
 
 nsresult WriteOptimizer::RemoveItemInfo::Perform(Connection* aConnection,
                                                  bool aShadowWrites) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   Connection::CachedStatement stmt;
   nsresult rv =
       aConnection->GetCachedStatement(NS_LITERAL_CSTRING("DELETE FROM data "
                                                          "WHERE key = :key;"),
                                       &stmt);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -3780,17 +3780,17 @@ nsresult WriteOptimizer::RemoveItemInfo:
   }
 
   return NS_OK;
 }
 
 nsresult WriteOptimizer::ClearInfo::Perform(Connection* aConnection,
                                             bool aShadowWrites) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   Connection::CachedStatement stmt;
   nsresult rv = aConnection->GetCachedStatement(
       NS_LITERAL_CSTRING("DELETE FROM data;"), &stmt);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -3831,69 +3831,68 @@ nsresult WriteOptimizer::ClearInfo::Perf
 
 /*******************************************************************************
  * ConnectionDatastoreOperationBase
  ******************************************************************************/
 
 ConnectionDatastoreOperationBase::ConnectionDatastoreOperationBase(
     Connection* aConnection)
     : mConnection(aConnection) {
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 }
 
 ConnectionDatastoreOperationBase::~ConnectionDatastoreOperationBase() {
-  MOZ_DIAGNOSTIC_ASSERT(
-      !mConnection,
-      "ConnectionDatabaseOperationBase::Cleanup() was not called by a "
-      "subclass!");
+  MOZ_ASSERT(!mConnection,
+             "ConnectionDatabaseOperationBase::Cleanup() was not called by a "
+             "subclass!");
 }
 
 void ConnectionDatastoreOperationBase::Cleanup() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(mConnection);
 
   mConnection = nullptr;
 
   NoteComplete();
 }
 
 void ConnectionDatastoreOperationBase::OnSuccess() { AssertIsOnOwningThread(); }
 
 void ConnectionDatastoreOperationBase::OnFailure(nsresult aResultCode) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(aResultCode));
+  MOZ_ASSERT(NS_FAILED(aResultCode));
 }
 
 void ConnectionDatastoreOperationBase::RunOnConnectionThread() {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
-  MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(ResultCode()));
+  MOZ_ASSERT(mConnection);
+  MOZ_ASSERT(NS_SUCCEEDED(ResultCode()));
 
   if (!MayProceedOnNonOwningThread()) {
     SetFailureCode(NS_ERROR_FAILURE);
   } else {
     nsresult rv = mConnection->EnsureStorageConnection();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       SetFailureCode(rv);
     } else {
-      MOZ_DIAGNOSTIC_ASSERT(mConnection->StorageConnection());
+      MOZ_ASSERT(mConnection->StorageConnection());
 
       rv = DoDatastoreWork();
       if (NS_FAILED(rv)) {
         SetFailureCode(rv);
       }
     }
   }
 
   MOZ_ALWAYS_SUCCEEDS(OwningEventTarget()->Dispatch(this, NS_DISPATCH_NORMAL));
 }
 
 void ConnectionDatastoreOperationBase::RunOnOwningThread() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(mConnection);
 
   if (!MayProceed()) {
     MaybeSetFailureCode(NS_ERROR_FAILURE);
   }
 
   if (NS_SUCCEEDED(ResultCode())) {
     OnSuccess();
   } else {
@@ -3922,108 +3921,108 @@ Connection::Connection(ConnectionThread*
                        const nsACString& aOrigin,
                        const nsAString& aDirectoryPath,
                        nsAutoPtr<ArchivedOriginScope>&& aArchivedOriginScope)
     : mConnectionThread(aConnectionThread),
       mArchivedOriginScope(std::move(aArchivedOriginScope)),
       mOrigin(aOrigin),
       mDirectoryPath(aDirectoryPath),
       mFlushScheduled(false)
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
       ,
       mInUpdateBatch(false)
 #endif
 {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aOrigin.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(!aDirectoryPath.IsEmpty());
+  MOZ_ASSERT(!aOrigin.IsEmpty());
+  MOZ_ASSERT(!aDirectoryPath.IsEmpty());
 }
 
 Connection::~Connection() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mStorageConnection);
-  MOZ_DIAGNOSTIC_ASSERT(!mCachedStatements.Count());
-  MOZ_DIAGNOSTIC_ASSERT(!mInUpdateBatch);
-  MOZ_DIAGNOSTIC_ASSERT(!mFlushScheduled);
+  MOZ_ASSERT(!mStorageConnection);
+  MOZ_ASSERT(!mCachedStatements.Count());
+  MOZ_ASSERT(!mInUpdateBatch);
+  MOZ_ASSERT(!mFlushScheduled);
 }
 
 void Connection::Dispatch(ConnectionDatastoreOperationBase* aOp) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnectionThread);
+  MOZ_ASSERT(mConnectionThread);
 
   MOZ_ALWAYS_SUCCEEDS(
       mConnectionThread->mThread->Dispatch(aOp, NS_DISPATCH_NORMAL));
 }
 
 void Connection::Close(nsIRunnable* aCallback) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aCallback);
+  MOZ_ASSERT(aCallback);
 
   if (mFlushScheduled) {
-    MOZ_DIAGNOSTIC_ASSERT(mFlushTimer);
+    MOZ_ASSERT(mFlushTimer);
     MOZ_ALWAYS_SUCCEEDS(mFlushTimer->Cancel());
 
     Flush();
 
     mFlushTimer = nullptr;
   }
 
   RefPtr<CloseOp> op = new CloseOp(this, aCallback);
 
   Dispatch(op);
 }
 
 void Connection::AddItem(const nsString& aKey, const nsString& aValue,
                          int64_t aDelta) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(mInUpdateBatch);
 
   mWriteOptimizer.AddItem(aKey, aValue, aDelta);
 }
 
 void Connection::UpdateItem(const nsString& aKey, const nsString& aValue,
                             int64_t aDelta) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(mInUpdateBatch);
 
   mWriteOptimizer.UpdateItem(aKey, aValue, aDelta);
 }
 
 void Connection::RemoveItem(const nsString& aKey, int64_t aDelta) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(mInUpdateBatch);
 
   mWriteOptimizer.RemoveItem(aKey, aDelta);
 }
 
 void Connection::Clear(int64_t aDelta) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(mInUpdateBatch);
 
   mWriteOptimizer.Clear(aDelta);
 }
 
 void Connection::BeginUpdateBatch() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mInUpdateBatch);
-
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+  MOZ_ASSERT(!mInUpdateBatch);
+
+#ifdef DEBUG
   mInUpdateBatch = true;
 #endif
 }
 
 void Connection::EndUpdateBatch() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(mInUpdateBatch);
 
   if (mWriteOptimizer.HasWrites() && !mFlushScheduled) {
     ScheduleFlush();
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   mInUpdateBatch = false;
 #endif
 }
 
 nsresult Connection::EnsureStorageConnection() {
   AssertIsOnConnectionThread();
 
   if (!mStorageConnection) {
@@ -4053,30 +4052,30 @@ nsresult Connection::EnsureStorageConnec
     mStorageConnection = storageConnection;
   }
 
   return NS_OK;
 }
 
 void Connection::CloseStorageConnection() {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(mStorageConnection);
+  MOZ_ASSERT(mStorageConnection);
 
   mCachedStatements.Clear();
 
   MOZ_ALWAYS_SUCCEEDS(mStorageConnection->Close());
   mStorageConnection = nullptr;
 }
 
 nsresult Connection::GetCachedStatement(const nsACString& aQuery,
                                         CachedStatement* aCachedStatement) {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aQuery.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(aCachedStatement);
-  MOZ_DIAGNOSTIC_ASSERT(mStorageConnection);
+  MOZ_ASSERT(!aQuery.IsEmpty());
+  MOZ_ASSERT(aCachedStatement);
+  MOZ_ASSERT(mStorageConnection);
 
   nsCOMPtr<mozIStorageStatement> stmt;
 
   if (!mCachedStatements.Get(aQuery, getter_AddRefs(stmt))) {
     nsresult rv =
         mStorageConnection->CreateStatement(aQuery, getter_AddRefs(stmt));
     if (NS_FAILED(rv)) {
 #ifdef DEBUG
@@ -4097,51 +4096,51 @@ nsresult Connection::GetCachedStatement(
   }
 
   aCachedStatement->Assign(this, stmt.forget());
   return NS_OK;
 }
 
 void Connection::ScheduleFlush() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mWriteOptimizer.HasWrites());
-  MOZ_DIAGNOSTIC_ASSERT(!mFlushScheduled);
+  MOZ_ASSERT(mWriteOptimizer.HasWrites());
+  MOZ_ASSERT(!mFlushScheduled);
 
   if (!mFlushTimer) {
     mFlushTimer = NS_NewTimer();
-    MOZ_DIAGNOSTIC_ASSERT(mFlushTimer);
+    MOZ_ASSERT(mFlushTimer);
   }
 
   MOZ_ALWAYS_SUCCEEDS(mFlushTimer->InitWithNamedFuncCallback(
       FlushTimerCallback, this, kFlushTimeoutMs, nsITimer::TYPE_ONE_SHOT,
       "Connection::FlushTimerCallback"));
 
   mFlushScheduled = true;
 }
 
 void Connection::Flush() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mFlushScheduled);
+  MOZ_ASSERT(mFlushScheduled);
 
   if (mWriteOptimizer.HasWrites()) {
     RefPtr<FlushOp> op = new FlushOp(this, std::move(mWriteOptimizer));
 
     Dispatch(op);
   }
 
   mFlushScheduled = false;
 }
 
 // static
 void Connection::FlushTimerCallback(nsITimer* aTimer, void* aClosure) {
-  MOZ_DIAGNOSTIC_ASSERT(aClosure);
+  MOZ_ASSERT(aClosure);
 
   auto* self = static_cast<Connection*>(aClosure);
-  MOZ_DIAGNOSTIC_ASSERT(self);
-  MOZ_DIAGNOSTIC_ASSERT(self->mFlushScheduled);
+  MOZ_ASSERT(self);
+  MOZ_ASSERT(self->mFlushScheduled);
 
   self->Flush();
 }
 
 Connection::CachedStatement::CachedStatement() {
   AssertIsOnConnectionThread();
 
   MOZ_COUNT_CTOR(Connection::CachedStatement);
@@ -4156,17 +4155,17 @@ Connection::CachedStatement::~CachedStat
 Connection::CachedStatement::operator mozIStorageStatement*() const {
   AssertIsOnConnectionThread();
 
   return mStatement;
 }
 
 mozIStorageStatement* Connection::CachedStatement::operator->() const {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(mStatement);
+  MOZ_ASSERT(mStatement);
 
   return mStatement;
 }
 
 void Connection::CachedStatement::Assign(
     Connection* aConnection,
     already_AddRefed<mozIStorageStatement> aStatement) {
   AssertIsOnConnectionThread();
@@ -4181,36 +4180,36 @@ void Connection::CachedStatement::Assign
 }
 
 Connection::FlushOp::FlushOp(Connection* aConnection,
                              WriteOptimizer&& aWriteOptimizer)
     : ConnectionDatastoreOperationBase(aConnection),
       mQuotaClient(QuotaClient::GetInstance()),
       mWriteOptimizer(std::move(aWriteOptimizer)),
       mShadowWrites(gShadowWrites) {
-  MOZ_DIAGNOSTIC_ASSERT(mQuotaClient);
+  MOZ_ASSERT(mQuotaClient);
 }
 
 nsresult Connection::FlushOp::DoDatastoreWork() {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(mConnection);
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   nsCOMPtr<mozIStorageConnection> storageConnection =
       mConnection->StorageConnection();
-  MOZ_DIAGNOSTIC_ASSERT(storageConnection);
+  MOZ_ASSERT(storageConnection);
 
   nsresult rv;
 
   Maybe<MutexAutoLock> shadowDatabaseLock;
 
   if (mShadowWrites) {
-    MOZ_DIAGNOSTIC_ASSERT(mQuotaClient);
+    MOZ_ASSERT(mQuotaClient);
 
     shadowDatabaseLock.emplace(mQuotaClient->ShadowDatabaseMutex());
 
     rv = AttachShadowDatabase(quotaManager->GetBasePath(), storageConnection);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
@@ -4284,26 +4283,26 @@ nsresult Connection::FlushOp::DoDatastor
   MOZ_ALWAYS_SUCCEEDS(
       quotaManager->IOThread()->Dispatch(runnable, NS_DISPATCH_NORMAL));
 
   return NS_OK;
 }
 
 nsresult Connection::CloseOp::DoDatastoreWork() {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(mConnection);
 
   mConnection->CloseStorageConnection();
 
   return NS_OK;
 }
 
 void Connection::CloseOp::Cleanup() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(mConnection);
 
   mConnection->mConnectionThread->mConnections.Remove(mConnection->mOrigin);
 
   nsCOMPtr<nsIRunnable> callback;
   mCallback.swap(callback);
 
   callback->Run();
 
@@ -4318,43 +4317,47 @@ ConnectionThread::ConnectionThread() {
   AssertIsOnOwningThread();
   AssertIsOnBackgroundThread();
 
   MOZ_ALWAYS_SUCCEEDS(NS_NewNamedThread("LS Thread", getter_AddRefs(mThread)));
 }
 
 ConnectionThread::~ConnectionThread() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mConnections.Count());
+  MOZ_ASSERT(!mConnections.Count());
 }
 
 bool ConnectionThread::IsOnConnectionThread() {
-  MOZ_DIAGNOSTIC_ASSERT(mThread);
+  MOZ_ASSERT(mThread);
 
   bool current;
   return NS_SUCCEEDED(mThread->IsOnCurrentThread(&current)) && current;
 }
 
+void ConnectionThread::AssertIsOnConnectionThread() {
+  MOZ_ASSERT(IsOnConnectionThread());
+}
+
 already_AddRefed<Connection> ConnectionThread::CreateConnection(
     const nsACString& aOrigin, const nsAString& aDirectoryPath,
     nsAutoPtr<ArchivedOriginScope>&& aArchivedOriginScope) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!aOrigin.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(!mConnections.GetWeak(aOrigin));
+  MOZ_ASSERT(!aOrigin.IsEmpty());
+  MOZ_ASSERT(!mConnections.GetWeak(aOrigin));
 
   RefPtr<Connection> connection = new Connection(
       this, aOrigin, aDirectoryPath, std::move(aArchivedOriginScope));
   mConnections.Put(aOrigin, connection);
 
   return connection.forget();
 }
 
 void ConnectionThread::Shutdown() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mThread);
+  MOZ_ASSERT(mThread);
 
   mThread->Shutdown();
 }
 
 /*******************************************************************************
  * Datastore
  ******************************************************************************/
 
@@ -4370,219 +4373,215 @@ Datastore::Datastore(const nsACString& a
       mQuotaObject(std::move(aQuotaObject)),
       mOrigin(aOrigin),
       mPrivateBrowsingId(aPrivateBrowsingId),
       mUsage(aUsage),
       mUpdateBatchUsage(-1),
       mSizeOfKeys(aSizeOfKeys),
       mSizeOfItems(aSizeOfItems),
       mClosed(false)
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
       ,
       mInUpdateBatch(false)
 #endif
 {
   AssertIsOnBackgroundThread();
 
   mValues.SwapElements(aValues);
   mOrderedItems.SwapElements(aOrderedItems);
 }
 
 Datastore::~Datastore() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(mClosed);
+  MOZ_ASSERT(mClosed);
 }
 
 void Datastore::Close() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(!mDatabases.Count());
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(!mDatabases.Count());
+  MOZ_ASSERT(mDirectoryLock);
 
   mClosed = true;
 
   if (IsPersistent()) {
-    MOZ_DIAGNOSTIC_ASSERT(mConnection);
-    MOZ_DIAGNOSTIC_ASSERT(mQuotaObject);
+    MOZ_ASSERT(mConnection);
+    MOZ_ASSERT(mQuotaObject);
 
     // We can't release the directory lock and unregister itself from the
     // hashtable until the connection is fully closed.
     nsCOMPtr<nsIRunnable> callback =
         NewRunnableMethod("dom::Datastore::ConnectionClosedCallback", this,
                           &Datastore::ConnectionClosedCallback);
     mConnection->Close(callback);
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(!mConnection);
-    MOZ_DIAGNOSTIC_ASSERT(!mQuotaObject);
+    MOZ_ASSERT(!mConnection);
+    MOZ_ASSERT(!mQuotaObject);
 
     // There's no connection, so it's safe to release the directory lock and
     // unregister itself from the hashtable.
 
     mDirectoryLock = nullptr;
 
     CleanupMetadata();
   }
 }
 
 void Datastore::WaitForConnectionToComplete(nsIRunnable* aCallback) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aCallback);
-  MOZ_DIAGNOSTIC_ASSERT(!mCompleteCallback);
-  MOZ_DIAGNOSTIC_ASSERT(mClosed);
+  MOZ_ASSERT(aCallback);
+  MOZ_ASSERT(!mCompleteCallback);
+  MOZ_ASSERT(mClosed);
 
   mCompleteCallback = aCallback;
 }
 
 void Datastore::NoteLivePrepareDatastoreOp(
     PrepareDatastoreOp* aPrepareDatastoreOp) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aPrepareDatastoreOp);
-  MOZ_DIAGNOSTIC_ASSERT(!mPrepareDatastoreOps.GetEntry(aPrepareDatastoreOp));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aPrepareDatastoreOp);
+  MOZ_ASSERT(!mPrepareDatastoreOps.GetEntry(aPrepareDatastoreOp));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
 
   mPrepareDatastoreOps.PutEntry(aPrepareDatastoreOp);
 }
 
 void Datastore::NoteFinishedPrepareDatastoreOp(
     PrepareDatastoreOp* aPrepareDatastoreOp) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aPrepareDatastoreOp);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOps.GetEntry(aPrepareDatastoreOp));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aPrepareDatastoreOp);
+  MOZ_ASSERT(mPrepareDatastoreOps.GetEntry(aPrepareDatastoreOp));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
 
   mPrepareDatastoreOps.RemoveEntry(aPrepareDatastoreOp);
 
   MaybeClose();
 }
 
 void Datastore::NoteLivePreparedDatastore(
     PreparedDatastore* aPreparedDatastore) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aPreparedDatastore);
-  MOZ_DIAGNOSTIC_ASSERT(!mPreparedDatastores.GetEntry(aPreparedDatastore));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aPreparedDatastore);
+  MOZ_ASSERT(!mPreparedDatastores.GetEntry(aPreparedDatastore));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
 
   mPreparedDatastores.PutEntry(aPreparedDatastore);
 }
 
 void Datastore::NoteFinishedPreparedDatastore(
     PreparedDatastore* aPreparedDatastore) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aPreparedDatastore);
-  MOZ_DIAGNOSTIC_ASSERT(mPreparedDatastores.GetEntry(aPreparedDatastore));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aPreparedDatastore);
+  MOZ_ASSERT(mPreparedDatastores.GetEntry(aPreparedDatastore));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
 
   mPreparedDatastores.RemoveEntry(aPreparedDatastore);
 
   MaybeClose();
 }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
 bool Datastore::HasLivePreparedDatastores() const {
   AssertIsOnBackgroundThread();
 
   return mPreparedDatastores.Count();
 }
 #endif
 
 void Datastore::NoteLiveDatabase(Database* aDatabase) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(!mDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(!mDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
 
   mDatabases.PutEntry(aDatabase);
 }
 
 void Datastore::NoteFinishedDatabase(Database* aDatabase) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(mDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(!mActiveDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(mDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(!mActiveDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(!mClosed);
 
   mDatabases.RemoveEntry(aDatabase);
 
   MaybeClose();
 }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
 bool Datastore::HasLiveDatabases() const {
   AssertIsOnBackgroundThread();
 
   return mDatabases.Count();
 }
 #endif
 
 void Datastore::NoteActiveDatabase(Database* aDatabase) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(mDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(!mActiveDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(mDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(!mActiveDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(!mClosed);
 
   mActiveDatabases.PutEntry(aDatabase);
 }
 
 void Datastore::NoteInactiveDatabase(Database* aDatabase) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(mDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(mActiveDatabases.GetEntry(aDatabase));
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(mDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(mActiveDatabases.GetEntry(aDatabase));
+  MOZ_ASSERT(!mClosed);
 
   mActiveDatabases.RemoveEntry(aDatabase);
 
   if (!mActiveDatabases.Count() && mPendingUsageDeltas.Length()) {
     int64_t finalDelta = 0;
 
     for (auto delta : mPendingUsageDeltas) {
       finalDelta += delta;
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(finalDelta <= 0);
+    MOZ_ASSERT(finalDelta <= 0);
 
     if (finalDelta != 0) {
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-      bool ok = UpdateUsage(finalDelta);
-      MOZ_DIAGNOSTIC_ASSERT(ok);
-#else
-      UpdateUsage(finalDelta);
-#endif
+      DebugOnly<bool> ok = UpdateUsage(finalDelta);
+      MOZ_ASSERT(ok);
     }
 
     mPendingUsageDeltas.Clear();
   }
 }
 
 void Datastore::GetSnapshotInitInfo(nsTHashtable<nsStringHashKey>& aLoadedItems,
                                     nsTArray<LSItemInfo>& aItemInfos,
                                     uint32_t& aTotalLength,
                                     int64_t& aInitialUsage, int64_t& aPeakUsage,
                                     LSSnapshot::LoadState& aLoadState) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(!mInUpdateBatch);
-
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(!mInUpdateBatch);
+
+#ifdef DEBUG
   int64_t sizeOfKeys = 0;
   int64_t sizeOfItems = 0;
   for (auto item : mOrderedItems) {
     int64_t sizeOfKey = static_cast<int64_t>(item.key().Length());
     sizeOfKeys += sizeOfKey;
     sizeOfItems += sizeOfKey + static_cast<int64_t>(item.value().Length());
   }
-  MOZ_DIAGNOSTIC_ASSERT(mSizeOfKeys == sizeOfKeys);
-  MOZ_DIAGNOSTIC_ASSERT(mSizeOfItems == sizeOfItems);
+  MOZ_ASSERT(mSizeOfKeys == sizeOfKeys);
+  MOZ_ASSERT(mSizeOfItems == sizeOfItems);
 #endif
 
   int64_t size = 0;
   if (mSizeOfKeys <= gSnapshotPrefill) {
     if (mSizeOfItems <= gSnapshotPrefill) {
       aItemInfos.AppendElements(mOrderedItems);
       aLoadState = LSSnapshot::LoadState::AllOrderedItems;
     } else {
@@ -4622,51 +4621,51 @@ void Datastore::GetSnapshotInitInfo(nsTH
 
       aLoadedItems.PutEntry(key);
 
       LSItemInfo* itemInfo = aItemInfos.AppendElement();
       itemInfo->key() = iter.Key();
       itemInfo->value() = iter.Data();
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(aItemInfos.Length() < mOrderedItems.Length());
+    MOZ_ASSERT(aItemInfos.Length() < mOrderedItems.Length());
     aLoadState = LSSnapshot::LoadState::Partial;
   }
 
   aTotalLength = mValues.Count();
 
   aInitialUsage = mUsage;
   aPeakUsage = aInitialUsage;
 }
 
 void Datastore::GetItem(const nsString& aKey, nsString& aValue) const {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(!mClosed);
 
   if (!mValues.Get(aKey, &aValue)) {
     aValue.SetIsVoid(true);
   }
 }
 
 void Datastore::GetKeys(nsTArray<nsString>& aKeys) const {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
+  MOZ_ASSERT(!mClosed);
 
   for (auto item : mOrderedItems) {
     aKeys.AppendElement(item.key());
   }
 }
 
 void Datastore::SetItem(Database* aDatabase, const nsString& aDocumentURI,
                         const nsString& aKey, const nsString& aOldValue,
                         const nsString& aValue) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(mInUpdateBatch);
 
   nsString oldValue;
   GetItem(aKey, oldValue);
 
   if (oldValue != aValue || oldValue.IsVoid() != aValue.IsVoid()) {
     bool isNewItem = oldValue.IsVoid();
 
     NotifySnapshots(aDatabase, aKey, oldValue, /* affectsOrder */ isNewItem);
@@ -4706,19 +4705,19 @@ void Datastore::SetItem(Database* aDatab
   }
 
   NotifyObservers(aDatabase, aDocumentURI, aKey, aOldValue, aValue);
 }
 
 void Datastore::RemoveItem(Database* aDatabase, const nsString& aDocumentURI,
                            const nsString& aKey, const nsString& aOldValue) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(mInUpdateBatch);
 
   nsString oldValue;
   GetItem(aKey, oldValue);
 
   if (!oldValue.IsVoid()) {
     NotifySnapshots(aDatabase, aKey, oldValue, /* aAffectsOrder */ true);
 
     mValues.Remove(aKey);
@@ -4738,19 +4737,19 @@ void Datastore::RemoveItem(Database* aDa
     }
   }
 
   NotifyObservers(aDatabase, aDocumentURI, aKey, aOldValue, VoidString());
 }
 
 void Datastore::Clear(Database* aDatabase, const nsString& aDocumentURI) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(aDatabase);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(mInUpdateBatch);
 
   if (mValues.Count()) {
     int64_t sizeOfItems = 0;
     for (auto iter = mValues.ConstIter(); !iter.Done(); iter.Next()) {
       const nsAString& key = iter.Key();
       const nsAString& value = iter.Data();
 
       sizeOfItems += (static_cast<int64_t>(key.Length()) +
@@ -4774,106 +4773,98 @@ void Datastore::Clear(Database* aDatabas
   }
 
   NotifyObservers(aDatabase, aDocumentURI, VoidString(), VoidString(),
                   VoidString());
 }
 
 void Datastore::PrivateBrowsingClear() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(mPrivateBrowsingId);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(!mInUpdateBatch);
+  MOZ_ASSERT(mPrivateBrowsingId);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(!mInUpdateBatch);
 
   if (mValues.Count()) {
     MarkSnapshotsDirty();
 
     mValues.Clear();
 
     mOrderedItems.Clear();
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-    bool ok = UpdateUsage(-mSizeOfItems);
-    MOZ_DIAGNOSTIC_ASSERT(ok);
-#else
-    UpdateUsage(-mSizeOfItems);
-#endif
+    DebugOnly<bool> ok = UpdateUsage(-mSizeOfItems);
+    MOZ_ASSERT(ok);
 
     mSizeOfKeys = 0;
     mSizeOfItems = 0;
   }
 }
 
 void Datastore::BeginUpdateBatch(int64_t aSnapshotInitialUsage) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aSnapshotInitialUsage >= 0);
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(mUpdateBatchUsage == -1);
-  MOZ_DIAGNOSTIC_ASSERT(!mInUpdateBatch);
+  MOZ_ASSERT(aSnapshotInitialUsage >= 0);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(mUpdateBatchUsage == -1);
+  MOZ_ASSERT(!mInUpdateBatch);
 
   mUpdateBatchUsage = aSnapshotInitialUsage;
 
   if (IsPersistent()) {
     mConnection->BeginUpdateBatch();
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   mInUpdateBatch = true;
 #endif
 }
 
 int64_t Datastore::EndUpdateBatch(int64_t aSnapshotPeakUsage) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mClosed);
-  MOZ_DIAGNOSTIC_ASSERT(mInUpdateBatch);
+  MOZ_ASSERT(!mClosed);
+  MOZ_ASSERT(mInUpdateBatch);
 
   mWriteOptimizer.ApplyWrites(mOrderedItems);
 
   if (aSnapshotPeakUsage >= 0) {
     int64_t delta = mUpdateBatchUsage - aSnapshotPeakUsage;
 
     if (mActiveDatabases.Count()) {
       // We can't apply deltas while other databases are still active.
       // The final delta must be zero or negative, but individual deltas can
       // be positive. A positive delta can't be applied asynchronously since
       // there's no way to fire the quota exceeded error event.
 
       mPendingUsageDeltas.AppendElement(delta);
     } else {
-      MOZ_DIAGNOSTIC_ASSERT(delta <= 0);
+      MOZ_ASSERT(delta <= 0);
       if (delta != 0) {
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-        bool ok = UpdateUsage(delta);
-        MOZ_DIAGNOSTIC_ASSERT(ok);
-#else
-        UpdateUsage(delta);
-#endif
+        DebugOnly<bool> ok = UpdateUsage(delta);
+        MOZ_ASSERT(ok);
       }
     }
   }
 
   int64_t result = mUpdateBatchUsage;
   mUpdateBatchUsage = -1;
 
   if (IsPersistent()) {
     mConnection->EndUpdateBatch();
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   mInUpdateBatch = false;
 #endif
 
   return result;
 }
 
 int64_t Datastore::RequestUpdateUsage(int64_t aRequestedSize,
                                       int64_t aMinSize) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aRequestedSize > 0);
-  MOZ_DIAGNOSTIC_ASSERT(aMinSize > 0);
+  MOZ_ASSERT(aRequestedSize > 0);
+  MOZ_ASSERT(aMinSize > 0);
 
   if (UpdateUsage(aRequestedSize)) {
     return aRequestedSize;
   }
 
   if (UpdateUsage(aMinSize)) {
     return aMinSize;
   }
@@ -4882,25 +4873,25 @@ int64_t Datastore::RequestUpdateUsage(in
 }
 
 bool Datastore::UpdateUsage(int64_t aDelta) {
   AssertIsOnBackgroundThread();
 
   // Check internal LocalStorage origin limit.
   int64_t newUsage = mUsage + aDelta;
 
-  MOZ_DIAGNOSTIC_ASSERT(newUsage >= 0);
+  MOZ_ASSERT(newUsage >= 0);
 
   if (newUsage > gOriginLimitKB * 1024) {
     return false;
   }
 
   // Check QuotaManager limits (group and global limit).
   if (IsPersistent()) {
-    MOZ_DIAGNOSTIC_ASSERT(mQuotaObject);
+    MOZ_ASSERT(mQuotaObject);
 
     if (!mQuotaObject->MaybeUpdateSize(newUsage, /* aTruncate */ true)) {
       return false;
     }
   }
 
   // Quota checks passed, set new usage.
   mUsage = newUsage;
@@ -4914,20 +4905,20 @@ void Datastore::MaybeClose() {
   if (!mPrepareDatastoreOps.Count() && !mPreparedDatastores.Count() &&
       !mDatabases.Count()) {
     Close();
   }
 }
 
 void Datastore::ConnectionClosedCallback() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
-  MOZ_DIAGNOSTIC_ASSERT(mQuotaObject);
-  MOZ_DIAGNOSTIC_ASSERT(mClosed);
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(mConnection);
+  MOZ_ASSERT(mQuotaObject);
+  MOZ_ASSERT(mClosed);
 
   // Release the quota object first.
   mQuotaObject = nullptr;
 
   // Now it's safe to release the directory lock and unregister itself from
   // the hashtable.
 
   mDirectoryLock = nullptr;
@@ -4938,30 +4929,30 @@ void Datastore::ConnectionClosedCallback
   if (mCompleteCallback) {
     MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(mCompleteCallback.forget()));
   }
 }
 
 void Datastore::CleanupMetadata() {
   AssertIsOnBackgroundThread();
 
-  MOZ_DIAGNOSTIC_ASSERT(gDatastores);
-  MOZ_DIAGNOSTIC_ASSERT(gDatastores->Get(mOrigin));
+  MOZ_ASSERT(gDatastores);
+  MOZ_ASSERT(gDatastores->Get(mOrigin));
   gDatastores->Remove(mOrigin);
 
   if (!gDatastores->Count()) {
     gDatastores = nullptr;
   }
 }
 
 void Datastore::NotifySnapshots(Database* aDatabase, const nsAString& aKey,
                                 const nsAString& aOldValue,
                                 bool aAffectsOrder) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
+  MOZ_ASSERT(aDatabase);
 
   for (auto iter = mDatabases.ConstIter(); !iter.Done(); iter.Next()) {
     Database* database = iter.Get()->GetKey();
     if (database == aDatabase) {
       continue;
     }
 
     Snapshot* snapshot = database->GetSnapshot();
@@ -4984,28 +4975,28 @@ void Datastore::MarkSnapshotsDirty() {
   }
 }
 
 void Datastore::NotifyObservers(Database* aDatabase,
                                 const nsString& aDocumentURI,
                                 const nsString& aKey, const nsString& aOldValue,
                                 const nsString& aNewValue) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
+  MOZ_ASSERT(aDatabase);
 
   if (!gObservers) {
     return;
   }
 
   nsTArray<Observer*>* array;
   if (!gObservers->Get(mOrigin, &array)) {
     return;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(array);
+  MOZ_ASSERT(array);
 
   // We do not want to send information about events back to the content process
   // that caused the change.
   PBackgroundParent* databaseBackgroundActor = aDatabase->Manager();
 
   for (Observer* observer : *array) {
     if (observer->Manager() != databaseBackgroundActor) {
       observer->Observe(aDatabase, aDocumentURI, aKey, aOldValue, aNewValue);
@@ -5014,30 +5005,30 @@ void Datastore::NotifyObservers(Database
 }
 
 /*******************************************************************************
  * PreparedDatastore
  ******************************************************************************/
 
 void PreparedDatastore::Destroy() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(gPreparedDatastores);
-  MOZ_DIAGNOSTIC_ASSERT(gPreparedDatastores->Get(mDatastoreId));
+  MOZ_ASSERT(gPreparedDatastores);
+  MOZ_ASSERT(gPreparedDatastores->Get(mDatastoreId));
 
   nsAutoPtr<PreparedDatastore> preparedDatastore;
   gPreparedDatastores->Remove(mDatastoreId, &preparedDatastore);
-  MOZ_DIAGNOSTIC_ASSERT(preparedDatastore);
+  MOZ_ASSERT(preparedDatastore);
 }
 
 // static
 void PreparedDatastore::TimerCallback(nsITimer* aTimer, void* aClosure) {
   AssertIsOnBackgroundThread();
 
   auto* self = static_cast<PreparedDatastore*>(aClosure);
-  MOZ_DIAGNOSTIC_ASSERT(self);
+  MOZ_ASSERT(self);
 
   self->Destroy();
 }
 
 /*******************************************************************************
  * Database
  ******************************************************************************/
 
@@ -5047,64 +5038,64 @@ Database::Database(const PrincipalInfo& 
     : mSnapshot(nullptr),
       mPrincipalInfo(aPrincipalInfo),
       mContentParentId(aContentParentId),
       mOrigin(aOrigin),
       mPrivateBrowsingId(aPrivateBrowsingId),
       mAllowedToClose(false),
       mActorDestroyed(false),
       mRequestedAllowToClose(false)
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
       ,
       mActorWasAlive(false)
 #endif
 {
   AssertIsOnBackgroundThread();
 }
 
 Database::~Database() {
-  MOZ_DIAGNOSTIC_ASSERT_IF(mActorWasAlive, mAllowedToClose);
-  MOZ_DIAGNOSTIC_ASSERT_IF(mActorWasAlive, mActorDestroyed);
+  MOZ_ASSERT_IF(mActorWasAlive, mAllowedToClose);
+  MOZ_ASSERT_IF(mActorWasAlive, mActorDestroyed);
 }
 
 void Database::SetActorAlive(Datastore* aDatastore) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorWasAlive);
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
-
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+  MOZ_ASSERT(!mActorWasAlive);
+  MOZ_ASSERT(!mActorDestroyed);
+
+#ifdef DEBUG
   mActorWasAlive = true;
 #endif
 
   mDatastore = aDatastore;
 
   mDatastore->NoteLiveDatabase(this);
 
   if (!gLiveDatabases) {
     gLiveDatabases = new LiveDatabaseArray();
   }
 
   gLiveDatabases->AppendElement(this);
 }
 
 void Database::RegisterSnapshot(Snapshot* aSnapshot) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aSnapshot);
-  MOZ_DIAGNOSTIC_ASSERT(!mSnapshot);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aSnapshot);
+  MOZ_ASSERT(!mSnapshot);
+  MOZ_ASSERT(!mAllowedToClose);
 
   // Only one snapshot at a time is currently supported.
   mSnapshot = aSnapshot;
 
   mDatastore->NoteActiveDatabase(this);
 }
 
 void Database::UnregisterSnapshot(Snapshot* aSnapshot) {
-  MOZ_DIAGNOSTIC_ASSERT(aSnapshot);
-  MOZ_DIAGNOSTIC_ASSERT(mSnapshot == aSnapshot);
+  MOZ_ASSERT(aSnapshot);
+  MOZ_ASSERT(mSnapshot == aSnapshot);
 
   mSnapshot = nullptr;
 
   mDatastore->NoteInactiveDatabase(this);
 }
 
 void Database::RequestAllowToClose() {
   AssertIsOnBackgroundThread();
@@ -5113,55 +5104,55 @@ void Database::RequestAllowToClose() {
     return;
   }
 
   mRequestedAllowToClose = true;
 
   // Send the RequestAllowToClose message to the child to avoid racing with the
   // child actor. Except the case when the actor was already destroyed.
   if (mActorDestroyed) {
-    MOZ_DIAGNOSTIC_ASSERT(mAllowedToClose);
+    MOZ_ASSERT(mAllowedToClose);
   } else {
     Unused << SendRequestAllowToClose();
   }
 }
 
 void Database::AllowToClose() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
-  MOZ_DIAGNOSTIC_ASSERT(mDatastore);
+  MOZ_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(mDatastore);
 
   mAllowedToClose = true;
 
   mDatastore->NoteFinishedDatabase(this);
 
   mDatastore = nullptr;
 
-  MOZ_DIAGNOSTIC_ASSERT(gLiveDatabases);
+  MOZ_ASSERT(gLiveDatabases);
   gLiveDatabases->RemoveElement(this);
 
   if (gLiveDatabases->IsEmpty()) {
     gLiveDatabases = nullptr;
   }
 }
 
 void Database::ActorDestroy(ActorDestroyReason aWhy) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
+  MOZ_ASSERT(!mActorDestroyed);
 
   mActorDestroyed = true;
 
   if (!mAllowedToClose) {
     AllowToClose();
   }
 }
 
 mozilla::ipc::IPCResult Database::RecvDeleteMe() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
+  MOZ_ASSERT(!mActorDestroyed);
 
   IProtocol* mgr = Manager();
   if (!PBackgroundLSDatabaseParent::Send__delete__(this)) {
     return IPC_FAIL_NO_REASON(mgr);
   }
   return IPC_OK();
 }
 
@@ -5205,20 +5196,20 @@ PBackgroundLSSnapshotParent* Database::A
   return snapshot.forget().take();
 }
 
 mozilla::ipc::IPCResult Database::RecvPBackgroundLSSnapshotConstructor(
     PBackgroundLSSnapshotParent* aActor, const nsString& aDocumentURI,
     const bool& aIncreasePeakUsage, const int64_t& aRequestedSize,
     const int64_t& aMinSize, LSSnapshotInitInfo* aInitInfo) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT_IF(aIncreasePeakUsage, aRequestedSize > 0);
-  MOZ_DIAGNOSTIC_ASSERT_IF(aIncreasePeakUsage, aMinSize > 0);
-  MOZ_DIAGNOSTIC_ASSERT(aInitInfo);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT_IF(aIncreasePeakUsage, aRequestedSize > 0);
+  MOZ_ASSERT_IF(aIncreasePeakUsage, aMinSize > 0);
+  MOZ_ASSERT(aInitInfo);
+  MOZ_ASSERT(!mAllowedToClose);
 
   auto* snapshot = static_cast<Snapshot*>(aActor);
 
   // TODO: This can be optimized depending on which operation triggers snapshot
   //       creation. For example clear() doesn't need to receive items at all.
   nsTHashtable<nsStringHashKey> loadedItems;
   nsTArray<LSItemInfo> itemInfos;
   uint32_t totalLength;
@@ -5244,17 +5235,17 @@ mozilla::ipc::IPCResult Database::RecvPB
   aInitInfo->loadState() = loadState;
 
   return IPC_OK();
 }
 
 bool Database::DeallocPBackgroundLSSnapshotParent(
     PBackgroundLSSnapshotParent* aActor) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
+  MOZ_ASSERT(aActor);
 
   // Transfer ownership back from IPDL.
   RefPtr<Snapshot> actor = dont_AddRef(static_cast<Snapshot*>(aActor));
 
   return true;
 }
 
 /*******************************************************************************
@@ -5271,22 +5262,22 @@ Snapshot::Snapshot(Database* aDatabase, 
       mSavedKeys(false),
       mActorDestroyed(false),
       mFinishReceived(false),
       mLoadedReceived(false),
       mLoadedAllItems(false),
       mLoadKeysReceived(false),
       mSentMarkDirty(false) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
+  MOZ_ASSERT(aDatabase);
 }
 
 Snapshot::~Snapshot() {
-  MOZ_DIAGNOSTIC_ASSERT(mActorDestroyed);
-  MOZ_DIAGNOSTIC_ASSERT(mFinishReceived);
+  MOZ_ASSERT(mActorDestroyed);
+  MOZ_ASSERT(mFinishReceived);
 }
 
 void Snapshot::SaveItem(const nsAString& aKey, const nsAString& aOldValue,
                         bool aAffectsOrder) {
   AssertIsOnBackgroundThread();
 
   MarkDirty();
 
@@ -5311,56 +5302,56 @@ void Snapshot::MarkDirty() {
   if (!mSentMarkDirty) {
     Unused << SendMarkDirty();
     mSentMarkDirty = true;
   }
 }
 
 void Snapshot::Finish() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(mDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(mDatastore);
-  MOZ_DIAGNOSTIC_ASSERT(!mFinishReceived);
+  MOZ_ASSERT(mDatabase);
+  MOZ_ASSERT(mDatastore);
+  MOZ_ASSERT(!mFinishReceived);
 
   mDatastore->BeginUpdateBatch(mUsage);
 
   mDatastore->EndUpdateBatch(mPeakUsage);
 
   mDatabase->UnregisterSnapshot(this);
 
   mFinishReceived = true;
 }
 
 void Snapshot::ActorDestroy(ActorDestroyReason aWhy) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
+  MOZ_ASSERT(!mActorDestroyed);
 
   mActorDestroyed = true;
 
   if (!mFinishReceived) {
     Finish();
   }
 }
 
 mozilla::ipc::IPCResult Snapshot::RecvDeleteMe() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
+  MOZ_ASSERT(!mActorDestroyed);
 
   IProtocol* mgr = Manager();
   if (!PBackgroundLSSnapshotParent::Send__delete__(this)) {
     return IPC_FAIL_NO_REASON(mgr);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult Snapshot::RecvCheckpoint(
     nsTArray<LSWriteInfo>&& aWriteInfos) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(mUsage >= 0);
-  MOZ_DIAGNOSTIC_ASSERT(mPeakUsage >= mUsage);
+  MOZ_ASSERT(mUsage >= 0);
+  MOZ_ASSERT(mPeakUsage >= mUsage);
 
   if (NS_WARN_IF(aWriteInfos.IsEmpty())) {
     ASSERT_UNLESS_FUZZING();
     return IPC_FAIL_NO_REASON(this);
   }
 
   mDatastore->BeginUpdateBatch(mUsage);
 
@@ -5447,18 +5438,18 @@ mozilla::ipc::IPCResult Snapshot::RecvLo
   mLoadKeysReceived = true;
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult Snapshot::RecvLoadItem(const nsString& aKey,
                                                nsString* aValue) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aValue);
-  MOZ_DIAGNOSTIC_ASSERT(mDatastore);
+  MOZ_ASSERT(aValue);
+  MOZ_ASSERT(mDatastore);
 
   if (NS_WARN_IF(mFinishReceived)) {
     ASSERT_UNLESS_FUZZING();
     return IPC_FAIL_NO_REASON(this);
   }
 
   if (NS_WARN_IF(mLoadedReceived)) {
     ASSERT_UNLESS_FUZZING();
@@ -5485,33 +5476,33 @@ mozilla::ipc::IPCResult Snapshot::RecvLo
   if (aValue->IsVoid()) {
     mUnknownItems.PutEntry(aKey);
   } else {
     mLoadedItems.PutEntry(aKey);
 
     if (mLoadedItems.Count() == mTotalLength) {
       mLoadedItems.Clear();
       mUnknownItems.Clear();
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
       for (auto iter = mValues.ConstIter(); !iter.Done(); iter.Next()) {
-        MOZ_DIAGNOSTIC_ASSERT(iter.Data().IsVoid());
+        MOZ_ASSERT(iter.Data().IsVoid());
       }
 #endif
       mValues.Clear();
       mLoadedAllItems = true;
     }
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult Snapshot::RecvLoadKeys(nsTArray<nsString>* aKeys) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aKeys);
-  MOZ_DIAGNOSTIC_ASSERT(mDatastore);
+  MOZ_ASSERT(aKeys);
+  MOZ_ASSERT(mDatastore);
 
   if (NS_WARN_IF(mFinishReceived)) {
     ASSERT_UNLESS_FUZZING();
     return IPC_FAIL_NO_REASON(this);
   }
 
   if (NS_WARN_IF(mLoadedReceived)) {
     ASSERT_UNLESS_FUZZING();
@@ -5532,17 +5523,17 @@ mozilla::ipc::IPCResult Snapshot::RecvLo
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult Snapshot::RecvIncreasePeakUsage(
     const int64_t& aRequestedSize, const int64_t& aMinSize, int64_t* aSize) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aSize);
+  MOZ_ASSERT(aSize);
 
   if (NS_WARN_IF(aRequestedSize <= 0)) {
     ASSERT_UNLESS_FUZZING();
     return IPC_FAIL_NO_REASON(this);
   }
 
   if (NS_WARN_IF(aMinSize <= 0)) {
     ASSERT_UNLESS_FUZZING();
@@ -5576,55 +5567,55 @@ mozilla::ipc::IPCResult Snapshot::RecvPi
  * Observer
  ******************************************************************************/
 
 Observer::Observer(const nsACString& aOrigin)
     : mOrigin(aOrigin), mActorDestroyed(false) {
   AssertIsOnBackgroundThread();
 }
 
-Observer::~Observer() { MOZ_DIAGNOSTIC_ASSERT(mActorDestroyed); }
+Observer::~Observer() { MOZ_ASSERT(mActorDestroyed); }
 
 void Observer::Observe(Database* aDatabase, const nsString& aDocumentURI,
                        const nsString& aKey, const nsString& aOldValue,
                        const nsString& aNewValue) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(aDatabase);
+  MOZ_ASSERT(aDatabase);
 
   Unused << SendObserve(aDatabase->GetPrincipalInfo(),
                         aDatabase->PrivateBrowsingId(), aDocumentURI, aKey,
                         aOldValue, aNewValue);
 }
 
 void Observer::ActorDestroy(ActorDestroyReason aWhy) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
+  MOZ_ASSERT(!mActorDestroyed);
 
   mActorDestroyed = true;
 
-  MOZ_DIAGNOSTIC_ASSERT(gObservers);
+  MOZ_ASSERT(gObservers);
 
   nsTArray<Observer*>* array;
   gObservers->Get(mOrigin, &array);
-  MOZ_DIAGNOSTIC_ASSERT(array);
+  MOZ_ASSERT(array);
 
   array->RemoveElement(this);
 
   if (array->IsEmpty()) {
     gObservers->Remove(mOrigin);
   }
 
   if (!gObservers->Count()) {
     gObservers = nullptr;
   }
 }
 
 mozilla::ipc::IPCResult Observer::RecvDeleteMe() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mActorDestroyed);
+  MOZ_ASSERT(!mActorDestroyed);
 
   IProtocol* mgr = Manager();
   if (!PBackgroundLSObserverParent::Send__delete__(this)) {
     return IPC_FAIL_NO_REASON(mgr);
   }
   return IPC_OK();
 }
 
@@ -5633,19 +5624,18 @@ mozilla::ipc::IPCResult Observer::RecvDe
  ******************************************************************************/
 
 LSRequestBase::LSRequestBase(nsIEventTarget* aMainEventTarget)
     : mMainEventTarget(aMainEventTarget),
       mState(State::Initial),
       mWaitingForFinish(false) {}
 
 LSRequestBase::~LSRequestBase() {
-  MOZ_DIAGNOSTIC_ASSERT_IF(
-      MayProceedOnNonOwningThread(),
-      mState == State::Initial || mState == State::Completed);
+  MOZ_ASSERT_IF(MayProceedOnNonOwningThread(),
+                mState == State::Initial || mState == State::Completed);
 }
 
 void LSRequestBase::Dispatch() {
   AssertIsOnOwningThread();
 
   mState = State::Opening;
 
   MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(this));
@@ -5705,34 +5695,34 @@ void LSRequestBase::LogState() {
       break;
 
     default:;
   }
 }
 
 void LSRequestBase::SendReadyMessage() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingReadyMessage);
+  MOZ_ASSERT(mState == State::SendingReadyMessage);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     MaybeSetFailureCode(NS_ERROR_FAILURE);
   }
 
   nsresult rv = SendReadyMessageInternal();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     MaybeSetFailureCode(rv);
 
     FinishInternal();
   }
 }
 
 nsresult LSRequestBase::SendReadyMessageInternal() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingReadyMessage);
+  MOZ_ASSERT(mState == State::SendingReadyMessage);
 
   if (!MayProceed()) {
     return NS_ERROR_FAILURE;
   }
 
   if (NS_WARN_IF(!SendReady())) {
     return NS_ERROR_FAILURE;
   }
@@ -5741,40 +5731,40 @@ nsresult LSRequestBase::SendReadyMessage
 
   mWaitingForFinish = true;
 
   return NS_OK;
 }
 
 void LSRequestBase::Finish() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::WaitingForFinish);
+  MOZ_ASSERT(mState == State::WaitingForFinish);
 
   mWaitingForFinish = false;
 
   FinishInternal();
 }
 
 void LSRequestBase::FinishInternal() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingReadyMessage ||
-                        mState == State::WaitingForFinish);
+  MOZ_ASSERT(mState == State::SendingReadyMessage ||
+             mState == State::WaitingForFinish);
 
   mState = State::SendingResults;
 
   // This LSRequestBase can only be held alive by the IPDL. Run() can end up
   // with clearing that last reference. So we need to add a self reference here.
   RefPtr<LSRequestBase> kungFuDeathGrip = this;
 
   MOZ_ALWAYS_SUCCEEDS(this->Run());
 }
 
 void LSRequestBase::SendResults() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingResults);
+  MOZ_ASSERT(mState == State::SendingResults);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     MaybeSetFailureCode(NS_ERROR_FAILURE);
   }
 
   if (MayProceed()) {
     LSRequestResponse response;
@@ -5905,106 +5895,103 @@ PrepareDatastoreOp::PrepareDatastoreOp(
       mSizeOfKeys(0),
       mSizeOfItems(0),
       mNestedState(NestedState::BeforeNesting),
       mCreateIfNotExists(aParams.type() ==
                          LSRequestParams::TLSRequestPrepareDatastoreParams),
       mDatabaseNotAvailable(false),
       mRequestedDirectoryLock(false),
       mInvalidated(false)
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
       ,
       mDEBUGUsage(0)
 #endif
 {
-  MOZ_DIAGNOSTIC_ASSERT(
+  MOZ_ASSERT(
       aParams.type() == LSRequestParams::TLSRequestPreloadDatastoreParams ||
       aParams.type() == LSRequestParams::TLSRequestPrepareDatastoreParams);
 }
 
 PrepareDatastoreOp::~PrepareDatastoreOp() {
-  MOZ_DIAGNOSTIC_ASSERT(!mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT_IF(
-      MayProceedOnNonOwningThread(),
-      mState == State::Initial || mState == State::Completed);
-  MOZ_DIAGNOSTIC_ASSERT(!mLoadDataOp);
+  MOZ_ASSERT(!mDirectoryLock);
+  MOZ_ASSERT_IF(MayProceedOnNonOwningThread(),
+                mState == State::Initial || mState == State::Completed);
+  MOZ_ASSERT(!mLoadDataOp);
 }
 
 nsresult PrepareDatastoreOp::Open() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Opening);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::BeforeNesting);
+  MOZ_ASSERT(mState == State::Opening);
+  MOZ_ASSERT(mNestedState == NestedState::BeforeNesting);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceedOnNonOwningThread()) {
     return NS_ERROR_FAILURE;
   }
 
   const PrincipalInfo& principalInfo = mParams.principalInfo();
 
   if (principalInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
     QuotaManager::GetInfoForChrome(&mSuffix, &mGroup, &mOrigin);
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(principalInfo.type() ==
-                          PrincipalInfo::TContentPrincipalInfo);
+    MOZ_ASSERT(principalInfo.type() == PrincipalInfo::TContentPrincipalInfo);
 
     QuotaManager::GetInfoFromValidatedPrincipalInfo(
         principalInfo, &mSuffix, &mGroup, &mMainThreadOrigin);
   }
 
   mState = State::Nesting;
   mNestedState = NestedState::CheckExistingOperations;
 
   MOZ_ALWAYS_SUCCEEDS(OwningEventTarget()->Dispatch(this, NS_DISPATCH_NORMAL));
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::CheckExistingOperations() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::CheckExistingOperations);
-  MOZ_DIAGNOSTIC_ASSERT(gPrepareDatastoreOps);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::CheckExistingOperations);
+  MOZ_ASSERT(gPrepareDatastoreOps);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     return NS_ERROR_FAILURE;
   }
 
   const PrincipalInfo& principalInfo = mParams.principalInfo();
 
   nsCString originAttrSuffix;
   uint32_t privateBrowsingId;
 
   if (principalInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
     privateBrowsingId = 0;
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(principalInfo.type() ==
-                          PrincipalInfo::TContentPrincipalInfo);
+    MOZ_ASSERT(principalInfo.type() == PrincipalInfo::TContentPrincipalInfo);
 
     const ContentPrincipalInfo& info = principalInfo.get_ContentPrincipalInfo();
     const OriginAttributes& attrs = info.attrs();
     attrs.CreateSuffix(originAttrSuffix);
 
     privateBrowsingId = attrs.mPrivateBrowsingId;
   }
 
   mArchivedOriginScope = ArchivedOriginScope::CreateFromOrigin(
       originAttrSuffix, mParams.originKey());
-  MOZ_DIAGNOSTIC_ASSERT(mArchivedOriginScope);
+  MOZ_ASSERT(mArchivedOriginScope);
 
   // Normally it's safe to access member variables without a mutex because even
   // though we hop between threads, the variables are never accessed by multiple
   // threads at the same time.
   // However, the methods OriginIsKnown and Origin can be called at any time.
   // So we have to make sure the member variable is set on the same thread as
   // those methods are called.
   mOrigin = mMainThreadOrigin;
 
-  MOZ_DIAGNOSTIC_ASSERT(!mOrigin.IsEmpty());
+  MOZ_ASSERT(!mOrigin.IsEmpty());
 
   mPrivateBrowsingId = privateBrowsingId;
 
   mNestedState = NestedState::CheckClosingDatastore;
 
   // See if this PrepareDatastoreOp needs to wait.
   bool foundThis = false;
   for (uint32_t index = gPrepareDatastoreOps->Length(); index > 0; index--) {
@@ -6012,55 +5999,55 @@ nsresult PrepareDatastoreOp::CheckExisti
 
     if (existingOp == this) {
       foundThis = true;
       continue;
     }
 
     if (foundThis && existingOp->Origin() == mOrigin) {
       // Only one op can be delayed.
-      MOZ_DIAGNOSTIC_ASSERT(!existingOp->mDelayedOp);
+      MOZ_ASSERT(!existingOp->mDelayedOp);
       existingOp->mDelayedOp = this;
 
       return NS_OK;
     }
   }
 
   nsresult rv = CheckClosingDatastoreInternal();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::CheckClosingDatastore() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::CheckClosingDatastore);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::CheckClosingDatastore);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = CheckClosingDatastoreInternal();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::CheckClosingDatastoreInternal() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::CheckClosingDatastore);
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
-  MOZ_DIAGNOSTIC_ASSERT(MayProceed());
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::CheckClosingDatastore);
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(MayProceed());
 
   mNestedState = NestedState::PreparationPending;
 
   RefPtr<Datastore> datastore;
   if (gDatastores && (datastore = gDatastores->Get(mOrigin)) &&
       datastore->IsClosed()) {
     datastore->WaitForConnectionToComplete(this);
 
@@ -6072,41 +6059,41 @@ nsresult PrepareDatastoreOp::CheckClosin
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::BeginDatastorePreparation() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::PreparationPending);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::PreparationPending);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = BeginDatastorePreparationInternal();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::BeginDatastorePreparationInternal() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::PreparationPending);
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
-  MOZ_DIAGNOSTIC_ASSERT(MayProceed());
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::PreparationPending);
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(MayProceed());
 
   if (gDatastores && (mDatastore = gDatastores->Get(mOrigin))) {
-    MOZ_DIAGNOSTIC_ASSERT(!mDatastore->IsClosed());
+    MOZ_ASSERT(!mDatastore->IsClosed());
 
     mDatastore->NoteLivePrepareDatastoreOp(this);
 
     FinishNesting();
 
     return NS_OK;
   }
 
@@ -6122,18 +6109,18 @@ nsresult PrepareDatastoreOp::BeginDatast
   mNestedState = NestedState::QuotaManagerPending;
   QuotaManager::GetOrCreate(this, mMainEventTarget);
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::QuotaManagerOpen() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::QuotaManagerPending);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::QuotaManagerPending);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     return NS_ERROR_FAILURE;
   }
 
   if (NS_WARN_IF(!QuotaManager::Get())) {
     return NS_ERROR_FAILURE;
@@ -6144,48 +6131,48 @@ nsresult PrepareDatastoreOp::QuotaManage
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::OpenDirectory() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::PreparationPending ||
-                        mNestedState == NestedState::QuotaManagerPending);
-  MOZ_DIAGNOSTIC_ASSERT(!mOrigin.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(!mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
-  MOZ_DIAGNOSTIC_ASSERT(MayProceed());
-  MOZ_DIAGNOSTIC_ASSERT(QuotaManager::Get());
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::PreparationPending ||
+             mNestedState == NestedState::QuotaManagerPending);
+  MOZ_ASSERT(!mOrigin.IsEmpty());
+  MOZ_ASSERT(!mDirectoryLock);
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(MayProceed());
+  MOZ_ASSERT(QuotaManager::Get());
 
   mNestedState = NestedState::DirectoryOpenPending;
   RefPtr<DirectoryLock> pendingDirectoryLock =
       QuotaManager::Get()->CreateDirectoryLock(PERSISTENCE_TYPE_DEFAULT, mGroup,
                                                mOrigin,
                                                mozilla::dom::quota::Client::LS,
                                                /* aExclusive */ false, this);
-  MOZ_DIAGNOSTIC_ASSERT(pendingDirectoryLock);
+  MOZ_ASSERT(pendingDirectoryLock);
 
   if (mNestedState == NestedState::DirectoryOpenPending) {
     mPendingDirectoryLock = pendingDirectoryLock.forget();
   }
 
   mRequestedDirectoryLock = true;
 
   return NS_OK;
 }
 
 void PrepareDatastoreOp::SendToIOThread() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
-  MOZ_DIAGNOSTIC_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
-  MOZ_DIAGNOSTIC_ASSERT(MayProceed());
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
+  MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
+  MOZ_ASSERT(MayProceed());
 
   // Skip all disk related stuff and transition to SendingReadyMessage if we
   // are preparing a datastore for private browsing.
   // Note that we do use a directory lock for private browsing even though we
   // don't do any stuff on disk. The thing is that without a directory lock,
   // quota manager wouldn't call AbortOperations for our private browsing
   // origin when a clear origin operation is requested. AbortOperations
   // requests all databases to close and the datastore is destroyed in the end.
@@ -6193,47 +6180,47 @@ void PrepareDatastoreOp::SendToIOThread(
   // (empty) datastore.
   if (mPrivateBrowsingId) {
     FinishNesting();
 
     return;
   }
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   // Must set this before dispatching otherwise we will race with the IO thread.
   mNestedState = NestedState::DatabaseWorkOpen;
 
   MOZ_ALWAYS_SUCCEEDS(
       quotaManager->IOThread()->Dispatch(this, NS_DISPATCH_NORMAL));
 }
 
 nsresult PrepareDatastoreOp::DatabaseWork() {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(mArchivedOriginScope);
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::DatabaseWorkOpen);
+  MOZ_ASSERT(mArchivedOriginScope);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::DatabaseWorkOpen);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) ||
       !MayProceedOnNonOwningThread()) {
     return NS_ERROR_FAILURE;
   }
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   nsresult rv;
 
   if (!gArchivedOrigins) {
     rv = LoadArchivedOrigins();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
-    MOZ_DIAGNOSTIC_ASSERT(gArchivedOrigins);
+    MOZ_ASSERT(gArchivedOrigins);
   }
 
   bool hasDataForMigration = mArchivedOriginScope->HasMatches(gArchivedOrigins);
 
   bool createIfNotExists = mCreateIfNotExists || hasDataForMigration;
 
   nsCOMPtr<nsIFile> directoryEntry;
   rv = quotaManager->EnsureOriginIsInitialized(
@@ -6276,25 +6263,21 @@ nsresult PrepareDatastoreOp::DatabaseWor
   if (rv == NS_ERROR_NOT_AVAILABLE) {
     return DatabaseNotAvailable();
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (alreadyExisted) {
-    MOZ_DIAGNOSTIC_ASSERT(gUsages);
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-    bool hasUsage = gUsages->Get(mOrigin, &mUsage);
-    MOZ_DIAGNOSTIC_ASSERT(hasUsage);
-#else
-    gUsages->Get(mOrigin, &mUsage);
-#endif
+    MOZ_ASSERT(gUsages);
+    DebugOnly<bool> hasUsage = gUsages->Get(mOrigin, &mUsage);
+    MOZ_ASSERT(hasUsage);
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(mUsage == 0);
+    MOZ_ASSERT(mUsage == 0);
     InitUsageForOrigin(mOrigin, mUsage);
   }
 
   rv = directoryEntry->GetPath(mDatabaseFilePath);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -6322,31 +6305,31 @@ nsresult PrepareDatastoreOp::DatabaseWor
   }
 
   rv = VerifyDatabaseInformation(connection);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (hasDataForMigration) {
-    MOZ_DIAGNOSTIC_ASSERT(mUsage == 0);
+    MOZ_ASSERT(mUsage == 0);
 
     rv = AttachArchiveDatabase(quotaManager->GetStoragePath(), connection);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     int64_t newUsage;
     rv = GetUsage(connection, mArchivedOriginScope, &newUsage);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     RefPtr<QuotaObject> quotaObject = GetQuotaObject();
-    MOZ_DIAGNOSTIC_ASSERT(quotaObject);
+    MOZ_ASSERT(quotaObject);
 
     if (!quotaObject->MaybeUpdateSize(newUsage, /* aTruncate */ true)) {
       return NS_ERROR_FILE_NO_DEVICE_SPACE;
     }
 
     mozStorageTransaction transaction(
         connection, false, mozIStorageConnection::TRANSACTION_IMMEDIATE);
 
@@ -6415,24 +6398,24 @@ nsresult PrepareDatastoreOp::DatabaseWor
       return rv;
     }
 
     rv = DetachArchiveDatabase(connection);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(gArchivedOrigins);
-    MOZ_DIAGNOSTIC_ASSERT(mArchivedOriginScope->HasMatches(gArchivedOrigins));
+    MOZ_ASSERT(gArchivedOrigins);
+    MOZ_ASSERT(mArchivedOriginScope->HasMatches(gArchivedOrigins));
     mArchivedOriginScope->RemoveMatches(gArchivedOrigins);
 
     mUsage = newUsage;
 
-    MOZ_DIAGNOSTIC_ASSERT(gUsages);
-    MOZ_DIAGNOSTIC_ASSERT(gUsages->Contains(mOrigin));
+    MOZ_ASSERT(gUsages);
+    MOZ_ASSERT(gUsages->Contains(mOrigin));
     gUsages->Put(mOrigin, newUsage);
   }
 
   nsCOMPtr<mozIStorageConnection> shadowConnection;
   if (!gInitializedShadowStorage) {
     rv = CreateShadowStorageConnection(quotaManager->GetBasePath(),
                                        getter_AddRefs(shadowConnection));
     if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -6459,35 +6442,35 @@ nsresult PrepareDatastoreOp::DatabaseWor
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::DatabaseNotAvailable() {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::DatabaseWorkOpen);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::DatabaseWorkOpen);
 
   mDatabaseNotAvailable = true;
 
   nsresult rv = FinishNestingOnNonOwningThread();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::EnsureDirectoryEntry(nsIFile* aEntry,
                                                   bool aCreateIfNotExists,
                                                   bool aIsDirectory,
                                                   bool* aAlreadyExisted) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aEntry);
+  MOZ_ASSERT(aEntry);
 
   bool exists;
   nsresult rv = aEntry->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (!exists) {
@@ -6497,34 +6480,34 @@ nsresult PrepareDatastoreOp::EnsureDirec
 
     if (aIsDirectory) {
       rv = aEntry->Create(nsIFile::DIRECTORY_TYPE, 0755);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
   }
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   else {
     bool isDirectory;
-    MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(aEntry->IsDirectory(&isDirectory)));
-    MOZ_DIAGNOSTIC_ASSERT(isDirectory == aIsDirectory);
+    MOZ_ASSERT(NS_SUCCEEDED(aEntry->IsDirectory(&isDirectory)));
+    MOZ_ASSERT(isDirectory == aIsDirectory);
   }
 #endif
 
   if (aAlreadyExisted) {
     *aAlreadyExisted = exists;
   }
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::VerifyDatabaseInformation(
     mozIStorageConnection* aConnection) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
+  MOZ_ASSERT(aConnection);
 
   nsCOMPtr<mozIStorageStatement> stmt;
   nsresult rv =
       aConnection->CreateStatement(NS_LITERAL_CSTRING("SELECT origin "
                                                       "FROM database"),
                                    getter_AddRefs(stmt));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -6550,48 +6533,48 @@ nsresult PrepareDatastoreOp::VerifyDatab
     return NS_ERROR_FILE_CORRUPTED;
   }
 
   return NS_OK;
 }
 
 already_AddRefed<QuotaObject> PrepareDatastoreOp::GetQuotaObject() {
   MOZ_ASSERT(IsOnOwningThread() || IsOnIOThread());
-  MOZ_DIAGNOSTIC_ASSERT(!mGroup.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(!mOrigin.IsEmpty());
-  MOZ_DIAGNOSTIC_ASSERT(!mDatabaseFilePath.IsEmpty());
+  MOZ_ASSERT(!mGroup.IsEmpty());
+  MOZ_ASSERT(!mOrigin.IsEmpty());
+  MOZ_ASSERT(!mDatabaseFilePath.IsEmpty());
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   RefPtr<QuotaObject> quotaObject = quotaManager->GetQuotaObject(
       PERSISTENCE_TYPE_DEFAULT, mGroup, mOrigin, mDatabaseFilePath, mUsage);
-  MOZ_DIAGNOSTIC_ASSERT(quotaObject);
+  MOZ_ASSERT(quotaObject);
 
   return quotaObject.forget();
 }
 
 nsresult PrepareDatastoreOp::BeginLoadData() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::BeginLoadData);
-  MOZ_DIAGNOSTIC_ASSERT(!mConnection);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::BeginLoadData);
+  MOZ_ASSERT(!mConnection);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     return NS_ERROR_FAILURE;
   }
 
   if (!gConnectionThread) {
     gConnectionThread = new ConnectionThread();
   }
 
   mConnection = gConnectionThread->CreateConnection(
       mOrigin, mDirectoryPath, std::move(mArchivedOriginScope));
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(mConnection);
 
   // Must set this before dispatching otherwise we will race with the
   // connection thread.
   mNestedState = NestedState::DatabaseWorkLoadData;
 
   // Can't assign to mLoadDataOp directly since that's a weak reference and
   // LoadDataOp is reference counted.
   RefPtr<LoadDataOp> loadDataOp = new LoadDataOp(this);
@@ -6603,30 +6586,30 @@ nsresult PrepareDatastoreOp::BeginLoadDa
   // destroyed.
   mLoadDataOp = loadDataOp;
 
   return NS_OK;
 }
 
 void PrepareDatastoreOp::FinishNesting() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mState == State::Nesting);
 
   // The caller holds a strong reference to us, no need for a self reference
   // before calling Run().
 
   mState = State::SendingReadyMessage;
   mNestedState = NestedState::AfterNesting;
 
   MOZ_ALWAYS_SUCCEEDS(Run());
 }
 
 nsresult PrepareDatastoreOp::FinishNestingOnNonOwningThread() {
   MOZ_ASSERT(!IsOnOwningThread());
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mState == State::Nesting);
 
   // Must set mState before dispatching otherwise we will race with the owning
   // thread.
   mState = State::SendingReadyMessage;
   mNestedState = NestedState::AfterNesting;
 
   nsresult rv = OwningEventTarget()->Dispatch(this, NS_DISPATCH_NORMAL);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -6674,51 +6657,51 @@ nsresult PrepareDatastoreOp::NestedRun()
     return rv;
   }
 
   return NS_OK;
 }
 
 void PrepareDatastoreOp::GetResponse(LSRequestResponse& aResponse) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingResults);
-  MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(ResultCode()));
+  MOZ_ASSERT(mState == State::SendingResults);
+  MOZ_ASSERT(NS_SUCCEEDED(ResultCode()));
 
   if (mDatabaseNotAvailable) {
-    MOZ_DIAGNOSTIC_ASSERT(!mCreateIfNotExists);
+    MOZ_ASSERT(!mCreateIfNotExists);
 
     LSRequestPreloadDatastoreResponse preloadDatastoreResponse;
 
     aResponse = preloadDatastoreResponse;
 
     return;
   }
 
   if (!mDatastore) {
-    MOZ_DIAGNOSTIC_ASSERT(mUsage == mDEBUGUsage);
+    MOZ_ASSERT(mUsage == mDEBUGUsage);
 
     RefPtr<QuotaObject> quotaObject;
 
     if (mPrivateBrowsingId == 0) {
       quotaObject = GetQuotaObject();
-      MOZ_DIAGNOSTIC_ASSERT(quotaObject);
+      MOZ_ASSERT(quotaObject);
     }
 
     mDatastore = new Datastore(mOrigin, mPrivateBrowsingId, mUsage, mSizeOfKeys,
                                mSizeOfItems, mDirectoryLock.forget(),
                                mConnection.forget(), quotaObject.forget(),
                                mValues, mOrderedItems);
 
     mDatastore->NoteLivePrepareDatastoreOp(this);
 
     if (!gDatastores) {
       gDatastores = new DatastoreHashtable();
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(!gDatastores->Get(mOrigin));
+    MOZ_ASSERT(!gDatastores->Get(mOrigin));
     gDatastores->Put(mOrigin, mDatastore);
   }
 
   uint64_t datastoreId = ++gLastDatastoreId;
 
   nsAutoPtr<PreparedDatastore> preparedDatastore(
       new PreparedDatastore(mDatastore, mContentParentId, mOrigin, datastoreId,
                             /* aForPreload */ !mCreateIfNotExists));
@@ -6745,82 +6728,82 @@ void PrepareDatastoreOp::GetResponse(LSR
     aResponse = preloadDatastoreResponse;
   }
 }
 
 void PrepareDatastoreOp::Cleanup() {
   AssertIsOnOwningThread();
 
   if (mDatastore) {
-    MOZ_DIAGNOSTIC_ASSERT(!mDirectoryLock);
-    MOZ_DIAGNOSTIC_ASSERT(!mConnection);
+    MOZ_ASSERT(!mDirectoryLock);
+    MOZ_ASSERT(!mConnection);
 
     if (NS_FAILED(ResultCode())) {
-      MOZ_DIAGNOSTIC_ASSERT(!mDatastore->IsClosed());
-      MOZ_DIAGNOSTIC_ASSERT(!mDatastore->HasLiveDatabases());
-      MOZ_DIAGNOSTIC_ASSERT(!mDatastore->HasLivePreparedDatastores());
+      MOZ_ASSERT(!mDatastore->IsClosed());
+      MOZ_ASSERT(!mDatastore->HasLiveDatabases());
+      MOZ_ASSERT(!mDatastore->HasLivePreparedDatastores());
       mDatastore->Close();
     }
 
     // Make sure to release the datastore on this thread.
 
     mDatastore->NoteFinishedPrepareDatastoreOp(this);
 
     mDatastore = nullptr;
 
     CleanupMetadata();
   } else if (mConnection) {
     // If we have a connection then the operation must have failed and there
     // must be a directory lock too.
-    MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(ResultCode()));
-    MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
+    MOZ_ASSERT(NS_FAILED(ResultCode()));
+    MOZ_ASSERT(mDirectoryLock);
 
     // We must close the connection on the connection thread before releasing
     // it on this thread. The directory lock can't be released either.
     nsCOMPtr<nsIRunnable> callback =
         NewRunnableMethod("dom::OpenDatabaseOp::ConnectionClosedCallback", this,
                           &PrepareDatastoreOp::ConnectionClosedCallback);
 
     mConnection->Close(callback);
   } else {
     // If we don't have a connection, but we do have a directory lock then the
     // operation must have failed or we were preloading a datastore and there
     // was no physical database on disk.
-    MOZ_DIAGNOSTIC_ASSERT_IF(mDirectoryLock,
-                             NS_FAILED(ResultCode()) || mDatabaseNotAvailable);
+    MOZ_ASSERT_IF(mDirectoryLock,
+                  NS_FAILED(ResultCode()) || mDatabaseNotAvailable);
 
     // There's no connection, so it's safe to release the directory lock and
     // unregister itself from the array.
 
     mDirectoryLock = nullptr;
 
     CleanupMetadata();
   }
 }
 
 void PrepareDatastoreOp::ConnectionClosedCallback() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(ResultCode()));
-  MOZ_DIAGNOSTIC_ASSERT(mDirectoryLock);
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
+  MOZ_ASSERT(NS_FAILED(ResultCode()));
+  MOZ_ASSERT(mDirectoryLock);
+  MOZ_ASSERT(mConnection);
 
   mConnection = nullptr;
   mDirectoryLock = nullptr;
 
   CleanupMetadata();
 }
 
 void PrepareDatastoreOp::CleanupMetadata() {
   AssertIsOnOwningThread();
 
   if (mDelayedOp) {
     MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(mDelayedOp.forget()));
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(gPrepareDatastoreOps);
+  MOZ_ASSERT(gPrepareDatastoreOps);
   gPrepareDatastoreOps->RemoveElement(this);
 
   if (gPrepareDatastoreOps->IsEmpty()) {
     gPrepareDatastoreOps = nullptr;
   }
 }
 
 void PrepareDatastoreOp::LogNestedState() {
@@ -6889,17 +6872,17 @@ void PrepareDatastoreOp::LogNestedState(
           break;
         }
       }
 
       break;
     }
 
     case NestedState::DirectoryOpenPending: {
-      MOZ_DIAGNOSTIC_ASSERT(mPendingDirectoryLock);
+      MOZ_ASSERT(mPendingDirectoryLock);
 
       LS_LOG(("  mPendingDirectoryLock: [%p]", mPendingDirectoryLock.get()));
 
       mPendingDirectoryLock->LogState();
 
       break;
     }
 
@@ -6916,19 +6899,19 @@ void PrepareDatastoreOp::ActorDestroy(Ac
 
   if (mLoadDataOp) {
     mLoadDataOp->NoteComplete();
   }
 }
 
 void PrepareDatastoreOp::DirectoryLockAcquired(DirectoryLock* aLock) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
-  MOZ_DIAGNOSTIC_ASSERT(!mDirectoryLock);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
+  MOZ_ASSERT(!mDirectoryLock);
 
   mPendingDirectoryLock = nullptr;
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     MaybeSetFailureCode(NS_ERROR_FAILURE);
 
     FinishNesting();
@@ -6938,34 +6921,34 @@ void PrepareDatastoreOp::DirectoryLockAc
 
   mDirectoryLock = aLock;
 
   SendToIOThread();
 }
 
 void PrepareDatastoreOp::DirectoryLockFailed() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
-  MOZ_DIAGNOSTIC_ASSERT(!mDirectoryLock);
+  MOZ_ASSERT(mState == State::Nesting);
+  MOZ_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
+  MOZ_ASSERT(!mDirectoryLock);
 
   mPendingDirectoryLock = nullptr;
 
   MaybeSetFailureCode(NS_ERROR_FAILURE);
 
   FinishNesting();
 }
 
 nsresult PrepareDatastoreOp::LoadDataOp::DoDatastoreWork() {
   AssertIsOnConnectionThread();
-  MOZ_DIAGNOSTIC_ASSERT(mConnection);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mNestedState ==
-                        NestedState::DatabaseWorkLoadData);
+  MOZ_ASSERT(mConnection);
+  MOZ_ASSERT(mPrepareDatastoreOp);
+  MOZ_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
+  MOZ_ASSERT(mPrepareDatastoreOp->mNestedState ==
+             NestedState::DatabaseWorkLoadData);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) ||
       !MayProceedOnNonOwningThread()) {
     return NS_ERROR_FAILURE;
   }
 
   Connection::CachedStatement stmt;
   nsresult rv =
@@ -6991,105 +6974,104 @@ nsresult PrepareDatastoreOp::LoadDataOp:
     }
 
     mPrepareDatastoreOp->mValues.Put(key, value);
     auto item = mPrepareDatastoreOp->mOrderedItems.AppendElement();
     item->key() = key;
     item->value() = value;
     mPrepareDatastoreOp->mSizeOfKeys += key.Length();
     mPrepareDatastoreOp->mSizeOfItems += key.Length() + value.Length();
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
     mPrepareDatastoreOp->mDEBUGUsage += key.Length() + value.Length();
 #endif
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 void PrepareDatastoreOp::LoadDataOp::OnSuccess() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mNestedState ==
-                        NestedState::DatabaseWorkLoadData);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mLoadDataOp == this);
+  MOZ_ASSERT(mPrepareDatastoreOp);
+  MOZ_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
+  MOZ_ASSERT(mPrepareDatastoreOp->mNestedState ==
+             NestedState::DatabaseWorkLoadData);
+  MOZ_ASSERT(mPrepareDatastoreOp->mLoadDataOp == this);
 
   mPrepareDatastoreOp->FinishNesting();
 }
 
 void PrepareDatastoreOp::LoadDataOp::OnFailure(nsresult aResultCode) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mNestedState ==
-                        NestedState::DatabaseWorkLoadData);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mLoadDataOp == this);
+  MOZ_ASSERT(mPrepareDatastoreOp);
+  MOZ_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
+  MOZ_ASSERT(mPrepareDatastoreOp->mNestedState ==
+             NestedState::DatabaseWorkLoadData);
+  MOZ_ASSERT(mPrepareDatastoreOp->mLoadDataOp == this);
 
   mPrepareDatastoreOp->SetFailureCode(aResultCode);
 
   mPrepareDatastoreOp->FinishNesting();
 }
 
 void PrepareDatastoreOp::LoadDataOp::Cleanup() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp);
-  MOZ_DIAGNOSTIC_ASSERT(mPrepareDatastoreOp->mLoadDataOp == this);
+  MOZ_ASSERT(mPrepareDatastoreOp);
+  MOZ_ASSERT(mPrepareDatastoreOp->mLoadDataOp == this);
 
   mPrepareDatastoreOp->mLoadDataOp = nullptr;
   mPrepareDatastoreOp = nullptr;
 
   ConnectionDatastoreOperationBase::Cleanup();
 }
 
 /*******************************************************************************
  * PrepareObserverOp
  ******************************************************************************/
 
 PrepareObserverOp::PrepareObserverOp(nsIEventTarget* aMainEventTarget,
                                      const LSRequestParams& aParams)
     : LSRequestBase(aMainEventTarget),
       mParams(aParams.get_LSRequestPrepareObserverParams()) {
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() ==
-                        LSRequestParams::TLSRequestPrepareObserverParams);
+  MOZ_ASSERT(aParams.type() ==
+             LSRequestParams::TLSRequestPrepareObserverParams);
 }
 
 nsresult PrepareObserverOp::Open() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Opening);
+  MOZ_ASSERT(mState == State::Opening);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceedOnNonOwningThread()) {
     return NS_ERROR_FAILURE;
   }
 
   const PrincipalInfo& principalInfo = mParams.principalInfo();
 
   if (principalInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
     QuotaManager::GetInfoForChrome(nullptr, nullptr, &mOrigin);
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(principalInfo.type() ==
-                          PrincipalInfo::TContentPrincipalInfo);
+    MOZ_ASSERT(principalInfo.type() == PrincipalInfo::TContentPrincipalInfo);
 
     QuotaManager::GetInfoFromValidatedPrincipalInfo(principalInfo, nullptr,
                                                     nullptr, &mOrigin);
   }
 
   mState = State::SendingReadyMessage;
   MOZ_ALWAYS_SUCCEEDS(OwningEventTarget()->Dispatch(this, NS_DISPATCH_NORMAL));
 
   return NS_OK;
 }
 
 void PrepareObserverOp::GetResponse(LSRequestResponse& aResponse) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingResults);
-  MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(ResultCode()));
+  MOZ_ASSERT(mState == State::SendingResults);
+  MOZ_ASSERT(NS_SUCCEEDED(ResultCode()));
 
   uint64_t observerId = ++gLastObserverId;
 
   RefPtr<Observer> observer = new Observer(mOrigin);
 
   if (!gPreparedObsevers) {
     gPreparedObsevers = new PreparedObserverHashtable();
   }
@@ -7104,32 +7086,31 @@ void PrepareObserverOp::GetResponse(LSRe
 /*******************************************************************************
 + * LSSimpleRequestBase
 +
 ******************************************************************************/
 
 LSSimpleRequestBase::LSSimpleRequestBase() : mState(State::Initial) {}
 
 LSSimpleRequestBase::~LSSimpleRequestBase() {
-  MOZ_DIAGNOSTIC_ASSERT_IF(
-      MayProceedOnNonOwningThread(),
-      mState == State::Initial || mState == State::Completed);
+  MOZ_ASSERT_IF(MayProceedOnNonOwningThread(),
+                mState == State::Initial || mState == State::Completed);
 }
 
 void LSSimpleRequestBase::Dispatch() {
   AssertIsOnOwningThread();
 
   mState = State::Opening;
 
   MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(this));
 }
 
 void LSSimpleRequestBase::SendResults() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingResults);
+  MOZ_ASSERT(mState == State::SendingResults);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
     MaybeSetFailureCode(NS_ERROR_FAILURE);
   }
 
   if (MayProceed()) {
     LSSimpleRequestResponse response;
@@ -7188,51 +7169,50 @@ void LSSimpleRequestBase::ActorDestroy(A
 }
 
 /*******************************************************************************
  * PreloadedOp
  ******************************************************************************/
 
 PreloadedOp::PreloadedOp(const LSSimpleRequestParams& aParams)
     : mParams(aParams.get_LSSimpleRequestPreloadedParams()) {
-  MOZ_DIAGNOSTIC_ASSERT(aParams.type() ==
-                        LSSimpleRequestParams::TLSSimpleRequestPreloadedParams);
+  MOZ_ASSERT(aParams.type() ==
+             LSSimpleRequestParams::TLSSimpleRequestPreloadedParams);
 }
 
 nsresult PreloadedOp::Open() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Opening);
+  MOZ_ASSERT(mState == State::Opening);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceedOnNonOwningThread()) {
     return NS_ERROR_FAILURE;
   }
 
   const PrincipalInfo& principalInfo = mParams.principalInfo();
 
   if (principalInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
     QuotaManager::GetInfoForChrome(nullptr, nullptr, &mOrigin);
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(principalInfo.type() ==
-                          PrincipalInfo::TContentPrincipalInfo);
+    MOZ_ASSERT(principalInfo.type() == PrincipalInfo::TContentPrincipalInfo);
 
     QuotaManager::GetInfoFromValidatedPrincipalInfo(principalInfo, nullptr,
                                                     nullptr, &mOrigin);
   }
 
   mState = State::SendingResults;
   MOZ_ALWAYS_SUCCEEDS(OwningEventTarget()->Dispatch(this, NS_DISPATCH_NORMAL));
 
   return NS_OK;
 }
 
 void PreloadedOp::GetResponse(LSSimpleRequestResponse& aResponse) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::SendingResults);
-  MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(ResultCode()));
+  MOZ_ASSERT(mState == State::SendingResults);
+  MOZ_ASSERT(NS_SUCCEEDED(ResultCode()));
 
   bool preloaded;
   RefPtr<Datastore> datastore;
   if (gDatastores && (datastore = gDatastores->Get(mOrigin)) &&
       !datastore->IsClosed()) {
     preloaded = true;
   } else {
     preloaded = false;
@@ -7298,17 +7278,17 @@ void ArchivedOriginScope::GetBindingClau
   };
 
   mData.match(Matcher(&aBindingClause));
 }
 
 nsresult ArchivedOriginScope::BindToStatement(
     mozIStorageStatement* aStmt) const {
   MOZ_ASSERT(IsOnIOThread() || IsOnConnectionThread());
-  MOZ_DIAGNOSTIC_ASSERT(aStmt);
+  MOZ_ASSERT(aStmt);
 
   struct Matcher {
     mozIStorageStatement* mStmt;
 
     explicit Matcher(mozIStorageStatement* aStmt) : mStmt(aStmt) {}
 
     nsresult operator()(const Origin& aOrigin) {
       nsresult rv = mStmt->BindUTF8StringByName(NS_LITERAL_CSTRING("originKey"),
@@ -7356,17 +7336,17 @@ nsresult ArchivedOriginScope::BindToStat
   }
 
   return NS_OK;
 }
 
 bool ArchivedOriginScope::HasMatches(
     ArchivedOriginHashtable* aHashtable) const {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aHashtable);
+  MOZ_ASSERT(aHashtable);
 
   struct Matcher {
     ArchivedOriginHashtable* mHashtable;
 
     explicit Matcher(ArchivedOriginHashtable* aHashtable)
         : mHashtable(aHashtable) {}
 
     bool operator()(const Origin& aOrigin) {
@@ -7406,17 +7386,17 @@ bool ArchivedOriginScope::HasMatches(
   };
 
   return mData.match(Matcher(aHashtable));
 }
 
 void ArchivedOriginScope::RemoveMatches(
     ArchivedOriginHashtable* aHashtable) const {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aHashtable);
+  MOZ_ASSERT(aHashtable);
 
   struct Matcher {
     ArchivedOriginHashtable* mHashtable;
 
     explicit Matcher(ArchivedOriginHashtable* aHashtable)
         : mHashtable(aHashtable) {}
 
     void operator()(const Origin& aOrigin) {
@@ -7458,24 +7438,24 @@ void ArchivedOriginScope::RemoveMatches(
  ******************************************************************************/
 
 QuotaClient* QuotaClient::sInstance = nullptr;
 
 QuotaClient::QuotaClient()
     : mShadowDatabaseMutex("LocalStorage mShadowDatabaseMutex"),
       mShutdownRequested(false) {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!sInstance, "We expect this to be a singleton!");
+  MOZ_ASSERT(!sInstance, "We expect this to be a singleton!");
 
   sInstance = this;
 }
 
 QuotaClient::~QuotaClient() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(sInstance == this, "We expect this to be a singleton!");
+  MOZ_ASSERT(sInstance == this, "We expect this to be a singleton!");
 
   sInstance = nullptr;
 }
 
 // static
 nsresult QuotaClient::Initialize() {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -7492,46 +7472,46 @@ mozilla::dom::quota::Client::Type QuotaC
 }
 
 nsresult QuotaClient::InitOrigin(PersistenceType aPersistenceType,
                                  const nsACString& aGroup,
                                  const nsACString& aOrigin,
                                  const AtomicBool& aCanceled,
                                  UsageInfo* aUsageInfo) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aPersistenceType == PERSISTENCE_TYPE_DEFAULT);
+  MOZ_ASSERT(aPersistenceType == PERSISTENCE_TYPE_DEFAULT);
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   nsCOMPtr<nsIFile> directory;
   nsresult rv = quotaManager->GetDirectoryForOrigin(aPersistenceType, aOrigin,
                                                     getter_AddRefs(directory));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     REPORT_TELEMETRY_INIT_ERR(kExternalError, LS_GetDirForOrigin);
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(directory);
+  MOZ_ASSERT(directory);
 
   rv = directory->Append(NS_LITERAL_STRING(LS_DIRECTORY_NAME));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     REPORT_TELEMETRY_INIT_ERR(kExternalError, LS_Append);
     return rv;
   }
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool exists;
   rv = directory->Exists(&exists);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     REPORT_TELEMETRY_INIT_ERR(kExternalError, LS_Exists);
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(exists);
+  MOZ_ASSERT(exists);
 #endif
 
   nsString directoryPath;
   rv = directory->GetPath(directoryPath);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     REPORT_TELEMETRY_INIT_ERR(kExternalError, LS_GetPath);
     return rv;
   }
@@ -7653,17 +7633,17 @@ nsresult QuotaClient::InitOrigin(Persist
 
       rv = usageJournalFile->Remove(false);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         REPORT_TELEMETRY_INIT_ERR(kExternalError, LS_Remove3);
         return rv;
       }
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(usage >= 0);
+    MOZ_ASSERT(usage >= 0);
 
     InitUsageForOrigin(aOrigin, usage);
 
     aUsageInfo->AppendToDatabaseUsage(uint64_t(usage));
   } else if (usageFileExists) {
     rv = usageFile->Remove(false);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       REPORT_TELEMETRY_INIT_ERR(kExternalError, LS_Remove4);
@@ -7738,26 +7718,26 @@ nsresult QuotaClient::InitOrigin(Persist
 }
 
 nsresult QuotaClient::GetUsageForOrigin(PersistenceType aPersistenceType,
                                         const nsACString& aGroup,
                                         const nsACString& aOrigin,
                                         const AtomicBool& aCanceled,
                                         UsageInfo* aUsageInfo) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aPersistenceType == PERSISTENCE_TYPE_DEFAULT);
-  MOZ_DIAGNOSTIC_ASSERT(aUsageInfo);
+  MOZ_ASSERT(aPersistenceType == PERSISTENCE_TYPE_DEFAULT);
+  MOZ_ASSERT(aUsageInfo);
 
   // We can't open the database at this point, since it can be already used
   // by the connection thread. Use the cached value instead.
 
   if (gUsages) {
     int64_t usage;
     if (gUsages->Get(aOrigin, &usage)) {
-      MOZ_DIAGNOSTIC_ASSERT(usage >= 0);
+      MOZ_ASSERT(usage >= 0);
       aUsageInfo->AppendToDatabaseUsage(usage);
     }
   }
 
   return NS_OK;
 }
 
 nsresult QuotaClient::AboutToClearOrigins(
@@ -7792,23 +7772,23 @@ nsresult QuotaClient::AboutToClearOrigin
     return rv;
   }
 
   if (!gArchivedOrigins) {
     rv = LoadArchivedOrigins();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
-    MOZ_DIAGNOSTIC_ASSERT(gArchivedOrigins);
+    MOZ_ASSERT(gArchivedOrigins);
   }
 
   bool hasDataForRemoval = archivedOriginScope->HasMatches(gArchivedOrigins);
 
   QuotaManager* quotaManager = QuotaManager::Get();
-  MOZ_DIAGNOSTIC_ASSERT(quotaManager);
+  MOZ_ASSERT(quotaManager);
 
   nsString basePath = quotaManager->GetBasePath();
 
   {
     MutexAutoLock shadowDatabaseLock(mShadowDatabaseMutex);
 
     nsCOMPtr<mozIStorageConnection> connection;
     if (gInitializedShadowStorage) {
@@ -7891,18 +7871,18 @@ nsresult QuotaClient::AboutToClearOrigin
     }
 
     if (hasDataForRemoval) {
       rv = DetachArchiveDatabase(connection);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
-      MOZ_DIAGNOSTIC_ASSERT(gArchivedOrigins);
-      MOZ_DIAGNOSTIC_ASSERT(archivedOriginScope->HasMatches(gArchivedOrigins));
+      MOZ_ASSERT(gArchivedOrigins);
+      MOZ_ASSERT(archivedOriginScope->HasMatches(gArchivedOrigins));
       archivedOriginScope->RemoveMatches(gArchivedOrigins);
     }
 
     rv = connection->Close();
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
@@ -7962,42 +7942,42 @@ void QuotaClient::AbortOperations(const 
   // immediatelly (avoiding the creation of the Datastore and PreparedDatastore
   // object). We will call RequestAllowToClose on the database actor once it's
   // created and the child actor will respond by sending AllowToClose which
   // will close the Datastore on the parent side (the closing releases the
   // directory lock).
 
   if (gPrepareDatastoreOps) {
     for (PrepareDatastoreOp* prepareDatastoreOp : *gPrepareDatastoreOps) {
-      MOZ_DIAGNOSTIC_ASSERT(prepareDatastoreOp);
+      MOZ_ASSERT(prepareDatastoreOp);
 
       // Explicitely check if a directory lock has been requested.
       // Origin clearing can't be blocked by this PrepareDatastoreOp if it
       // hasn't requested a directory lock yet, so we can just ignore it.
       // This will also guarantee that PrepareDatastoreOp has a known origin.
       // And it also ensures that the ordering is right. Without the check we
       // could invalidate ops whose directory locks were requested after we
       // requested a directory lock for origin clearing.
       if (!prepareDatastoreOp->RequestedDirectoryLock()) {
         continue;
       }
 
-      MOZ_DIAGNOSTIC_ASSERT(prepareDatastoreOp->OriginIsKnown());
+      MOZ_ASSERT(prepareDatastoreOp->OriginIsKnown());
 
       if (aOrigin.IsVoid() || prepareDatastoreOp->Origin() == aOrigin) {
         prepareDatastoreOp->Invalidate();
       }
     }
   }
 
   if (gPreparedDatastores) {
     for (auto iter = gPreparedDatastores->ConstIter(); !iter.Done();
          iter.Next()) {
       PreparedDatastore* preparedDatastore = iter.Data();
-      MOZ_DIAGNOSTIC_ASSERT(preparedDatastore);
+      MOZ_ASSERT(preparedDatastore);
 
       if (aOrigin.IsVoid() || preparedDatastore->Origin() == aOrigin) {
         preparedDatastore->Invalidate();
       }
     }
   }
 
   if (gLiveDatabases) {
@@ -8026,17 +8006,17 @@ void QuotaClient::AbortOperationsForProc
 }
 
 void QuotaClient::StartIdleMaintenance() { AssertIsOnBackgroundThread(); }
 
 void QuotaClient::StopIdleMaintenance() { AssertIsOnBackgroundThread(); }
 
 void QuotaClient::ShutdownWorkThreads() {
   AssertIsOnBackgroundThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mShutdownRequested);
+  MOZ_ASSERT(!mShutdownRequested);
 
   mShutdownRequested = true;
 
   // gPrepareDatastoreOps are short lived objects running a state machine.
   // The shutdown flag is checked between states, so we don't have to notify
   // all the objects here.
   // Allocation of a new PrepareDatastoreOp object is prevented once the
   // shutdown flag is set.
@@ -8127,33 +8107,33 @@ nsresult QuotaClient::CreateArchivedOrig
       return rv;
     }
 
     archivedOriginScope = ArchivedOriginScope::CreateFromPrefix(originKey);
   } else if (aOriginScope.IsPattern()) {
     archivedOriginScope =
         ArchivedOriginScope::CreateFromPattern(aOriginScope.GetPattern());
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(aOriginScope.IsNull());
+    MOZ_ASSERT(aOriginScope.IsNull());
 
     archivedOriginScope = ArchivedOriginScope::CreateFromNull();
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(archivedOriginScope);
+  MOZ_ASSERT(archivedOriginScope);
 
   aArchivedOriginScope = std::move(archivedOriginScope);
   return NS_OK;
 }
 
 nsresult QuotaClient::PerformDelete(
     mozIStorageConnection* aConnection, const nsACString& aSchemaName,
     ArchivedOriginScope* aArchivedOriginScope) const {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aConnection);
-  MOZ_DIAGNOSTIC_ASSERT(aArchivedOriginScope);
+  MOZ_ASSERT(aConnection);
+  MOZ_ASSERT(aArchivedOriginScope);
 
   nsresult rv;
 
   nsCString bindingClause;
   aArchivedOriginScope->GetBindingClause(bindingClause);
 
   nsCOMPtr<mozIStorageStatement> stmt;
   rv = aConnection->CreateStatement(NS_LITERAL_CSTRING("DELETE FROM ") +
@@ -8271,18 +8251,18 @@ QuotaClient::Observer::Observe(nsISuppor
 }
 
 NS_IMPL_ISUPPORTS(QuotaClient::MatchFunction, mozIStorageFunction)
 
 NS_IMETHODIMP
 QuotaClient::MatchFunction::OnFunctionCall(
     mozIStorageValueArray* aFunctionArguments, nsIVariant** aResult) {
   AssertIsOnIOThread();
-  MOZ_DIAGNOSTIC_ASSERT(aFunctionArguments);
-  MOZ_DIAGNOSTIC_ASSERT(aResult);
+  MOZ_ASSERT(aFunctionArguments);
+  MOZ_ASSERT(aResult);
 
   nsCString suffix;
   nsresult rv = aFunctionArguments->GetUTF8String(1, suffix);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   OriginAttributes oa;
--- a/dom/localstorage/LSDatabase.cpp
+++ b/dom/localstorage/LSDatabase.cpp
@@ -40,54 +40,54 @@ LSDatabase::LSDatabase(const nsACString&
       mOrigin(aOrigin),
       mAllowedToClose(false),
       mRequestedAllowToClose(false) {
   AssertIsOnOwningThread();
 
   if (!gLSDatabases) {
     gLSDatabases = new LSDatabaseHashtable();
 
-    MOZ_DIAGNOSTIC_ASSERT(!sObserver);
+    MOZ_ASSERT(!sObserver);
 
     sObserver = new Observer();
 
     nsCOMPtr<nsIObserverService> obsSvc = GetObserverService();
-    MOZ_DIAGNOSTIC_ASSERT(obsSvc);
+    MOZ_ASSERT(obsSvc);
 
     MOZ_ALWAYS_SUCCEEDS(
         obsSvc->AddObserver(sObserver, XPCOM_SHUTDOWN_OBSERVER_TOPIC, false));
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(!gLSDatabases->Get(mOrigin));
+  MOZ_ASSERT(!gLSDatabases->Get(mOrigin));
   gLSDatabases->Put(mOrigin, this);
 }
 
 LSDatabase::~LSDatabase() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mSnapshot);
+  MOZ_ASSERT(!mSnapshot);
 
   if (!mAllowedToClose) {
     AllowToClose();
   }
 
   if (mActor) {
     mActor->SendDeleteMeInternal();
-    MOZ_DIAGNOSTIC_ASSERT(!mActor, "SendDeleteMeInternal should have cleared!");
+    MOZ_ASSERT(!mActor, "SendDeleteMeInternal should have cleared!");
   }
 }
 
 // static
 LSDatabase* LSDatabase::Get(const nsACString& aOrigin) {
   return gLSDatabases ? gLSDatabases->Get(aOrigin) : nullptr;
 }
 
 void LSDatabase::SetActor(LSDatabaseChild* aActor) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mActor);
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(!mActor);
 
   mActor = aActor;
 }
 
 void LSDatabase::RequestAllowToClose() {
   AssertIsOnOwningThread();
 
   if (mRequestedAllowToClose) {
@@ -100,30 +100,30 @@ void LSDatabase::RequestAllowToClose() {
     mSnapshot->MarkDirty();
   } else {
     AllowToClose();
   }
 }
 
 void LSDatabase::NoteFinishedSnapshot(LSSnapshot* aSnapshot) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aSnapshot == mSnapshot);
+  MOZ_ASSERT(aSnapshot == mSnapshot);
 
   mSnapshot = nullptr;
 
   if (mRequestedAllowToClose) {
     AllowToClose();
   }
 }
 
 nsresult LSDatabase::GetLength(LSObject* aObject, uint32_t* aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->GetLength(aResult);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -131,19 +131,19 @@ nsresult LSDatabase::GetLength(LSObject*
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::GetKey(LSObject* aObject, uint32_t aIndex,
                             nsAString& aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->GetKey(aIndex, aResult);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -151,38 +151,38 @@ nsresult LSDatabase::GetKey(LSObject* aO
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::GetItem(LSObject* aObject, const nsAString& aKey,
                              nsAString& aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->GetItem(aKey, aResult);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::GetKeys(LSObject* aObject, nsTArray<nsString>& aKeys) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->GetKeys(aKeys);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -191,19 +191,19 @@ nsresult LSDatabase::GetKeys(LSObject* a
 
   return NS_OK;
 }
 
 nsresult LSDatabase::SetItem(LSObject* aObject, const nsAString& aKey,
                              const nsAString& aValue,
                              LSNotifyInfo& aNotifyInfo) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->SetItem(aKey, aValue, aNotifyInfo);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -211,95 +211,95 @@ nsresult LSDatabase::SetItem(LSObject* a
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::RemoveItem(LSObject* aObject, const nsAString& aKey,
                                 LSNotifyInfo& aNotifyInfo) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->RemoveItem(aKey, aNotifyInfo);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::Clear(LSObject* aObject, LSNotifyInfo& aNotifyInfo) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   nsresult rv = EnsureSnapshot(aObject);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mSnapshot->Clear(aNotifyInfo);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::BeginExplicitSnapshot(LSObject* aObject) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   if (mSnapshot) {
     return NS_ERROR_ALREADY_INITIALIZED;
   }
 
   nsresult rv = EnsureSnapshot(aObject, /* aExplicit */ true);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::EndExplicitSnapshot(LSObject* aObject) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(!mAllowedToClose);
 
   if (!mSnapshot) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(mSnapshot->Explicit());
+  MOZ_ASSERT(mSnapshot->Explicit());
 
   nsresult rv = mSnapshot->End();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 nsresult LSDatabase::EnsureSnapshot(LSObject* aObject, bool aExplicit) {
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT_IF(mSnapshot, !aExplicit);
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(aObject);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT_IF(mSnapshot, !aExplicit);
+  MOZ_ASSERT(!mAllowedToClose);
 
   if (mSnapshot) {
     return NS_OK;
   }
 
   RefPtr<LSSnapshot> snapshot = new LSSnapshot(this);
 
   LSSnapshotChild* actor = new LSSnapshotChild(snapshot);
@@ -325,58 +325,58 @@ nsresult LSDatabase::EnsureSnapshot(LSOb
   // This is cleared in LSSnapshot::Run() before the snapshot is destroyed.
   mSnapshot = snapshot;
 
   return NS_OK;
 }
 
 void LSDatabase::AllowToClose() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mAllowedToClose);
-  MOZ_DIAGNOSTIC_ASSERT(!mSnapshot);
+  MOZ_ASSERT(!mAllowedToClose);
+  MOZ_ASSERT(!mSnapshot);
 
   mAllowedToClose = true;
 
   if (mActor) {
     mActor->SendAllowToClose();
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(gLSDatabases);
-  MOZ_DIAGNOSTIC_ASSERT(gLSDatabases->Get(mOrigin));
+  MOZ_ASSERT(gLSDatabases);
+  MOZ_ASSERT(gLSDatabases->Get(mOrigin));
   gLSDatabases->Remove(mOrigin);
 
   if (!gLSDatabases->Count()) {
     gLSDatabases = nullptr;
 
-    MOZ_DIAGNOSTIC_ASSERT(sObserver);
+    MOZ_ASSERT(sObserver);
 
     nsCOMPtr<nsIObserverService> obsSvc = GetObserverService();
-    MOZ_DIAGNOSTIC_ASSERT(obsSvc);
+    MOZ_ASSERT(obsSvc);
 
     MOZ_ALWAYS_SUCCEEDS(
         obsSvc->RemoveObserver(sObserver, XPCOM_SHUTDOWN_OBSERVER_TOPIC));
 
     sObserver = nullptr;
   }
 }
 
 NS_IMPL_ISUPPORTS(LSDatabase::Observer, nsIObserver)
 
 NS_IMETHODIMP
 LSDatabase::Observer::Observe(nsISupports* aSubject, const char* aTopic,
                               const char16_t* aData) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!strcmp(aTopic, XPCOM_SHUTDOWN_OBSERVER_TOPIC));
-  MOZ_DIAGNOSTIC_ASSERT(gLSDatabases);
+  MOZ_ASSERT(!strcmp(aTopic, XPCOM_SHUTDOWN_OBSERVER_TOPIC));
+  MOZ_ASSERT(gLSDatabases);
 
   nsTArray<RefPtr<LSDatabase>> databases;
 
   for (auto iter = gLSDatabases->ConstIter(); !iter.Done(); iter.Next()) {
     LSDatabase* database = iter.Data();
-    MOZ_DIAGNOSTIC_ASSERT(database);
+    MOZ_ASSERT(database);
 
     databases.AppendElement(database);
   }
 
   for (RefPtr<LSDatabase>& database : databases) {
     database->RequestAllowToClose();
   }
 
--- a/dom/localstorage/LSDatabase.h
+++ b/dom/localstorage/LSDatabase.h
@@ -35,17 +35,17 @@ class LSDatabase final {
   NS_INLINE_DECL_REFCOUNTING(LSDatabase)
 
   void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(LSDatabase); }
 
   void SetActor(LSDatabaseChild* aActor);
 
   void ClearActor() {
     AssertIsOnOwningThread();
-    MOZ_DIAGNOSTIC_ASSERT(mActor);
+    MOZ_ASSERT(mActor);
 
     mActor = nullptr;
   }
 
   bool IsAllowedToClose() const {
     AssertIsOnOwningThread();
 
     return mAllowedToClose;
--- a/dom/localstorage/LSObject.cpp
+++ b/dom/localstorage/LSObject.cpp
@@ -159,17 +159,17 @@ class RequestHelper final : public Runna
         mActor(nullptr),
         mParams(aParams),
         mResultCode(NS_OK),
         mState(State::Initial),
         mWaiting(true),
         mCancelled(false) {}
 
   bool IsOnOwningThread() const {
-    MOZ_DIAGNOSTIC_ASSERT(mOwningEventTarget);
+    MOZ_ASSERT(mOwningEventTarget);
 
     bool current;
     return NS_SUCCEEDED(mOwningEventTarget->IsOnCurrentThread(&current)) &&
            current;
   }
 
   void AssertIsOnOwningThread() const {
     MOZ_ASSERT(NS_IsMainThread());
@@ -195,17 +195,17 @@ class RequestHelper final : public Runna
 
 }  // namespace
 
 LSObject::LSObject(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal)
     : Storage(aWindow, aPrincipal),
       mPrivateBrowsingId(0),
       mInExplicitSnapshot(false) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(NextGenLocalStorageEnabled());
+  MOZ_ASSERT(NextGenLocalStorageEnabled());
 }
 
 LSObject::~LSObject() {
   AssertIsOnOwningThread();
 
   DropObserver();
 }
 
@@ -236,24 +236,24 @@ void LSObject::Initialize() {
     return;
   }
 }
 
 // static
 nsresult LSObject::CreateForWindow(nsPIDOMWindowInner* aWindow,
                                    Storage** aStorage) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aWindow);
-  MOZ_DIAGNOSTIC_ASSERT(aStorage);
-  MOZ_DIAGNOSTIC_ASSERT(NextGenLocalStorageEnabled());
-  MOZ_DIAGNOSTIC_ASSERT(nsContentUtils::StorageAllowedForWindow(aWindow) >
-                        nsContentUtils::StorageAccess::eDeny);
+  MOZ_ASSERT(aWindow);
+  MOZ_ASSERT(aStorage);
+  MOZ_ASSERT(NextGenLocalStorageEnabled());
+  MOZ_ASSERT(nsContentUtils::StorageAllowedForWindow(aWindow) >
+             nsContentUtils::StorageAccess::eDeny);
 
   nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(aWindow);
-  MOZ_DIAGNOSTIC_ASSERT(sop);
+  MOZ_ASSERT(sop);
 
   nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
   if (NS_WARN_IF(!principal)) {
     return NS_ERROR_FAILURE;
   }
 
   if (nsContentUtils::IsSystemPrincipal(principal)) {
     return NS_ERROR_NOT_AVAILABLE;
@@ -270,31 +270,30 @@ nsresult LSObject::CreateForWindow(nsPID
   }
 
   nsAutoPtr<PrincipalInfo> principalInfo(new PrincipalInfo());
   rv = PrincipalToPrincipalInfo(principal, principalInfo);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(principalInfo->type() ==
-                        PrincipalInfo::TContentPrincipalInfo);
+  MOZ_ASSERT(principalInfo->type() == PrincipalInfo::TContentPrincipalInfo);
 
   if (NS_WARN_IF(!QuotaManager::IsPrincipalInfoValid(*principalInfo))) {
     return NS_ERROR_FAILURE;
   }
 
   nsCString suffix;
   nsCString origin;
   rv = QuotaManager::GetInfoFromPrincipal(principal, &suffix, nullptr, &origin);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(originAttrSuffix == suffix);
+  MOZ_ASSERT(originAttrSuffix == suffix);
 
   uint32_t privateBrowsingId;
   rv = principal->GetPrivateBrowsingId(&privateBrowsingId);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   Maybe<ClientInfo> clientInfo = aWindow->GetClientInfo();
@@ -325,35 +324,34 @@ nsresult LSObject::CreateForWindow(nsPID
 }
 
 // static
 nsresult LSObject::CreateForPrincipal(nsPIDOMWindowInner* aWindow,
                                       nsIPrincipal* aPrincipal,
                                       const nsAString& aDocumentURI,
                                       bool aPrivate, LSObject** aObject) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(aObject);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(aObject);
 
   nsCString originAttrSuffix;
   nsCString originKey;
   nsresult rv = GenerateOriginKey(aPrincipal, originAttrSuffix, originKey);
   if (NS_FAILED(rv)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsAutoPtr<PrincipalInfo> principalInfo(new PrincipalInfo());
   rv = PrincipalToPrincipalInfo(aPrincipal, principalInfo);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(
-      principalInfo->type() == PrincipalInfo::TContentPrincipalInfo ||
-      principalInfo->type() == PrincipalInfo::TSystemPrincipalInfo);
+  MOZ_ASSERT(principalInfo->type() == PrincipalInfo::TContentPrincipalInfo ||
+             principalInfo->type() == PrincipalInfo::TSystemPrincipalInfo);
 
   if (NS_WARN_IF(!QuotaManager::IsPrincipalInfoValid(*principalInfo))) {
     return NS_ERROR_FAILURE;
   }
 
   nsCString suffix;
   nsCString origin;
 
@@ -362,17 +360,17 @@ nsresult LSObject::CreateForPrincipal(ns
   } else {
     rv = QuotaManager::GetInfoFromPrincipal(aPrincipal, &suffix, nullptr,
                                             &origin);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(originAttrSuffix == suffix);
+  MOZ_ASSERT(originAttrSuffix == suffix);
 
   Maybe<nsID> clientId;
   if (aWindow) {
     Maybe<ClientInfo> clientInfo = aWindow->GetClientInfo();
     if (clientInfo.isNothing()) {
       return NS_ERROR_FAILURE;
     }
 
@@ -453,17 +451,17 @@ LSRequestChild* LSObject::StartRequest(n
 Storage::StorageType LSObject::Type() const {
   AssertIsOnOwningThread();
 
   return eLocalStorage;
 }
 
 bool LSObject::IsForkOf(const Storage* aStorage) const {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aStorage);
+  MOZ_ASSERT(aStorage);
 
   if (aStorage->Type() != eLocalStorage) {
     return false;
   }
 
   return static_cast<const LSObject*>(aStorage)->mOrigin == mOrigin;
 }
 
@@ -793,17 +791,17 @@ nsresult LSObject::EnsureDatabase() {
 
   if (mDatabase && !mDatabase->IsAllowedToClose()) {
     return NS_OK;
   }
 
   mDatabase = LSDatabase::Get(mOrigin);
 
   if (mDatabase) {
-    MOZ_DIAGNOSTIC_ASSERT(!mDatabase->IsAllowedToClose());
+    MOZ_ASSERT(!mDatabase->IsAllowedToClose());
     return NS_OK;
   }
 
   // We don't need this yet, but once the request successfully finishes, it's
   // too late to initialize PBackground child on the owning thread, because
   // it can fail and parent would keep an extra strong ref to the datastore.
   PBackgroundChild* backgroundActor =
       BackgroundChild::GetOrCreateForCurrentThread();
@@ -821,18 +819,18 @@ nsresult LSObject::EnsureDatabase() {
 
   LSRequestResponse response;
 
   nsresult rv = DoRequestSynchronously(params, response);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(response.type() ==
-                        LSRequestResponse::TLSRequestPrepareDatastoreResponse);
+  MOZ_ASSERT(response.type() ==
+             LSRequestResponse::TLSRequestPrepareDatastoreResponse);
 
   const LSRequestPrepareDatastoreResponse& prepareDatastoreResponse =
       response.get_LSRequestPrepareDatastoreResponse();
 
   uint64_t datastoreId = prepareDatastoreResponse.datastoreId();
 
   // The datastore is now ready on the parent side (prepared by the asynchronous
   // request on the DOM File thread).
@@ -885,33 +883,33 @@ nsresult LSObject::EnsureObserver() {
 
   LSRequestResponse response;
 
   nsresult rv = DoRequestSynchronously(params, response);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(response.type() ==
-                        LSRequestResponse::TLSRequestPrepareObserverResponse);
+  MOZ_ASSERT(response.type() ==
+             LSRequestResponse::TLSRequestPrepareObserverResponse);
 
   const LSRequestPrepareObserverResponse& prepareObserverResponse =
       response.get_LSRequestPrepareObserverResponse();
 
   uint64_t observerId = prepareObserverResponse.observerId();
 
   // The obsserver is now ready on the parent side (prepared by the asynchronous
   // request on the DOM File thread).
   // Let's create a direct connection to the observer (through an observer
   // actor) from the owning thread.
   // Note that we now can't error out, otherwise parent will keep an extra
   // strong reference to the observer.
 
   PBackgroundChild* backgroundActor = BackgroundChild::GetForCurrentThread();
-  MOZ_DIAGNOSTIC_ASSERT(backgroundActor);
+  MOZ_ASSERT(backgroundActor);
 
   RefPtr<LSObserver> observer = new LSObserver(mOrigin);
 
   LSObserverChild* actor = new LSObserverChild(observer);
 
   MOZ_ALWAYS_TRUE(
       backgroundActor->SendPBackgroundLSObserverConstructor(actor, observerId));
 
@@ -940,30 +938,30 @@ void LSObject::OnChange(const nsAString&
                /* aImmediateDispatch */ false);
 }
 
 nsresult LSObject::EndExplicitSnapshotInternal() {
   AssertIsOnOwningThread();
 
   // Can be only called if the mInExplicitSnapshot flag is true.
   // An explicit snapshot must have been created.
-  MOZ_DIAGNOSTIC_ASSERT(mInExplicitSnapshot);
+  MOZ_ASSERT(mInExplicitSnapshot);
 
   // If an explicit snapshot have been created then mDatabase must be not null.
   // DropDatabase could be called in the meatime, but that would set
   // mInExplicitSnapshot to false. EnsureDatabase could be called in the
   // meantime too, but that can't set mDatabase to null or to a new value. See
   // the comment below.
-  MOZ_DIAGNOSTIC_ASSERT(mDatabase);
+  MOZ_ASSERT(mDatabase);
 
   // Existence of a snapshot prevents the database from allowing to close. See
   // LSDatabase::RequestAllowToClose and LSDatabase::NoteFinishedSnapshot.
   // If the database is not allowed to close then mDatabase could not have been
   // nulled out or set to a new value. See EnsureDatabase.
-  MOZ_DIAGNOSTIC_ASSERT(!mDatabase->IsAllowedToClose());
+  MOZ_ASSERT(!mDatabase->IsAllowedToClose());
 
   nsresult rv = mDatabase->EndExplicitSnapshot(this);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   mInExplicitSnapshot = false;
 
@@ -991,17 +989,17 @@ NestedEventTargetWrapper::IsOnCurrentThr
   MOZ_CRASH(
       "IsOnCurrentThread should never be called on "
       "NestedEventTargetWrapper");
 }
 
 NS_IMETHODIMP
 NestedEventTargetWrapper::Dispatch(already_AddRefed<nsIRunnable> aEvent,
                                    uint32_t aFlags) {
-  MOZ_DIAGNOSTIC_ASSERT(mNestedEventTarget);
+  MOZ_ASSERT(mNestedEventTarget);
 
   if (mDisconnected) {
     MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(std::move(aEvent), aFlags));
     return NS_OK;
   }
 
   nsCOMPtr<nsIRunnable> event(aEvent);
 
@@ -1054,17 +1052,17 @@ nsresult RequestHelper::StartAndReturnRe
   // event loop can't fire any other events.
   // This way the thread is synchronously blocked in a safe manner and the
   // runnable gets executed.
   {
     auto thread = static_cast<nsThread*>(NS_GetCurrentThread());
 
     const nsLocalExecutionGuard localExecution(thread->EnterLocalExecution());
     mNestedEventTarget = localExecution.GetEventTarget();
-    MOZ_DIAGNOSTIC_ASSERT(mNestedEventTarget);
+    MOZ_ASSERT(mNestedEventTarget);
 
     mNestedEventTargetWrapper =
         new NestedEventTargetWrapper(mNestedEventTarget);
 
     nsCOMPtr<nsIEventTarget> domFileThread =
         XRE_IsParentProcess() ? IPCBlobInputStreamThread::GetOrCreate()
                               : IPCBlobInputStreamThread::Get();
     if (NS_WARN_IF(!domFileThread)) {
@@ -1176,34 +1174,34 @@ nsresult RequestHelper::StartAndReturnRe
   }
 
   aResponse = std::move(mResponse);
   return NS_OK;
 }
 
 nsresult RequestHelper::Start() {
   AssertIsOnDOMFileThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Initial);
+  MOZ_ASSERT(mState == State::Initial);
 
   mState = State::ResponsePending;
 
   LSRequestChild* actor =
       mObject->StartRequest(mNestedEventTargetWrapper, mParams, this);
   if (NS_WARN_IF(!actor)) {
     return NS_ERROR_FAILURE;
   }
 
   mActor = actor;
 
   return NS_OK;
 }
 
 void RequestHelper::Finish() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::Finishing);
+  MOZ_ASSERT(mState == State::Finishing);
 
   mObject = nullptr;
 
   mWaiting = false;
 
   mState = State::Complete;
 }
 
@@ -1241,17 +1239,17 @@ RequestHelper::Run() {
     }
   }
 
   return NS_OK;
 }
 
 void RequestHelper::OnResponse(const LSRequestResponse& aResponse) {
   AssertIsOnDOMFileThread();
-  MOZ_DIAGNOSTIC_ASSERT(mState == State::ResponsePending);
+  MOZ_ASSERT(mState == State::ResponsePending);
 
   mActor = nullptr;
 
   mResponse = aResponse;
 
   mState = State::Finishing;
 
   MOZ_ALWAYS_SUCCEEDS(
--- a/dom/localstorage/LSObserver.cpp
+++ b/dom/localstorage/LSObserver.cpp
@@ -26,44 +26,44 @@ StaticAutoPtr<LSObserverHashtable> gLSOb
 LSObserver::LSObserver(const nsACString& aOrigin)
     : mActor(nullptr), mOrigin(aOrigin) {
   AssertIsOnOwningThread();
 
   if (!gLSObservers) {
     gLSObservers = new LSObserverHashtable();
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(!gLSObservers->Get(mOrigin));
+  MOZ_ASSERT(!gLSObservers->Get(mOrigin));
   gLSObservers->Put(mOrigin, this);
 }
 
 LSObserver::~LSObserver() {
   AssertIsOnOwningThread();
 
   if (mActor) {
     mActor->SendDeleteMeInternal();
-    MOZ_DIAGNOSTIC_ASSERT(!mActor, "SendDeleteMeInternal should have cleared!");
+    MOZ_ASSERT(!mActor, "SendDeleteMeInternal should have cleared!");
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(gLSObservers);
-  MOZ_DIAGNOSTIC_ASSERT(gLSObservers->Get(mOrigin));
+  MOZ_ASSERT(gLSObservers);
+  MOZ_ASSERT(gLSObservers->Get(mOrigin));
   gLSObservers->Remove(mOrigin);
 
   if (!gLSObservers->Count()) {
     gLSObservers = nullptr;
   }
 }
 
 // static
 LSObserver* LSObserver::Get(const nsACString& aOrigin) {
   return gLSObservers ? gLSObservers->Get(aOrigin) : nullptr;
 }
 
 void LSObserver::SetActor(LSObserverChild* aActor) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mActor);
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(!mActor);
 
   mActor = aActor;
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/localstorage/LSObserver.h
+++ b/dom/localstorage/LSObserver.h
@@ -43,17 +43,17 @@ class LSObserver final {
   NS_INLINE_DECL_REFCOUNTING(LSObserver)
 
   void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(LSObserver); }
 
   void SetActor(LSObserverChild* aActor);
 
   void ClearActor() {
     AssertIsOnOwningThread();
-    MOZ_DIAGNOSTIC_ASSERT(mActor);
+    MOZ_ASSERT(mActor);
 
     mActor = nullptr;
   }
 
  private:
   // Only created by LSObject.
   explicit LSObserver(const nsACString& aOrigin);
 
--- a/dom/localstorage/LSSnapshot.cpp
+++ b/dom/localstorage/LSSnapshot.cpp
@@ -24,53 +24,53 @@ LSSnapshot::LSSnapshot(LSDatabase* aData
       mLength(0),
       mExactUsage(0),
       mPeakUsage(0),
       mLoadState(LoadState::Initial),
       mExplicit(false),
       mHasPendingStableStateCallback(false),
       mHasPendingTimerCallback(false),
       mDirty(false)
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
       ,
       mInitialized(false),
       mSentFinish(false)
 #endif
 {
   AssertIsOnOwningThread();
 }
 
 LSSnapshot::~LSSnapshot() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(!mHasPendingStableStateCallback);
-  MOZ_DIAGNOSTIC_ASSERT(!mHasPendingTimerCallback);
-  MOZ_DIAGNOSTIC_ASSERT_IF(mInitialized, mSentFinish);
+  MOZ_ASSERT(mDatabase);
+  MOZ_ASSERT(!mHasPendingStableStateCallback);
+  MOZ_ASSERT(!mHasPendingTimerCallback);
+  MOZ_ASSERT_IF(mInitialized, mSentFinish);
 
   if (mActor) {
     mActor->SendDeleteMeInternal();
-    MOZ_DIAGNOSTIC_ASSERT(!mActor, "SendDeleteMeInternal should have cleared!");
+    MOZ_ASSERT(!mActor, "SendDeleteMeInternal should have cleared!");
   }
 }
 
 void LSSnapshot::SetActor(LSSnapshotChild* aActor) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-  MOZ_DIAGNOSTIC_ASSERT(!mActor);
+  MOZ_ASSERT(aActor);
+  MOZ_ASSERT(!mActor);
 
   mActor = aActor;
 }
 
 nsresult LSSnapshot::Init(const LSSnapshotInitInfo& aInitInfo, bool aExplicit) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mSelfRef);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mLoadState == LoadState::Initial);
-  MOZ_DIAGNOSTIC_ASSERT(!mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(!mSelfRef);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mLoadState == LoadState::Initial);
+  MOZ_ASSERT(!mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   mSelfRef = this;
 
   LoadState loadState = aInitInfo.loadState();
 
   const nsTArray<LSItemInfo>& itemInfos = aInitInfo.itemInfos();
   for (uint32_t i = 0; i < itemInfos.Length(); i++) {
     const LSItemInfo& itemInfo = itemInfos[i];
@@ -85,62 +85,62 @@ nsresult LSSnapshot::Init(const LSSnapsh
   }
 
   if (loadState == LoadState::Partial) {
     mInitLength = aInitInfo.totalLength();
     mLength = mInitLength;
   } else if (loadState == LoadState::AllOrderedKeys) {
     mInitLength = aInitInfo.totalLength();
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(loadState == LoadState::AllOrderedItems);
+    MOZ_ASSERT(loadState == LoadState::AllOrderedItems);
   }
 
   mExactUsage = aInitInfo.initialUsage();
   mPeakUsage = aInitInfo.peakUsage();
 
   mLoadState = aInitInfo.loadState();
 
   mExplicit = aExplicit;
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   mInitialized = true;
 #endif
 
   if (!mExplicit) {
     mTimer = NS_NewTimer();
-    MOZ_DIAGNOSTIC_ASSERT(mTimer);
+    MOZ_ASSERT(mTimer);
 
     ScheduleStableStateCallback();
   }
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::GetLength(uint32_t* aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   if (mLoadState == LoadState::Partial) {
     *aResult = mLength;
   } else {
     *aResult = mValues.Count();
   }
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::GetKey(uint32_t aIndex, nsAString& aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   nsresult rv = EnsureAllKeys();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -153,37 +153,37 @@ nsresult LSSnapshot::GetKey(uint32_t aIn
     aIndex--;
   }
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::GetItem(const nsAString& aKey, nsAString& aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   nsString result;
   nsresult rv = GetItemInternal(aKey, Optional<nsString>(), result);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   aResult = result;
   return NS_OK;
 }
 
 nsresult LSSnapshot::GetKeys(nsTArray<nsString>& aKeys) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   nsresult rv = EnsureAllKeys();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
@@ -192,19 +192,19 @@ nsresult LSSnapshot::GetKeys(nsTArray<ns
   }
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::SetItem(const nsAString& aKey, const nsAString& aValue,
                              LSNotifyInfo& aNotifyInfo) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   nsString oldValue;
   nsresult rv =
       GetItemInternal(aKey, Optional<nsString>(nsString(aValue)), oldValue);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -249,19 +249,19 @@ nsresult LSSnapshot::SetItem(const nsASt
   aNotifyInfo.oldValue() = oldValue;
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::RemoveItem(const nsAString& aKey,
                                 LSNotifyInfo& aNotifyInfo) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   nsString oldValue;
   nsresult rv =
       GetItemInternal(aKey, Optional<nsString>(VoidString()), oldValue);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -271,22 +271,18 @@ nsresult LSSnapshot::RemoveItem(const ns
   if (oldValue.IsVoid()) {
     changed = false;
   } else {
     changed = true;
 
     int64_t delta = -(static_cast<int64_t>(aKey.Length()) +
                       static_cast<int64_t>(oldValue.Length()));
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-    nsresult rv = UpdateUsage(delta);
-    MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
-#else
-    UpdateUsage(delta);
-#endif
+    DebugOnly<nsresult> rv = UpdateUsage(delta);
+    MOZ_ASSERT(NS_SUCCEEDED(rv));
 
     if (mLoadState == LoadState::Partial) {
       mLength--;
     }
 
     LSRemoveItemInfo removeItemInfo;
     removeItemInfo.key() = aKey;
     removeItemInfo.oldValue() = oldValue;
@@ -297,26 +293,26 @@ nsresult LSSnapshot::RemoveItem(const ns
   aNotifyInfo.changed() = changed;
   aNotifyInfo.oldValue() = oldValue;
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::Clear(LSNotifyInfo& aNotifyInfo) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MaybeScheduleStableStateCallback();
 
   uint32_t length;
   if (mLoadState == LoadState::Partial) {
     length = mLength;
-    MOZ_DIAGNOSTIC_ASSERT(length);
+    MOZ_ASSERT(length);
 
     MOZ_ALWAYS_TRUE(mActor->SendLoaded());
 
     mLoadedItems.Clear();
     mUnknownItems.Clear();
     mLength = 0;
     mLoadState = LoadState::AllOrderedItems;
   } else {
@@ -324,66 +320,62 @@ nsresult LSSnapshot::Clear(LSNotifyInfo&
   }
 
   bool changed;
   if (!length) {
     changed = false;
   } else {
     changed = true;
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-    nsresult rv = UpdateUsage(-mExactUsage);
-    MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
-#else
-    UpdateUsage(-mExactUsage);
-#endif
+    DebugOnly<nsresult> rv = UpdateUsage(-mExactUsage);
+    MOZ_ASSERT(NS_SUCCEEDED(rv));
 
     mValues.Clear();
 
     LSClearInfo clearInfo;
 
     mWriteInfos.AppendElement(std::move(clearInfo));
   }
 
   aNotifyInfo.changed() = changed;
 
   return NS_OK;
 }
 
 void LSSnapshot::MarkDirty() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   if (mDirty) {
     return;
   }
 
   mDirty = true;
 
   if (!mExplicit && !mHasPendingStableStateCallback) {
     CancelTimer();
 
     MOZ_ALWAYS_SUCCEEDS(Checkpoint());
 
     MOZ_ALWAYS_SUCCEEDS(Finish());
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(!mHasPendingTimerCallback);
+    MOZ_ASSERT(!mHasPendingTimerCallback);
   }
 }
 
 nsresult LSSnapshot::End() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mExplicit);
-  MOZ_DIAGNOSTIC_ASSERT(!mHasPendingStableStateCallback);
-  MOZ_DIAGNOSTIC_ASSERT(!mHasPendingTimerCallback);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mExplicit);
+  MOZ_ASSERT(!mHasPendingStableStateCallback);
+  MOZ_ASSERT(!mHasPendingTimerCallback);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   nsresult rv = Checkpoint();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   RefPtr<LSSnapshot> kungFuDeathGrip = this;
 
@@ -396,52 +388,52 @@ nsresult LSSnapshot::End() {
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 void LSSnapshot::ScheduleStableStateCallback() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mTimer);
-  MOZ_DIAGNOSTIC_ASSERT(!mExplicit);
-  MOZ_DIAGNOSTIC_ASSERT(!mHasPendingStableStateCallback);
+  MOZ_ASSERT(mTimer);
+  MOZ_ASSERT(!mExplicit);
+  MOZ_ASSERT(!mHasPendingStableStateCallback);
 
   CancelTimer();
 
   nsCOMPtr<nsIRunnable> runnable = this;
   nsContentUtils::RunInStableState(runnable.forget());
 
   mHasPendingStableStateCallback = true;
 }
 
 void LSSnapshot::MaybeScheduleStableStateCallback() {
   AssertIsOnOwningThread();
 
   if (!mExplicit && !mHasPendingStableStateCallback) {
     ScheduleStableStateCallback();
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(!mHasPendingTimerCallback);
+    MOZ_ASSERT(!mHasPendingTimerCallback);
   }
 }
 
 nsresult LSSnapshot::GetItemInternal(const nsAString& aKey,
                                      const Optional<nsString>& aValue,
                                      nsAString& aResult) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   nsString result;
 
   switch (mLoadState) {
     case LoadState::Partial: {
       if (mValues.Get(aKey, &result)) {
-        MOZ_DIAGNOSTIC_ASSERT(!result.IsVoid());
+        MOZ_ASSERT(!result.IsVoid());
       } else if (mLoadedItems.GetEntry(aKey) || mUnknownItems.GetEntry(aKey)) {
         result.SetIsVoid(true);
       } else {
         if (NS_WARN_IF(!mActor->SendLoadItem(nsString(aKey), &result))) {
           return NS_ERROR_FAILURE;
         }
 
         if (result.IsVoid()) {
@@ -473,24 +465,24 @@ nsresult LSSnapshot::GetItemInternal(con
 
     case LoadState::AllOrderedKeys: {
       if (mValues.Get(aKey, &result)) {
         if (result.IsVoid()) {
           if (NS_WARN_IF(!mActor->SendLoadItem(nsString(aKey), &result))) {
             return NS_ERROR_FAILURE;
           }
 
-          MOZ_DIAGNOSTIC_ASSERT(!result.IsVoid());
+          MOZ_ASSERT(!result.IsVoid());
 
           mLoadedItems.PutEntry(aKey);
           mValues.Put(aKey, result);
 
           if (mLoadedItems.Count() == mInitLength) {
             mLoadedItems.Clear();
-            MOZ_DIAGNOSTIC_ASSERT(mLength == 0);
+            MOZ_ASSERT(mLength == 0);
             mLoadState = LoadState::AllOrderedItems;
           }
         }
       } else {
         result.SetIsVoid(true);
       }
 
       if (aValue.WasPassed()) {
@@ -516,25 +508,25 @@ nsresult LSSnapshot::GetItemInternal(con
             entry.Data() = value;
           } else {
             result.SetIsVoid(true);
             entry.OrInsert([value]() { return value; });
           }
         } else {
           if (auto entry = mValues.Lookup(aKey)) {
             result = entry.Data();
-            MOZ_DIAGNOSTIC_ASSERT(!result.IsVoid());
+            MOZ_ASSERT(!result.IsVoid());
             entry.Remove();
           } else {
             result.SetIsVoid(true);
           }
         }
       } else {
         if (mValues.Get(aKey, &result)) {
-          MOZ_DIAGNOSTIC_ASSERT(!result.IsVoid());
+          MOZ_ASSERT(!result.IsVoid());
         } else {
           result.SetIsVoid(true);
         }
       }
 
       break;
     }
 
@@ -543,20 +535,20 @@ nsresult LSSnapshot::GetItemInternal(con
   }
 
   aResult = result;
   return NS_OK;
 }
 
 nsresult LSSnapshot::EnsureAllKeys() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
-  MOZ_DIAGNOSTIC_ASSERT(mLoadState != LoadState::Initial);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mLoadState != LoadState::Initial);
 
   if (mLoadState == LoadState::AllOrderedKeys ||
       mLoadState == LoadState::AllOrderedItems) {
     return NS_OK;
   }
 
   nsTArray<nsString> keys;
   if (NS_WARN_IF(!mActor->SendLoadKeys(&keys))) {
@@ -586,154 +578,154 @@ nsresult LSSnapshot::EnsureAllKeys() {
         break;
       }
 
       default:
         MOZ_CRASH("Should never get here!");
     }
   }
 
-  MOZ_DIAGNOSTIC_ASSERT_IF(mLoadState == LoadState::AllUnorderedItems,
-                           newValues.Count() == mValues.Count());
+  MOZ_ASSERT_IF(mLoadState == LoadState::AllUnorderedItems,
+                newValues.Count() == mValues.Count());
 
   for (auto iter = newValues.Iter(); !iter.Done(); iter.Next()) {
     nsString value;
     if (mValues.Get(iter.Key(), &value)) {
       iter.Data() = value;
     }
   }
 
   mValues.SwapElements(newValues);
 
   if (mLoadState == LoadState::Partial) {
     mUnknownItems.Clear();
     mLength = 0;
     mLoadState = LoadState::AllOrderedKeys;
   } else {
-    MOZ_DIAGNOSTIC_ASSERT(mLoadState == LoadState::AllUnorderedItems);
+    MOZ_ASSERT(mLoadState == LoadState::AllUnorderedItems);
 
-    MOZ_DIAGNOSTIC_ASSERT(mUnknownItems.Count() == 0);
-    MOZ_DIAGNOSTIC_ASSERT(mLength == 0);
+    MOZ_ASSERT(mUnknownItems.Count() == 0);
+    MOZ_ASSERT(mLength == 0);
     mLoadState = LoadState::AllOrderedItems;
   }
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::UpdateUsage(int64_t aDelta) {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mPeakUsage >= mExactUsage);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mDatabase);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mPeakUsage >= mExactUsage);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   int64_t newExactUsage = mExactUsage + aDelta;
   if (newExactUsage > mPeakUsage) {
     int64_t minSize = newExactUsage - mPeakUsage;
     int64_t requestedSize = minSize + 4096;
     int64_t size;
     if (NS_WARN_IF(
             !mActor->SendIncreasePeakUsage(requestedSize, minSize, &size))) {
       return NS_ERROR_FAILURE;
     }
 
-    MOZ_DIAGNOSTIC_ASSERT(size >= 0);
+    MOZ_ASSERT(size >= 0);
 
     if (size == 0) {
       return NS_ERROR_FILE_NO_DEVICE_SPACE;
     }
 
     mPeakUsage += size;
   }
 
   mExactUsage = newExactUsage;
   return NS_OK;
 }
 
 nsresult LSSnapshot::Checkpoint() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   if (!mWriteInfos.IsEmpty()) {
     MOZ_ALWAYS_TRUE(mActor->SendCheckpoint(mWriteInfos));
 
     mWriteInfos.Clear();
   }
 
   return NS_OK;
 }
 
 nsresult LSSnapshot::Finish() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mDatabase);
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  MOZ_DIAGNOSTIC_ASSERT(mInitialized);
-  MOZ_DIAGNOSTIC_ASSERT(!mSentFinish);
+  MOZ_ASSERT(mDatabase);
+  MOZ_ASSERT(mActor);
+  MOZ_ASSERT(mInitialized);
+  MOZ_ASSERT(!mSentFinish);
 
   MOZ_ALWAYS_TRUE(mActor->SendFinish());
 
   mDatabase->NoteFinishedSnapshot(this);
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   mSentFinish = true;
 #endif
 
   // Clear the self reference added in Init method.
-  MOZ_DIAGNOSTIC_ASSERT(mSelfRef);
+  MOZ_ASSERT(mSelfRef);
   mSelfRef = nullptr;
 
   return NS_OK;
 }
 
 void LSSnapshot::CancelTimer() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(mTimer);
+  MOZ_ASSERT(mTimer);
 
   if (mHasPendingTimerCallback) {
     MOZ_ALWAYS_SUCCEEDS(mTimer->Cancel());
     mHasPendingTimerCallback = false;
   }
 }
 
 // static
 void LSSnapshot::TimerCallback(nsITimer* aTimer, void* aClosure) {
-  MOZ_DIAGNOSTIC_ASSERT(aTimer);
+  MOZ_ASSERT(aTimer);
 
   auto* self = static_cast<LSSnapshot*>(aClosure);
-  MOZ_DIAGNOSTIC_ASSERT(self);
-  MOZ_DIAGNOSTIC_ASSERT(self->mTimer);
-  MOZ_DIAGNOSTIC_ASSERT(SameCOMIdentity(self->mTimer, aTimer));
-  MOZ_DIAGNOSTIC_ASSERT(!self->mHasPendingStableStateCallback);
-  MOZ_DIAGNOSTIC_ASSERT(self->mHasPendingTimerCallback);
+  MOZ_ASSERT(self);
+  MOZ_ASSERT(self->mTimer);
+  MOZ_ASSERT(SameCOMIdentity(self->mTimer, aTimer));
+  MOZ_ASSERT(!self->mHasPendingStableStateCallback);
+  MOZ_ASSERT(self->mHasPendingTimerCallback);
 
   self->mHasPendingTimerCallback = false;
 
   MOZ_ALWAYS_SUCCEEDS(self->Finish());
 }
 
 NS_IMPL_ISUPPORTS(LSSnapshot, nsIRunnable)
 
 NS_IMETHODIMP
 LSSnapshot::Run() {
   AssertIsOnOwningThread();
-  MOZ_DIAGNOSTIC_ASSERT(!mExplicit);
-  MOZ_DIAGNOSTIC_ASSERT(mHasPendingStableStateCallback);
-  MOZ_DIAGNOSTIC_ASSERT(!mHasPendingTimerCallback);
+  MOZ_ASSERT(!mExplicit);
+  MOZ_ASSERT(mHasPendingStableStateCallback);
+  MOZ_ASSERT(!mHasPendingTimerCallback);
 
   mHasPendingStableStateCallback = false;
 
   MOZ_ALWAYS_SUCCEEDS(Checkpoint());
 
   if (mDirty || !Preferences::GetBool("dom.storage.snapshot_reusing")) {
     MOZ_ALWAYS_SUCCEEDS(Finish());
   } else if (!mExplicit) {
-    MOZ_DIAGNOSTIC_ASSERT(mTimer);
+    MOZ_ASSERT(mTimer);
 
     MOZ_ALWAYS_SUCCEEDS(mTimer->InitWithNamedFuncCallback(
         TimerCallback, this, kSnapshotTimeoutMs, nsITimer::TYPE_ONE_SHOT,
         "LSSnapshot::TimerCallback"));
 
     mHasPendingTimerCallback = true;
   }
 
--- a/dom/localstorage/LSSnapshot.h
+++ b/dom/localstorage/LSSnapshot.h
@@ -86,31 +86,31 @@ class LSSnapshot final : public nsIRunna
 
   LoadState mLoadState;
 
   bool mExplicit;
   bool mHasPendingStableStateCallback;
   bool mHasPendingTimerCallback;
   bool mDirty;
 
-#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+#ifdef DEBUG
   bool mInitialized;
   bool mSentFinish;
 #endif
 
  public:
   explicit LSSnapshot(LSDatabase* aDatabase);
 
   void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(LSSnapshot); }
 
   void SetActor(LSSnapshotChild* aActor);
 
   void ClearActor() {
     AssertIsOnOwningThread();
-    MOZ_DIAGNOSTIC_ASSERT(mActor);
+    MOZ_ASSERT(mActor);
 
     mActor = nullptr;
   }
 
   bool Explicit() const { return mExplicit; }
 
   nsresult Init(const LSSnapshotInitInfo& aInitInfo, bool aExplicit);
 
--- a/dom/localstorage/LocalStorageCommon.cpp
+++ b/dom/localstorage/LocalStorageCommon.cpp
@@ -42,17 +42,17 @@ bool NextGenLocalStorageEnabled() {
     bool enabled = Preferences::GetBool("dom.storage.next_gen", false);
     gNextGenLocalStorageEnabled = enabled ? 1 : 0;
   }
 
   return !!gNextGenLocalStorageEnabled;
 }
 
 bool CachedNextGenLocalStorageEnabled() {
-  MOZ_DIAGNOSTIC_ASSERT(gNextGenLocalStorageEnabled != -1);
+  MOZ_ASSERT(gNextGenLocalStorageEnabled != -1);
 
   return !!gNextGenLocalStorageEnabled;
 }
 
 nsresult GenerateOriginKey2(const PrincipalInfo& aPrincipalInfo,
                             nsACString& aOriginAttrSuffix,
                             nsACString& aOriginKey) {
   OriginAttributes attrs;
--- a/dom/localstorage/LocalStorageManager2.cpp
+++ b/dom/localstorage/LocalStorageManager2.cpp
@@ -49,17 +49,17 @@ class SimpleRequestResolver final : publ
   void HandleResponse(bool aResponse);
 
   // LSRequestChildCallback
   void OnResponse(const LSSimpleRequestResponse& aResponse) override;
 };
 
 nsresult CreatePromise(JSContext* aContext, Promise** aPromise) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aContext);
+  MOZ_ASSERT(aContext);
 
   nsIGlobalObject* global =
       xpc::NativeGlobal(JS::CurrentGlobalOrNull(aContext));
   if (NS_WARN_IF(!global)) {
     return NS_ERROR_FAILURE;
   }
 
   ErrorResult result;
@@ -70,17 +70,17 @@ nsresult CreatePromise(JSContext* aConte
 
   promise.forget(aPromise);
   return NS_OK;
 }
 
 nsresult CheckedPrincipalToPrincipalInfo(nsIPrincipal* aPrincipal,
                                          PrincipalInfo& aPrincipalInfo) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
+  MOZ_ASSERT(aPrincipal);
 
   nsresult rv = PrincipalToPrincipalInfo(aPrincipal, &aPrincipalInfo);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (NS_WARN_IF(!QuotaManager::IsPrincipalInfoValid(aPrincipalInfo))) {
     return NS_ERROR_FAILURE;
@@ -93,47 +93,47 @@ nsresult CheckedPrincipalToPrincipalInfo
 
   return NS_OK;
 }
 
 }  // namespace
 
 LocalStorageManager2::LocalStorageManager2() {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(NextGenLocalStorageEnabled());
+  MOZ_ASSERT(NextGenLocalStorageEnabled());
 }
 
 LocalStorageManager2::~LocalStorageManager2() { MOZ_ASSERT(NS_IsMainThread()); }
 
 NS_IMPL_ISUPPORTS(LocalStorageManager2, nsIDOMStorageManager,
                   nsILocalStorageManager)
 
 NS_IMETHODIMP
 LocalStorageManager2::PrecacheStorage(nsIPrincipal* aPrincipal,
                                       Storage** _retval) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(_retval);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(_retval);
 
   // This method was created as part of the e10s-ification of the old LS
   // implementation to perform a preload in the content/current process.  That's
   // not how things work in LSNG.  Instead everything happens in the parent
   // process, triggered by the official preloading spot,
   // ContentParent::AboutToLoadHttpFtpDocumentForChild.
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::CreateStorage(mozIDOMWindow* aWindow,
                                     nsIPrincipal* aPrincipal,
                                     const nsAString& aDocumentURI,
                                     bool aPrivate, Storage** _retval) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(_retval);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(_retval);
 
   nsCOMPtr<nsPIDOMWindowInner> inner = nsPIDOMWindowInner::From(aWindow);
 
   RefPtr<LSObject> object;
   nsresult rv = LSObject::CreateForPrincipal(inner, aPrincipal, aDocumentURI,
                                              aPrivate, getter_AddRefs(object));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -143,59 +143,59 @@ LocalStorageManager2::CreateStorage(mozI
   return NS_OK;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::GetStorage(mozIDOMWindow* aWindow,
                                  nsIPrincipal* aPrincipal, bool aPrivate,
                                  Storage** _retval) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(_retval);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(_retval);
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::CloneStorage(Storage* aStorageToCloneFrom) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aStorageToCloneFrom);
+  MOZ_ASSERT(aStorageToCloneFrom);
 
   // Cloning is specific to sessionStorage; state is forked when a new tab is
   // opened from an existing tab.
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::CheckStorage(nsIPrincipal* aPrincipal, Storage* aStorage,
                                    bool* _retval) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(aStorage);
-  MOZ_DIAGNOSTIC_ASSERT(_retval);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(aStorage);
+  MOZ_ASSERT(_retval);
 
   // Only used by sessionStorage.
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::GetNextGenLocalStorageEnabled(bool* aResult) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aResult);
+  MOZ_ASSERT(aResult);
 
   *aResult = NextGenLocalStorageEnabled();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::Preload(nsIPrincipal* aPrincipal, JSContext* aContext,
                               nsISupports** _retval) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(_retval);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(_retval);
 
   nsCString originAttrSuffix;
   nsCString originKey;
   nsresult rv = GenerateOriginKey(aPrincipal, originAttrSuffix, originKey);
   if (NS_FAILED(rv)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
@@ -228,18 +228,18 @@ LocalStorageManager2::Preload(nsIPrincip
   promise.forget(_retval);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 LocalStorageManager2::IsPreloaded(nsIPrincipal* aPrincipal, JSContext* aContext,
                                   nsISupports** _retval) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPrincipal);
-  MOZ_DIAGNOSTIC_ASSERT(_retval);
+  MOZ_ASSERT(aPrincipal);
+  MOZ_ASSERT(_retval);
 
   RefPtr<Promise> promise;
   nsresult rv = CreatePromise(aContext, getter_AddRefs(promise));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   LSSimpleRequestPreloadedParams params;
@@ -277,17 +277,17 @@ nsresult LocalStorageManager2::StartRequ
   }
 
   return NS_OK;
 }
 
 nsresult LocalStorageManager2::StartSimpleRequest(
     Promise* aPromise, const LSSimpleRequestParams& aParams) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(aPromise);
+  MOZ_ASSERT(aPromise);
 
   PBackgroundChild* backgroundActor =
       BackgroundChild::GetOrCreateForCurrentThread();
   if (NS_WARN_IF(!backgroundActor)) {
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<SimpleRequestResolver> resolver = new SimpleRequestResolver(aPromise);
@@ -335,24 +335,24 @@ void RequestResolver::OnResponse(const L
       break;
     default:
       MOZ_CRASH("Unknown response type!");
   }
 }
 
 void SimpleRequestResolver::HandleResponse(nsresult aResponse) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(mPromise);
+  MOZ_ASSERT(mPromise);
 
   mPromise->MaybeReject(aResponse);
 }
 
 void SimpleRequestResolver::HandleResponse(bool aResponse) {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(mPromise);
+  MOZ_ASSERT(mPromise);
 
   mPromise->MaybeResolve(aResponse);
 }
 
 void SimpleRequestResolver::OnResponse(
     const LSSimpleRequestResponse& aResponse) {
   MOZ_ASSERT(NS_IsMainThread());