本文整理汇总了C++中EventQueue::cancelEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ EventQueue::cancelEvent方法的具体用法?C++ EventQueue::cancelEvent怎么用?C++ EventQueue::cancelEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventQueue
的用法示例。
在下文中一共展示了EventQueue::cancelEvent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: abort
void IDBRequest::abort()
{
ASSERT(!m_requestAborted);
if (m_contextStopped || !scriptExecutionContext())
return;
ASSERT(m_readyState == PENDING || m_readyState == DONE);
if (m_readyState == DONE)
return;
// Enqueued events may be the only reference to this object.
RefPtr<IDBRequest> self(this);
EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
ASSERT_UNUSED(removed, removed);
}
m_enqueuedEvents.clear();
m_errorCode = 0;
m_error.clear();
m_errorMessage = String();
m_result.clear();
onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "The transaction was aborted, so the request cannot be fulfilled."));
m_requestAborted = true;
}
示例2: closeConnection
void IDBDatabase::closeConnection() {
DCHECK(m_closePending);
DCHECK(m_transactions.isEmpty());
if (m_backend) {
m_backend->close();
m_backend.reset();
}
if (m_databaseCallbacks)
m_databaseCallbacks->detachWebCallbacks();
if (m_contextStopped || !getExecutionContext())
return;
EventQueue* eventQueue = getExecutionContext()->getEventQueue();
// Remove any pending versionchange events scheduled to fire on this
// connection. They would have been scheduled by the backend when another
// connection attempted an upgrade, but the frontend connection is being
// closed before they could fire.
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
DCHECK(removed);
}
}
示例3: close
void IDBDatabase::close()
{
if (m_noNewTransactions)
return;
ASSERT(scriptExecutionContext()->isDocument());
EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
// Remove any pending versionchange events scheduled to fire on this
// connection. They would have been scheduled by the backend when another
// connection called setVersion, but the frontend connection is being
// closed before they could fire.
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
ASSERT_UNUSED(removed, removed);
}
m_noNewTransactions = true;
m_backend->close(m_databaseCallbacks);
}
示例4: closeConnection
void IDBDatabase::closeConnection()
{
ASSERT(m_closePending);
ASSERT(m_transactions.isEmpty());
m_backend->close(m_databaseCallbacks);
if (m_contextStopped || !scriptExecutionContext())
return;
EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
// Remove any pending versionchange events scheduled to fire on this
// connection. They would have been scheduled by the backend when another
// connection called setVersion, but the frontend connection is being
// closed before they could fire.
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
ASSERT_UNUSED(removed, removed);
}
}
示例5: abort
void IDBRequest::abort()
{
ASSERT(!m_requestAborted);
if (m_contextStopped || !executionContext())
return;
ASSERT(m_readyState == PENDING || m_readyState == DONE);
if (m_readyState == DONE)
return;
EventQueue* eventQueue = executionContext()->eventQueue();
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
ASSERT_UNUSED(removed, removed);
}
m_enqueuedEvents.clear();
m_error.clear();
m_result.clear();
onError(DOMError::create(AbortError, "The transaction was aborted, so the request cannot be fulfilled."));
m_requestAborted = true;
}
示例6: abort
void IDBRequest::abort()
{
if (m_readyState != LOADING) {
ASSERT(m_readyState == DONE);
return;
}
// FIXME: Remove isDocument check when
// https://bugs.webkit.org/show_bug.cgi?id=57789 is resolved.
if (!scriptExecutionContext() || !scriptExecutionContext()->isDocument())
return;
EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
ASSERT_UNUSED(removed, removed);
}
m_enqueuedEvents.clear();
m_errorCode = 0;
m_errorMessage = String();
m_result.clear();
onError(IDBDatabaseError::create(IDBDatabaseException::ABORT_ERR, "The transaction was aborted, so the request cannot be fulfilled."));
}