// This is called if the associated ExecutionContext is destructing while // we're still associated with it. That's our cue to disassociate and shutdown. // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. void DatabaseContext::contextDestroyed() { stopDatabases(); ActiveDOMObject::contextDestroyed(); #if !defined(S_DATABASE_TRACKER) deref(); // paired with the ref() call on create(). #endif }
void DatabaseManager::stopDatabases(ScriptExecutionContext& context, DatabaseTaskSynchronizer* synchronizer) { auto databaseContext = context.databaseContext(); if (!databaseContext || !databaseContext->stopDatabases(synchronizer)) { if (synchronizer) synchronizer->taskCompleted(); } }
DatabaseContext::~DatabaseContext() { stopDatabases(); ASSERT(!m_databaseThread || m_databaseThread->terminationRequested()); // For debug accounting only. We must call this last. The assertions assume // this. DatabaseManager::manager().didDestructDatabaseContext(); }
// This is called if the associated ExecutionContext is destructing while // we're still associated with it. That's our cue to disassociate and shutdown. // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. void DatabaseContext::contextDestroyed() { RefPtrWillBeRawPtr<DatabaseContext> protector(this); stopDatabases(); if (executionContext()->isWorkerGlobalScope()) toWorkerGlobalScope(executionContext())->unregisterTerminationObserver(this); DatabaseManager::manager().unregisterDatabaseContext(this); ActiveDOMObject::contextDestroyed(); }
// This is called if the associated ScriptExecutionContext is destructing while // we're still associated with it. That's our cue to disassociate and shutdown. // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. void DatabaseContext::contextDestroyed() { stopDatabases(); // Normally, willDestroyActiveDOMObject() is called in ~ActiveDOMObject(). // However, we're here because the destructor hasn't been called, and the // ScriptExecutionContext we're associated with is about to be destructed. // So, go ahead an unregister self from the ActiveDOMObject list, and // set m_scriptExecutionContext to 0 so that ~ActiveDOMObject() doesn't // try to do so again. m_scriptExecutionContext->willDestroyActiveDOMObject(this); m_scriptExecutionContext = 0; }
// stop() is from stopActiveDOMObjects() which indicates that the owner LocalFrame // or WorkerThread is shutting down. Initiate the orderly shutdown by stopping // the associated databases. void DatabaseContext::stop() { stopDatabases(); }
// This is called if the associated ExecutionContext is destructing while // we're still associated with it. That's our cue to disassociate and shutdown. // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. void DatabaseContext::contextDestroyed() { stopDatabases(); ActiveDOMObject::contextDestroyed(); deref(); // paired with the ref() call on create(). }
// This is called if the associated ExecutionContext is destructing while // we're still associated with it. That's our cue to disassociate and shutdown. // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. void DatabaseContext::contextDestroyed() { stopDatabases(); DatabaseManager::manager().unregisterDatabaseContext(this); ActiveDOMObject::contextDestroyed(); }
// This is called if the associated ScriptExecutionContext is destructing while // we're still associated with it. That's our cue to disassociate and shutdown. // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. void DatabaseContext::contextDestroyed() { stopDatabases(); ActiveDOMObject::contextDestroyed(); }