本文整理汇总了C++中ExecutionContext::isContextDestroyed方法的典型用法代码示例。如果您正苦于以下问题:C++ ExecutionContext::isContextDestroyed方法的具体用法?C++ ExecutionContext::isContextDestroyed怎么用?C++ ExecutionContext::isContextDestroyed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExecutionContext
的用法示例。
在下文中一共展示了ExecutionContext::isContextDestroyed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: call
bool VoidCallbackFunctionInterfaceArg::call(ScriptWrappable* scriptWrappable, HTMLDivElement* divElement) {
if (!m_scriptState->contextIsValid())
return false;
ExecutionContext* context = m_scriptState->getExecutionContext();
DCHECK(context);
if (context->activeDOMObjectsAreSuspended() || context->isContextDestroyed())
return false;
if (m_callback.isEmpty())
return false;
// TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK.
// crbug.com/653769
DummyExceptionStateForTesting exceptionState;
ScriptState::Scope scope(m_scriptState.get());
v8::Local<v8::Value> divElementArgument = toV8(divElement, m_scriptState->context()->Global(), m_scriptState->isolate());
v8::Local<v8::Value> thisValue = toV8(scriptWrappable, m_scriptState->context()->Global(), m_scriptState->isolate());
v8::Local<v8::Value> argv[] = { divElementArgument };
v8::Local<v8::Value> v8ReturnValue;
v8::TryCatch exceptionCatcher(m_scriptState->isolate());
exceptionCatcher.SetVerbose(true);
if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()), m_scriptState->getExecutionContext(), thisValue, 1, argv, m_scriptState->isolate()).ToLocal(&v8ReturnValue)) {
return true;
}
return false;
}