Bug 1600283 - Use std::move instead of forget/swap. r=#dom-workers-and-storage draft
authorSimon Giesecke <sgiesecke@mozilla.com>
Wed, 04 Dec 2019 16:50:13 +0000
changeset 2516005 af4f0b2ddb35ccc35b94cf4873ca00a75981b2fe
parent 2516004 909f76910b6e7542d2146bc3b903443cd96ed30b
child 2516006 60ce6217362c27b7e08855e6e5abea958d0e2bdc
push id460090
push userreviewbot
push dateWed, 04 Dec 2019 16:51:29 +0000
treeherdertry@35d310cdd9cf [default view] [failures only]
bugs1600283
milestone73.0a1
Bug 1600283 - Use std::move instead of forget/swap. r=#dom-workers-and-storage Differential Revision: https://phabricator.services.mozilla.com/D55510 Differential Diff: PHID-DIFF-semkeojeuwef67mezv4o
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ActorsParent.h"
 
 #include <algorithm>
 #include <numeric>
 #include <stdint.h>  // UINTPTR_MAX, uintptr_t
+#include <utility>
 #include "FileInfo.h"
 #include "FileManager.h"
 #include "IDBObjectStore.h"
 #include "IDBTransaction.h"
 #include "IndexedDatabase.h"
 #include "IndexedDatabaseInlines.h"
 #include "IndexedDatabaseManager.h"
 #include "js/StructuredClone.h"
@@ -14673,18 +14674,18 @@ bool VersionChangeTransaction::CopyDatab
 
   // Replace the live metadata with the new mutable copy.
   DatabaseActorInfo* info;
   MOZ_ALWAYS_TRUE(
       gLiveDatabaseHashtable->Get(origMetadata->mDatabaseId, &info));
   MOZ_ASSERT(!info->mLiveDatabases.IsEmpty());
   MOZ_ASSERT(info->mMetadata == origMetadata);
 
-  mOldMetadata = info->mMetadata.forget();
-  info->mMetadata.swap(newMetadata);
+  mOldMetadata = std::move(info->mMetadata);
+  info->mMetadata = std::move(newMetadata);
 
   // Replace metadata pointers for all live databases.
   for (const auto& liveDatabase : info->mLiveDatabases) {
     liveDatabase->mMetadata = info->mMetadata;
   }
 
   return true;
 }
@@ -14733,17 +14734,17 @@ void VersionChangeTransaction::UpdateMet
           indexIter.Remove();
         }
       }
       metadata->mIndexes.MarkImmutable();
     }
     info->mMetadata->mObjectStores.MarkImmutable();
   } else {
     // Replace metadata pointers for all live databases.
-    info->mMetadata = oldMetadata.forget();
+    info->mMetadata = std::move(oldMetadata);
 
     for (auto& liveDatabase : info->mLiveDatabases) {
       liveDatabase->mMetadata = info->mMetadata;
     }
   }
 }
 
 void VersionChangeTransaction::SendCompleteNotification(nsresult aResult) {