Bug 1600906 - Make use of FlippedOnce in VersionChangeTransaction. r=dom-workers-and-storage-reviewers,ytausky
authorSimon Giesecke <sgiesecke@mozilla.com>
Tue, 03 Dec 2019 18:14:37 +0000
changeset 505287 d6c086ca57803c699016d97f940c49619642b769
parent 505286 808799f11727c9d66f4beeb9f876a40cdca1c83e
child 505288 eb47fe3b844605edd50d4c587a77658debc60ca6
push id36881
push userdvarga@mozilla.com
push dateWed, 04 Dec 2019 16:22:31 +0000
treeherdermozilla-central@13fb375eaf14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdom-workers-and-storage-reviewers, ytausky
bugs1600906
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 1600906 - Make use of FlippedOnce in VersionChangeTransaction. r=dom-workers-and-storage-reviewers,ytausky Depends on D55081 Differential Revision: https://phabricator.services.mozilla.com/D55674
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -6458,17 +6458,17 @@ class NormalTransaction final : public T
 class VersionChangeTransaction final
     : public TransactionBase,
       public PBackgroundIDBVersionChangeTransactionParent {
   friend class OpenDatabaseOp;
 
   RefPtr<OpenDatabaseOp> mOpenDatabaseOp;
   RefPtr<FullDatabaseMetadata> mOldMetadata;
 
-  bool mActorWasAlive;
+  FlippedOnce<false> mActorWasAlive;
 
  private:
   // Only called by OpenDatabaseOp.
   explicit VersionChangeTransaction(OpenDatabaseOp* aOpenDatabaseOp);
 
   // Reference counted.
   ~VersionChangeTransaction() override;
 
@@ -14641,18 +14641,17 @@ bool NormalTransaction::DeallocPBackgrou
 /*******************************************************************************
  * VersionChangeTransaction
  ******************************************************************************/
 
 VersionChangeTransaction::VersionChangeTransaction(
     OpenDatabaseOp* aOpenDatabaseOp)
     : TransactionBase(aOpenDatabaseOp->mDatabase,
                       IDBTransaction::Mode::VersionChange),
-      mOpenDatabaseOp(aOpenDatabaseOp),
-      mActorWasAlive(false) {
+      mOpenDatabaseOp(aOpenDatabaseOp) {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aOpenDatabaseOp);
 }
 
 VersionChangeTransaction::~VersionChangeTransaction() {
 #ifdef DEBUG
   // Silence the base class' destructor assertion if we never made this actor
   // live.
@@ -14666,20 +14665,19 @@ bool VersionChangeTransaction::IsSamePro
   PBackgroundParent* actor = Manager()->Manager()->Manager();
   MOZ_ASSERT(actor);
 
   return !BackgroundParent::IsOtherProcessActor(actor);
 }
 
 void VersionChangeTransaction::SetActorAlive() {
   AssertIsOnBackgroundThread();
-  MOZ_ASSERT(!mActorWasAlive);
   MOZ_ASSERT(!IsActorDestroyed());
 
-  mActorWasAlive = true;
+  mActorWasAlive.Flip();
 
   // This reference will be absorbed by IPDL and released when the actor is
   // destroyed.
   AddRef();
 }
 
 bool VersionChangeTransaction::CopyDatabaseMetadata() {
   AssertIsOnBackgroundThread();