Bug 1600283 - Remove uses of already_AddRefed. r=dom-workers-and-storage-reviewers,janv
authorSimon Giesecke <sgiesecke@mozilla.com>
Mon, 16 Dec 2019 13:19:08 +0000
changeset 507100 cb0d23d69fd2cb96dedba0db099ed80eb62081db
parent 507099 e0e2cb6fa2ac2c23419d4affaac5823bd278a273
child 507101 ea17496f741b04193f15b7e14bcddbe5ae64dae9
push id36922
push userncsoregi@mozilla.com
push dateMon, 16 Dec 2019 17:21:47 +0000
treeherdermozilla-central@27d0d6cc2131 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdom-workers-and-storage-reviewers, janv
bugs1600283
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1600283 - Remove uses of already_AddRefed. r=dom-workers-and-storage-reviewers,janv Differential Revision: https://phabricator.services.mozilla.com/D55489
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -6290,20 +6290,20 @@ class TransactionBase {
   int64_t LoggingSerialNumber() const { return mLoggingSerialNumber; }
 
   bool IsAborted() const {
     AssertIsOnBackgroundThread();
 
     return NS_FAILED(mResultCode);
   }
 
-  already_AddRefed<FullObjectStoreMetadata> GetMetadataForObjectStoreId(
+  MOZ_MUST_USE RefPtr<FullObjectStoreMetadata> GetMetadataForObjectStoreId(
       int64_t aObjectStoreId) const;
 
-  already_AddRefed<FullIndexMetadata> GetMetadataForIndexId(
+  MOZ_MUST_USE RefPtr<FullIndexMetadata> GetMetadataForIndexId(
       FullObjectStoreMetadata* const aObjectStoreMetadata,
       int64_t aIndexId) const;
 
   PBackgroundParent* GetBackgroundParent() const {
     AssertIsOnBackgroundThread();
     MOZ_ASSERT(!IsActorDestroyed());
 
     return GetDatabase()->GetBackgroundParent();
@@ -8044,19 +8044,18 @@ class QuotaClient final : public mozilla
 
     return mShutdownRequested;
   }
 
   nsresult AsyncDeleteFile(FileManager* aFileManager, int64_t aFileId);
 
   nsresult FlushPendingFileDeletions();
 
-  already_AddRefed<Maintenance> GetCurrentMaintenance() const {
-    RefPtr<Maintenance> result = mCurrentMaintenance;
-    return result.forget();
+  RefPtr<Maintenance> GetCurrentMaintenance() const {
+    return mCurrentMaintenance;
   }
 
   void NoteFinishedMaintenance(Maintenance* aMaintenance) {
     AssertIsOnBackgroundThread();
     MOZ_ASSERT(aMaintenance);
     MOZ_ASSERT(mCurrentMaintenance == aMaintenance);
 
     mCurrentMaintenance = nullptr;
@@ -13789,38 +13788,38 @@ void TransactionBase::CommitOrAbort() {
     return;
   }
 
   RefPtr<CommitOp> commitOp = new CommitOp(this, ClampResultCode(mResultCode));
 
   gConnectionPool->Finish(TransactionId(), commitOp);
 }
 
-already_AddRefed<FullObjectStoreMetadata>
-TransactionBase::GetMetadataForObjectStoreId(int64_t aObjectStoreId) const {
+RefPtr<FullObjectStoreMetadata> TransactionBase::GetMetadataForObjectStoreId(
+    int64_t aObjectStoreId) const {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aObjectStoreId);
 
   if (!aObjectStoreId) {
     return nullptr;
   }
 
   RefPtr<FullObjectStoreMetadata> metadata;
   if (!mDatabase->Metadata()->mObjectStores.Get(aObjectStoreId,
                                                 getter_AddRefs(metadata)) ||
       metadata->mDeleted) {
     return nullptr;
   }
 
   MOZ_ASSERT(metadata->mCommonMetadata.id() == aObjectStoreId);
 
-  return metadata.forget();
-}
-
-already_AddRefed<FullIndexMetadata> TransactionBase::GetMetadataForIndexId(
+  return metadata;
+}
+
+RefPtr<FullIndexMetadata> TransactionBase::GetMetadataForIndexId(
     FullObjectStoreMetadata* const aObjectStoreMetadata,
     int64_t aIndexId) const {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aIndexId);
 
   if (!aIndexId) {
     return nullptr;
   }
@@ -13828,17 +13827,17 @@ already_AddRefed<FullIndexMetadata> Tran
   RefPtr<FullIndexMetadata> metadata;
   if (!aObjectStoreMetadata->mIndexes.Get(aIndexId, getter_AddRefs(metadata)) ||
       metadata->mDeleted) {
     return nullptr;
   }
 
   MOZ_ASSERT(metadata->mCommonMetadata.id() == aIndexId);
 
-  return metadata.forget();
+  return metadata;
 }
 
 void TransactionBase::NoteModifiedAutoIncrementObjectStore(
     FullObjectStoreMetadata* aMetadata) {
   AssertIsOnConnectionThread();
   MOZ_ASSERT(aMetadata);
 
   if (!mModifiedAutoIncrementObjectStoreMetadataArray.Contains(aMetadata)) {