summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/webdatabase/database.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/webdatabase/database.cc')
-rw-r--r--chromium/third_party/blink/renderer/modules/webdatabase/database.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database.cc
index dc8fcd38ba6..999d4bc666a 100644
--- a/chromium/third_party/blink/renderer/modules/webdatabase/database.cc
+++ b/chromium/third_party/blink/renderer/modules/webdatabase/database.cc
@@ -53,7 +53,6 @@
#include "third_party/blink/renderer/platform/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/waitable_event.h"
-#include "third_party/blink/renderer/platform/wtf/atomics.h"
// Registering "opened" databases with the DatabaseTracker
// =======================================================
@@ -225,7 +224,7 @@ Database::Database(DatabaseContext* database_context,
display_name_(display_name.IsolatedCopy()),
estimated_size_(estimated_size),
guid_(0),
- opened_(0),
+ opened_(false),
new_(false),
transaction_in_progress_(false),
is_transaction_queue_enabled_(true) {
@@ -266,7 +265,7 @@ Database::~Database() {
// DatabaseContext::stopDatabases()). By the time we get here, the SQLite
// database should have already been closed.
- DCHECK(!opened_);
+ DCHECK(!Opened());
}
void Database::Trace(blink::Visitor* visitor) {
@@ -411,10 +410,10 @@ const char* Database::DatabaseInfoTableName() {
}
void Database::CloseDatabase() {
- if (!opened_)
+ if (!opened_.load(std::memory_order_relaxed))
return;
- ReleaseStore(&opened_, 0);
+ opened_.store(false, std::memory_order_release);
sqlite_database_.Close();
// See comment at the top this file regarding calling removeOpenDatabase().
DatabaseTracker::Tracker().RemoveOpenDatabase(this);
@@ -590,7 +589,7 @@ bool Database::PerformOpenAndVerify(bool should_set_version_in_new_database,
// See comment at the top this file regarding calling addOpenDatabase().
DatabaseTracker::Tracker().AddOpenDatabase(this);
- opened_ = 1;
+ opened_.store(true, std::memory_order_release);
// Declare success:
error = DatabaseError::kNone; // Clear the presumed error from above.
@@ -924,10 +923,6 @@ const SecurityOrigin* Database::GetSecurityOrigin() const {
return nullptr;
}
-bool Database::Opened() {
- return static_cast<bool>(AcquireLoad(&opened_));
-}
-
base::SingleThreadTaskRunner* Database::GetDatabaseTaskRunner() const {
return database_task_runner_.get();
}