Bug 1767989 - Apply readability-make-member-function-const on dom/indexedDB r=dom-storage-reviewers,janv

Differential Revision: https://phabricator.services.mozilla.com/D145624
This commit is contained in:
Kagami Sascha Rosylight 2022-05-05 18:11:55 +00:00
Родитель c9368d48f0
Коммит 38896528d7
8 изменённых файлов: 35 добавлений и 29 удалений

Просмотреть файл

@ -1239,7 +1239,8 @@ bool BackgroundFactoryChild::DeallocPBackgroundIDBFactoryRequestChild(
PBackgroundIDBDatabaseChild*
BackgroundFactoryChild::AllocPBackgroundIDBDatabaseChild(
const DatabaseSpec& aSpec, PBackgroundIDBFactoryRequestChild* aRequest) {
const DatabaseSpec& aSpec,
PBackgroundIDBFactoryRequestChild* aRequest) const {
AssertIsOnOwningThread();
auto* const request = static_cast<BackgroundFactoryRequestChild*>(aRequest);
@ -1651,7 +1652,7 @@ BackgroundDatabaseChild::AllocPBackgroundIDBDatabaseFileChild(
}
bool BackgroundDatabaseChild::DeallocPBackgroundIDBDatabaseFileChild(
PBackgroundIDBDatabaseFileChild* aActor) {
PBackgroundIDBDatabaseFileChild* aActor) const {
AssertIsOnOwningThread();
MOZ_ASSERT(aActor);
@ -1752,7 +1753,7 @@ BackgroundDatabaseChild::RecvPBackgroundIDBVersionChangeTransactionConstructor(
PBackgroundMutableFileChild*
BackgroundDatabaseChild::AllocPBackgroundMutableFileChild(
const nsString& aName, const nsString& aType) {
const nsString& aName, const nsString& aType) const {
AssertIsOnOwningThread();
return new BackgroundMutableFileChild(aName, aType);
@ -2265,7 +2266,7 @@ BackgroundMutableFileChild::AllocPBackgroundFileHandleChild(
}
bool BackgroundMutableFileChild::DeallocPBackgroundFileHandleChild(
PBackgroundFileHandleChild* aActor) {
PBackgroundFileHandleChild* aActor) const {
AssertIsOnOwningThread();
MOZ_ASSERT(aActor);

Просмотреть файл

@ -114,7 +114,8 @@ class BackgroundFactoryChild final : public PBackgroundIDBFactoryChild {
PBackgroundIDBFactoryRequestChild* aActor);
PBackgroundIDBDatabaseChild* AllocPBackgroundIDBDatabaseChild(
const DatabaseSpec& aSpec, PBackgroundIDBFactoryRequestChild* aRequest);
const DatabaseSpec& aSpec,
PBackgroundIDBFactoryRequestChild* aRequest) const;
bool DeallocPBackgroundIDBDatabaseChild(PBackgroundIDBDatabaseChild* aActor);
@ -261,7 +262,7 @@ class BackgroundDatabaseChild final : public PBackgroundIDBDatabaseChild {
const IPCBlob& aIPCBlob);
bool DeallocPBackgroundIDBDatabaseFileChild(
PBackgroundIDBDatabaseFileChild* aActor);
PBackgroundIDBDatabaseFileChild* aActor) const;
PBackgroundIDBDatabaseRequestChild* AllocPBackgroundIDBDatabaseRequestChild(
const DatabaseRequestParams& aParams);
@ -281,7 +282,7 @@ class BackgroundDatabaseChild final : public PBackgroundIDBDatabaseChild {
const int64_t& aNextObjectStoreId, const int64_t& aNextIndexId) override;
PBackgroundMutableFileChild* AllocPBackgroundMutableFileChild(
const nsString& aName, const nsString& aType);
const nsString& aName, const nsString& aType) const;
bool DeallocPBackgroundMutableFileChild(PBackgroundMutableFileChild* aActor);
@ -493,7 +494,8 @@ class BackgroundMutableFileChild final : public PBackgroundMutableFileChild {
PBackgroundFileHandleChild* AllocPBackgroundFileHandleChild(
const FileMode& aMode);
bool DeallocPBackgroundFileHandleChild(PBackgroundFileHandleChild* aActor);
bool DeallocPBackgroundFileHandleChild(
PBackgroundFileHandleChild* aActor) const;
};
class BackgroundRequestChild final : public BackgroundRequestChildBase,

Просмотреть файл

@ -1583,7 +1583,7 @@ class ConnectionPool final {
void PerformIdleDatabaseMaintenance(DatabaseInfo& aDatabaseInfo);
void CloseDatabase(DatabaseInfo& aDatabaseInfo);
void CloseDatabase(DatabaseInfo& aDatabaseInfo) const;
bool CloseDatabaseWhenIdleInternal(const nsACString& aDatabaseId);
};
@ -3638,7 +3638,8 @@ class CreateIndexOp final : public VersionChangeTransactionOp {
nsresult InsertDataFromObjectStore(DatabaseConnection* aConnection);
nsresult InsertDataFromObjectStoreInternal(DatabaseConnection* aConnection);
nsresult InsertDataFromObjectStoreInternal(
DatabaseConnection* aConnection) const;
bool Init(TransactionBase& aTransaction) override;
@ -3688,9 +3689,9 @@ class DeleteIndexOp final : public VersionChangeTransactionOp {
~DeleteIndexOp() override = default;
nsresult RemoveReferencesToIndex(DatabaseConnection* aConnection,
const Key& aObjectDataKey,
nsTArray<IndexDataValue>& aIndexValues);
nsresult RemoveReferencesToIndex(
DatabaseConnection* aConnection, const Key& aObjectDataKey,
nsTArray<IndexDataValue>& aIndexValues) const;
nsresult DoDatabaseWork(DatabaseConnection* aConnection) override;
};
@ -8653,7 +8654,7 @@ void ConnectionPool::PerformIdleDatabaseMaintenance(
NS_DISPATCH_NORMAL));
}
void ConnectionPool::CloseDatabase(DatabaseInfo& aDatabaseInfo) {
void ConnectionPool::CloseDatabase(DatabaseInfo& aDatabaseInfo) const {
AssertIsOnOwningThread();
MOZ_DIAGNOSTIC_ASSERT(!aDatabaseInfo.TotalTransactionCount());
aDatabaseInfo.mThreadInfo.AssertValid();
@ -12413,7 +12414,7 @@ nsresult DatabaseFileManager::SyncDeleteFile(const int64_t aId) {
}
nsresult DatabaseFileManager::SyncDeleteFile(nsIFile& aFile,
nsIFile& aJournalFile) {
nsIFile& aJournalFile) const {
QuotaManager* const quotaManager =
EnforcingQuota() ? QuotaManager::Get() : nullptr;
MOZ_ASSERT_IF(EnforcingQuota(), quotaManager);
@ -18437,7 +18438,7 @@ nsresult CreateIndexOp::InsertDataFromObjectStore(
}
nsresult CreateIndexOp::InsertDataFromObjectStoreInternal(
DatabaseConnection* aConnection) {
DatabaseConnection* aConnection) const {
MOZ_ASSERT(aConnection);
aConnection->AssertIsOnConnectionThread();
MOZ_ASSERT(mMaybeUniqueIndexTable);
@ -18759,7 +18760,7 @@ DeleteIndexOp::DeleteIndexOp(SafeRefPtr<VersionChangeTransaction> aTransaction,
nsresult DeleteIndexOp::RemoveReferencesToIndex(
DatabaseConnection* aConnection, const Key& aObjectStoreKey,
nsTArray<IndexDataValue>& aIndexValues) {
nsTArray<IndexDataValue>& aIndexValues) const {
MOZ_ASSERT(!NS_IsMainThread());
MOZ_ASSERT(!IsOnBackgroundThread());
MOZ_ASSERT(aConnection);

Просмотреть файл

@ -87,7 +87,8 @@ class DatabaseFileManager final
// XXX When getting rid of FileHelper, this method should be removed/made
// private.
[[nodiscard]] nsresult SyncDeleteFile(nsIFile& aFile, nsIFile& aJournalFile);
[[nodiscard]] nsresult SyncDeleteFile(nsIFile& aFile,
nsIFile& aJournalFile) const;
[[nodiscard]] nsresult AsyncDeleteFile(int64_t aFileId);

Просмотреть файл

@ -369,7 +369,7 @@ void IDBFileHandle::Abort(ErrorResult& aRv) {
Abort();
}
bool IDBFileHandle::CheckState(ErrorResult& aRv) {
bool IDBFileHandle::CheckState(ErrorResult& aRv) const {
if (!IsOpen()) {
aRv.Throw(NS_ERROR_DOM_FILEHANDLE_INACTIVE_ERR);
return false;

Просмотреть файл

@ -208,7 +208,7 @@ class IDBFileHandle final : public DOMEventTargetHelper,
IDBFileHandle(IDBMutableFile* aMutableFile, FileMode aMode);
~IDBFileHandle();
bool CheckState(ErrorResult& aRv);
bool CheckState(ErrorResult& aRv) const;
bool CheckStateAndArgumentsForRead(uint64_t aSize, ErrorResult& aRv);

Просмотреть файл

@ -530,7 +530,7 @@ void IDBTransaction::DeleteObjectStore(const int64_t aObjectStoreId) {
}
void IDBTransaction::RenameObjectStore(const int64_t aObjectStoreId,
const nsAString& aName) {
const nsAString& aName) const {
AssertIsOnOwningThread();
MOZ_ASSERT(aObjectStoreId);
MOZ_ASSERT(Mode::VersionChange == mMode);
@ -542,8 +542,9 @@ void IDBTransaction::RenameObjectStore(const int64_t aObjectStoreId,
aObjectStoreId, nsString(aName)));
}
void IDBTransaction::CreateIndex(IDBObjectStore* const aObjectStore,
const indexedDB::IndexMetadata& aMetadata) {
void IDBTransaction::CreateIndex(
IDBObjectStore* const aObjectStore,
const indexedDB::IndexMetadata& aMetadata) const {
AssertIsOnOwningThread();
MOZ_ASSERT(aObjectStore);
MOZ_ASSERT(aMetadata.id());
@ -557,7 +558,7 @@ void IDBTransaction::CreateIndex(IDBObjectStore* const aObjectStore,
}
void IDBTransaction::DeleteIndex(IDBObjectStore* const aObjectStore,
const int64_t aIndexId) {
const int64_t aIndexId) const {
AssertIsOnOwningThread();
MOZ_ASSERT(aObjectStore);
MOZ_ASSERT(aIndexId);
@ -572,7 +573,7 @@ void IDBTransaction::DeleteIndex(IDBObjectStore* const aObjectStore,
void IDBTransaction::RenameIndex(IDBObjectStore* const aObjectStore,
const int64_t aIndexId,
const nsAString& aName) {
const nsAString& aName) const {
AssertIsOnOwningThread();
MOZ_ASSERT(aObjectStore);
MOZ_ASSERT(aIndexId);

Просмотреть файл

@ -250,15 +250,15 @@ class IDBTransaction final
void DeleteObjectStore(int64_t aObjectStoreId);
void RenameObjectStore(int64_t aObjectStoreId, const nsAString& aName);
void RenameObjectStore(int64_t aObjectStoreId, const nsAString& aName) const;
void CreateIndex(IDBObjectStore* aObjectStore,
const indexedDB::IndexMetadata& aMetadata);
const indexedDB::IndexMetadata& aMetadata) const;
void DeleteIndex(IDBObjectStore* aObjectStore, int64_t aIndexId);
void DeleteIndex(IDBObjectStore* aObjectStore, int64_t aIndexId) const;
void RenameIndex(IDBObjectStore* aObjectStore, int64_t aIndexId,
const nsAString& aName);
const nsAString& aName) const;
void Abort(IDBRequest* aRequest);