Bug 1600283 - Remove uses of already_AddRefed. r=dom-workers-and-storage-reviewers,janv
authorSimon Giesecke <sgiesecke@mozilla.com>
Mon, 16 Dec 2019 13:18:13 +0000
changeset 507095 ade74090bb235bde9334a487e26aa1ca67687a0b
parent 507094 56ab1907ac8a9fe9a8e14bcdc2c54dadcb6a0f4c
child 507096 4fe17aa380dc6d5d0f04a0055845c6849bf9f6ae
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/D55484
dom/indexedDB/ActorsChild.cpp
--- a/dom/indexedDB/ActorsChild.cpp
+++ b/dom/indexedDB/ActorsChild.cpp
@@ -1204,17 +1204,17 @@ class MOZ_STACK_CLASS FileHandleResultHe
       }
     }
 
     aResult.setObject(*obj);
     return NS_OK;
   }
 };
 
-already_AddRefed<File> ConvertActorToFile(
+MOZ_MUST_USE RefPtr<File> ConvertActorToFile(
     IDBFileHandle* aFileHandle, const FileRequestGetFileResponse& aResponse) {
   auto* const actor = static_cast<PendingIPCBlobChild*>(aResponse.fileChild());
 
   IDBMutableFile* mutableFile = aFileHandle->GetMutableFile();
   MOZ_ASSERT(mutableFile);
 
   const FileRequestMetadata& metadata = aResponse.metadata();
 
@@ -1227,19 +1227,17 @@ already_AddRefed<File> ConvertActorToFil
   const RefPtr<BlobImpl> blobImpl = actor->SetPendingInfoAndDeleteActor(
       mutableFile->Name(), mutableFile->Type(), size.value(),
       lastModified.value());
   MOZ_ASSERT(blobImpl);
 
   const RefPtr<BlobImpl> blobImplSnapshot =
       new BlobImplSnapshot(blobImpl, static_cast<IDBFileHandle*>(aFileHandle));
 
-  RefPtr<File> file =
-      File::Create(mutableFile->GetOwnerGlobal(), blobImplSnapshot);
-  return file.forget();
+  return File::Create(mutableFile->GetOwnerGlobal(), blobImplSnapshot);
 }
 
 void DispatchFileHandleErrorEvent(IDBFileRequest* aFileRequest,
                                   nsresult aErrorCode,
                                   IDBFileHandle* aFileHandle) {
   MOZ_ASSERT(aFileRequest);
   aFileRequest->AssertIsOnOwningThread();
   MOZ_ASSERT(NS_FAILED(aErrorCode));