Verified Commit 950483d7 authored by Randell Jesup's avatar Randell Jesup Committed by ma1
Browse files

Bug 2036931: Fix CookiePersistentStorage::mCorruptFlag data race r=cookie-reviewers,valentin

parent c653329f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -514,9 +514,10 @@ void CookiePersistentStorage::RemoveAllInternal() {
}

void CookiePersistentStorage::HandleCorruptDB() {
  COOKIE_LOGSTRING(LogLevel::Debug,
                   ("HandleCorruptDB(): CookieStorage %p has mCorruptFlag %u",
                    this, mCorruptFlag));
  COOKIE_LOGSTRING(
      LogLevel::Debug,
      ("HandleCorruptDB(): CookieStorage %p has mCorruptFlag %u", this,
       static_cast<unsigned>(static_cast<CorruptFlag>(mCorruptFlag))));

  // Mark the database corrupt, so the close listener can begin reconstructing
  // it.
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ class CookiePersistentStorage final : public CookieStorage {
  nsCOMPtr<mozIStorageAsyncStatement> mStmtDelete;
  nsCOMPtr<mozIStorageAsyncStatement> mStmtUpdate;

  CorruptFlag mCorruptFlag;
  Atomic<CorruptFlag, Relaxed> mCorruptFlag;

  // Various parts representing asynchronous read state. These are useful
  // while the background read is taking place.