Bug 1600283 - Remove uses of plain pointers. r=#dom-workers-and-storage draft
authorSimon Giesecke <sgiesecke@mozilla.com>
Wed, 04 Dec 2019 16:50:08 +0000
changeset 2516004 909f76910b6e7542d2146bc3b903443cd96ed30b
parent 2516003 db838c27cf2b26351710671c6b44f49f45ac635c
child 2516005 af4f0b2ddb35ccc35b94cf4873ca00a75981b2fe
push id460090
push userreviewbot
push dateWed, 04 Dec 2019 16:51:29 +0000
treeherdertry@35d310cdd9cf [default view] [failures only]
bugs1600283
milestone73.0a1
Bug 1600283 - Remove uses of plain pointers. r=#dom-workers-and-storage Differential Revision: https://phabricator.services.mozilla.com/D55509 Differential Diff: PHID-DIFF-245o42hvbpljqknerk55
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -8913,17 +8913,17 @@ nsresult DeleteFilesNoQuota(nsIFile* aDi
   return NS_OK;
 }
 
 // CreateMarkerFile and RemoveMarkerFile are a pair of functions to indicate
 // whether having removed all the files successfully. The marker file should
 // be checked before executing the next operation or initialization.
 nsresult CreateMarkerFile(nsIFile* aBaseDirectory,
                           const nsAString& aDatabaseNameBase,
-                          nsIFile** aMarkerFileOut) {
+                          nsCOMPtr<nsIFile>* aMarkerFileOut) {
   AssertIsOnIOThread();
   MOZ_ASSERT(aBaseDirectory);
   MOZ_ASSERT(!aDatabaseNameBase.IsEmpty());
 
   nsCOMPtr<nsIFile> markerFile;
   nsresult rv = aBaseDirectory->Clone(getter_AddRefs(markerFile));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
@@ -8934,18 +8934,17 @@ nsresult CreateMarkerFile(nsIFile* aBase
     return rv;
   }
 
   rv = markerFile->Create(nsIFile::NORMAL_FILE_TYPE, 0644);
   if (rv != NS_ERROR_FILE_ALREADY_EXISTS && NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  markerFile.forget(aMarkerFileOut);
-
+  *aMarkerFileOut = std::move(markerFile);
   return NS_OK;
 }
 
 nsresult RemoveMarkerFile(nsIFile* aMarkerFile) {
   AssertIsOnIOThread();
   MOZ_ASSERT(aMarkerFile);
 
   DebugOnly<bool> exists;
@@ -8978,18 +8977,17 @@ nsresult RemoveDatabaseFilesAndDirectory
                                          const nsAString& aDatabaseName) {
   AssertIsOnIOThread();
   MOZ_ASSERT(aBaseDirectory);
   MOZ_ASSERT(!aFilenameBase.IsEmpty());
 
   AUTO_PROFILER_LABEL("RemoveDatabaseFilesAndDirectory", DOM);
 
   nsCOMPtr<nsIFile> markerFile;
-  nsresult rv = CreateMarkerFile(aBaseDirectory, aFilenameBase,
-                                 getter_AddRefs(markerFile));
+  nsresult rv = CreateMarkerFile(aBaseDirectory, aFilenameBase, &markerFile);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // The database file counts towards quota.
   rv = DeleteFile(aBaseDirectory, aFilenameBase + kSQLiteSuffix, aQuotaManager,
                   aPersistenceType, aGroup, aOrigin);
   if (NS_WARN_IF(NS_FAILED(rv))) {