本文整理汇总了C++中InjectedScript::callFunctionOn方法的典型用法代码示例。如果您正苦于以下问题:C++ InjectedScript::callFunctionOn方法的具体用法?C++ InjectedScript::callFunctionOn怎么用?C++ InjectedScript::callFunctionOn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InjectedScript
的用法示例。
在下文中一共展示了InjectedScript::callFunctionOn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: callFunctionOn
void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const InspectorArray* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
{
InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
if (injectedScript.hasNoValue()) {
errorString = ASCIILiteral("Could not find InjectedScript for objectId");
return;
}
String arguments;
if (optionalArguments)
arguments = optionalArguments->toJSONString();
ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
muteConsole();
injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
unmuteConsole();
setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
}
}
示例2: callFunctionOn
void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<InspectorArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown)
{
InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
if (injectedScript.hasNoValue()) {
*errorString = "Inspected frame has gone";
return;
}
String arguments;
if (optionalArguments)
arguments = (*optionalArguments)->toJSONString();
#if ENABLE(JAVASCRIPT_DEBUGGER)
ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = ScriptDebugServer::DontPauseOnExceptions;
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
#endif
if (asBool(doNotPauseOnExceptionsAndMuteConsole))
muteConsole();
injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), &result, wasThrown);
if (asBool(doNotPauseOnExceptionsAndMuteConsole)) {
unmuteConsole();
#if ENABLE(JAVASCRIPT_DEBUGGER)
setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
#endif
}
}
示例3: callFunctionOn
void InspectorRuntimeAgent::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const RefPtr<JSONArray>* const optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown)
{
OwnPtr<RemoteObjectId> remoteId = RemoteObjectId::parse(objectId);
if (!remoteId) {
*errorString = "Invalid object id";
return;
}
InjectedScript injectedScript = m_injectedScriptManager->findInjectedScript(remoteId.get());
if (injectedScript.isEmpty()) {
*errorString = "Inspected frame has gone";
return;
}
String arguments;
if (optionalArguments)
arguments = (*optionalArguments)->toJSONString();
InjectedScriptCallScope callScope(this, asBool(doNotPauseOnExceptionsAndMuteConsole));
injectedScript.callFunctionOn(errorString, objectId, expression, arguments, asBool(returnByValue), asBool(generatePreview), &result, wasThrown);
}