void DatabaseManager::stopDatabases(ScriptExecutionContext& context, DatabaseTaskSynchronizer* synchronizer) { auto databaseContext = context.databaseContext(); if (!databaseContext || !databaseContext->stopDatabases(synchronizer)) { if (synchronizer) synchronizer->taskCompleted(); } }
Ref<DatabaseContext> DatabaseManager::databaseContext(ScriptExecutionContext& context) { if (auto databaseContext = context.databaseContext()) return *databaseContext; return adoptRef(*new DatabaseContext(context)); }
bool DatabaseManager::hasOpenDatabases(ScriptExecutionContext& context) { auto databaseContext = context.databaseContext(); return databaseContext && databaseContext->hasOpenDatabases(); }