void DatabaseTask::run()
{
    // Database tasks are meant to be used only once, so make sure this one hasn't been performed before.
#if !LOG_DISABLED
    ASSERT(!m_complete);
#endif

    if (!m_synchronizer && !m_database->databaseContext()->databaseThread()->isDatabaseOpen(m_database.get())) {
        taskCancelled();
#if !LOG_DISABLED
        m_complete = true;
#endif
        return;
    }

    WTF_LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this);

    m_database->resetAuthorizer();
    doPerformTask();

    if (m_synchronizer)
        m_synchronizer->taskCompleted();

#if !LOG_DISABLED
    m_complete = true;
#endif
}
Exemple #2
0
void DatabaseTask::run() {
// Database tasks are meant to be used only once, so make sure this one hasn't
// been performed before.
#if DCHECK_IS_ON()
  ASSERT(!m_complete);
#endif

  if (!m_completeEvent &&
      !m_database->getDatabaseContext()->databaseThread()->isDatabaseOpen(
          m_database.get())) {
    taskCancelled();
#if DCHECK_IS_ON()
    m_complete = true;
#endif
    return;
  }
#if DCHECK_IS_ON()
  STORAGE_DVLOG(1) << "Performing " << debugTaskName() << " " << this;
#endif
  m_database->resetAuthorizer();
  doPerformTask();

  if (m_completeEvent)
    m_completeEvent->signal();

#if DCHECK_IS_ON()
  m_complete = true;
#endif
}
void DatabaseTask::performTask()
{
    // Database tasks are meant to be used only once, so make sure this one hasn't been performed before.
    ASSERT(!m_complete);

    LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this);

    m_database->resetAuthorizer();
    doPerformTask();

    if (m_synchronizer)
        m_synchronizer->taskCompleted();

#ifndef NDEBUG
    m_complete = true;
#endif
}
Exemple #4
0
void DatabaseTask::performTask()
{
    // Database tasks are meant to be used only once, so make sure this one hasn't been performed before.
    ASSERT(!m_complete);

    LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this);

    m_database->resetAuthorizer();
    doPerformTask();
    m_database->performPolicyChecks();

    if (m_synchronousMutex)
        m_synchronousMutex->lock();

    m_complete = true;

    if (m_synchronousMutex) {
        m_synchronousCondition->signal();
        m_synchronousMutex->unlock();
    }
}