本文整理汇总了C++中JSGlobalObject::stopTimeoutCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ JSGlobalObject::stopTimeoutCheck方法的具体用法?C++ JSGlobalObject::stopTimeoutCheck怎么用?C++ JSGlobalObject::stopTimeoutCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSGlobalObject
的用法示例。
在下文中一共展示了JSGlobalObject::stopTimeoutCheck方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleEvent
bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLError* error)
{
ASSERT(m_callback);
ASSERT(m_frame);
if (!m_frame->script()->isEnabled())
return true;
JSGlobalObject* globalObject = m_frame->script()->globalObject();
ExecState* exec = globalObject->globalExec();
KJS::JSLock lock;
JSValue* handleEventFunction = m_callback->get(exec, Identifier(exec, "handleEvent"));
CallData handleEventCallData;
CallType handleEventCallType = handleEventFunction->getCallData(handleEventCallData);
CallData callbackCallData;
CallType callbackCallType = CallTypeNone;
if (handleEventCallType == CallTypeNone) {
callbackCallType = m_callback->getCallData(callbackCallData);
if (callbackCallType == CallTypeNone) {
// FIXME: Should an exception be thrown here?
return true;
}
}
RefPtr<JSCustomSQLStatementErrorCallback> protect(this);
ArgList args;
args.append(toJS(exec, transaction));
args.append(toJS(exec, error));
JSValue* result;
globalObject->startTimeoutCheck();
if (handleEventCallType != CallTypeNone)
result = call(exec, handleEventFunction, handleEventCallType, handleEventCallData, m_callback, args);
else
result = call(exec, m_callback, callbackCallType, callbackCallData, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
JSObject* exception = exec->exception()->toObject(exec);
String message = exception->get(exec, exec->propertyNames().message)->toString(exec);
int lineNumber = exception->get(exec, Identifier(exec, "line"))->toInt32(exec);
String sourceURL = exception->get(exec, Identifier(exec, "sourceURL"))->toString(exec);
m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL);
exec->clearException();
// The spec says:
// "If the error callback returns false, then move on to the next statement..."
// "Otherwise, the error callback did not return false, or there was no error callback"
// Therefore an exception and returning true are the same thing - so, return true on an exception
return true;
}
Document::updateDocumentsRendering();
return result->toBoolean(exec);
}
示例2: handleEvent
bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLError* error)
{
ASSERT(m_callback);
ASSERT(m_frame);
if (!m_frame->script()->isEnabled())
return true;
JSGlobalObject* globalObject = m_frame->script()->globalObject();
ExecState* exec = globalObject->globalExec();
JSC::JSLock lock(false);
JSValue* handleEventFunction = m_callback->get(exec, Identifier(exec, "handleEvent"));
CallData handleEventCallData;
CallType handleEventCallType = handleEventFunction->getCallData(handleEventCallData);
CallData callbackCallData;
CallType callbackCallType = CallTypeNone;
if (handleEventCallType == CallTypeNone) {
callbackCallType = m_callback->getCallData(callbackCallData);
if (callbackCallType == CallTypeNone) {
// FIXME: Should an exception be thrown here?
return true;
}
}
RefPtr<JSCustomSQLStatementErrorCallback> protect(this);
ArgList args;
args.append(toJS(exec, transaction));
args.append(toJS(exec, error));
JSValue* result;
globalObject->startTimeoutCheck();
if (handleEventCallType != CallTypeNone)
result = call(exec, handleEventFunction, handleEventCallType, handleEventCallData, m_callback, args);
else
result = call(exec, m_callback, callbackCallType, callbackCallData, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
reportCurrentException(exec);
// The spec says:
// "If the error callback returns false, then move on to the next statement..."
// "Otherwise, the error callback did not return false, or there was no error callback"
// Therefore an exception and returning true are the same thing - so, return true on an exception
return true;
}
Document::updateDocumentsRendering();
return result->toBoolean(exec);
}
示例3: handleEvent
void JSCustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bool& raisedException)
{
ASSERT(m_data);
ASSERT(m_data->callback());
ASSERT(m_data->frame());
if (!m_data->frame()->script()->isEnabled())
return;
JSGlobalObject* globalObject = m_data->frame()->script()->globalObject();
ExecState* exec = globalObject->globalExec();
JSC::JSLock lock(false);
JSValue* handleEventFunction = m_data->callback()->get(exec, Identifier(exec, "handleEvent"));
CallData handleEventCallData;
CallType handleEventCallType = handleEventFunction->getCallData(handleEventCallData);
CallData callbackCallData;
CallType callbackCallType = CallTypeNone;
if (handleEventCallType == CallTypeNone) {
callbackCallType = m_data->callback()->getCallData(callbackCallData);
if (callbackCallType == CallTypeNone) {
// FIXME: Should an exception be thrown here?
return;
}
}
RefPtr<JSCustomSQLTransactionCallback> protect(this);
ArgList args;
args.append(toJS(exec, transaction));
globalObject->startTimeoutCheck();
if (handleEventCallType != CallTypeNone)
call(exec, handleEventFunction, handleEventCallType, handleEventCallData, m_data->callback(), args);
else
call(exec, m_data->callback(), callbackCallType, callbackCallData, m_data->callback(), args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
m_data->frame()->domWindow()->console()->reportCurrentException(exec);
raisedException = true;
}
Document::updateDocumentsRendering();
}
示例4: lookupNamespaceURI
String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
{
ASSERT(m_customResolver);
if (!m_frame)
return String();
if (!m_frame->script()->isEnabled())
return String();
JSLock lock(false);
JSGlobalObject* globalObject = m_frame->script()->globalObject();
ExecState* exec = globalObject->globalExec();
JSValue* function = m_customResolver->get(exec, Identifier(exec, "lookupNamespaceURI"));
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone) {
callType = m_customResolver->getCallData(callData);
if (callType == CallTypeNone) {
// FIXME: Pass actual line number and source URL.
m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.", 0, String());
return String();
}
function = m_customResolver;
}
RefPtr<JSCustomXPathNSResolver> selfProtector(this);
ArgList args;
args.append(jsString(exec, prefix));
globalObject->startTimeoutCheck();
JSValue* retval = call(exec, function, callType, callData, m_customResolver, args);
globalObject->stopTimeoutCheck();
String result;
if (exec->hadException())
reportCurrentException(exec);
else {
if (!retval->isUndefinedOrNull())
result = retval->toString(exec);
}
Document::updateDocumentsRendering();
return result;
}
示例5: handleEvent
void JSCustomVoidCallback::handleEvent()
{
ASSERT(m_callback);
ASSERT(m_frame);
if (!m_frame->script()->isEnabled())
return;
JSGlobalObject* globalObject = m_frame->script()->globalObject();
ExecState* exec = globalObject->globalExec();
KJS::JSLock lock;
JSValue* function = m_callback->get(exec, Identifier(exec, "handleEvent"));
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone) {
callType = m_callback->getCallData(callData);
if (callType == CallTypeNone) {
// FIXME: Should an exception be thrown here?
return;
}
function = m_callback;
}
RefPtr<JSCustomVoidCallback> protect(this);
ArgList args;
globalObject->startTimeoutCheck();
call(exec, function, callType, callData, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
JSObject* exception = exec->exception()->toObject(exec);
String message = exception->get(exec, exec->propertyNames().message)->toString(exec);
int lineNumber = exception->get(exec, Identifier(exec, "line"))->toInt32(exec);
String sourceURL = exception->get(exec, Identifier(exec, "sourceURL"))->toString(exec);
m_frame->domWindow()->console()->addMessage(JSMessageSource, ErrorMessageLevel, message, lineNumber, sourceURL);
exec->clearException();
}
Document::updateDocumentsRendering();
}
示例6: handleEvent
void JSCustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException)
{
ASSERT(m_callback);
ASSERT(m_frame);
if (!m_frame->script()->isEnabled())
return;
JSGlobalObject* globalObject = m_frame->script()->globalObject();
ExecState* exec = globalObject->globalExec();
JSC::JSLock lock(false);
JSValuePtr function = m_callback->get(exec, Identifier(exec, "handleEvent"));
CallData callData;
CallType callType = function.getCallData(callData);
if (callType == CallTypeNone) {
callType = m_callback->getCallData(callData);
if (callType == CallTypeNone) {
// FIXME: Should an exception be thrown here?
return;
}
function = m_callback;
}
RefPtr<JSCustomSQLStatementCallback> protect(this);
ArgList args;
args.append(toJS(exec, transaction));
args.append(toJS(exec, resultSet));
globalObject->startTimeoutCheck();
call(exec, function, callType, callData, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException()) {
reportCurrentException(exec);
raisedException = true;
}
Document::updateDocumentsRendering();
}
示例7: handleEvent
bool JSCustomSQLTransactionErrorCallback::handleEvent(SQLError* error)
{
ASSERT(m_callback);
ASSERT(m_frame);
if (!m_frame->script()->isEnabled())
return true;
JSGlobalObject* globalObject = m_frame->script()->globalObject();
ExecState* exec = globalObject->globalExec();
JSC::JSLock lock(false);
JSValue* function = m_callback->get(exec, Identifier(exec, "handleEvent"));
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone) {
callType = m_callback->getCallData(callData);
if (callType == CallTypeNone) {
// FIXME: Should an exception be thrown here?
return true;
}
function = m_callback;
}
RefPtr<JSCustomSQLTransactionErrorCallback> protect(this);
ArgList args;
args.append(toJS(exec, error));
JSValue *result;
globalObject->startTimeoutCheck();
result = call(exec, function, callType, callData, m_callback, args);
globalObject->stopTimeoutCheck();
if (exec->hadException())
m_frame->domWindow()->console()->reportCurrentException(exec);
Document::updateDocumentsRendering();
return result->toBoolean(exec);
}