本文整理汇总了C++中deprecated::ScriptValue::toInspectorValue方法的典型用法代码示例。如果您正苦于以下问题:C++ ScriptValue::toInspectorValue方法的具体用法?C++ ScriptValue::toInspectorValue怎么用?C++ ScriptValue::toInspectorValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类deprecated::ScriptValue
的用法示例。
在下文中一共展示了ScriptValue::toInspectorValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: function
PassRefPtr<Array<Inspector::TypeBuilder::Debugger::CallFrame>> InjectedScript::wrapCallFrames(const Deprecated::ScriptValue& callFrames)
{
ASSERT(!hasNoValue());
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("wrapCallFrames"), inspectorEnvironment()->functionCallHandler());
function.appendArgument(callFrames);
bool hadException = false;
Deprecated::ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadException);
ASSERT(!hadException);
RefPtr<InspectorValue> result = callFramesValue.toInspectorValue(scriptState());
if (result->type() == InspectorValue::TypeArray)
return Array<Inspector::TypeBuilder::Debugger::CallFrame>::runtimeCast(result);
return Array<Inspector::TypeBuilder::Debugger::CallFrame>::create();
}
示例2: wrapFunction
PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapObject(const Deprecated::ScriptValue& value, const String& groupName, bool generatePreview) const
{
ASSERT(!hasNoValue());
Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapObject"), inspectorEnvironment()->functionCallHandler());
wrapFunction.appendArgument(value);
wrapFunction.appendArgument(groupName);
wrapFunction.appendArgument(hasAccessToInspectedScriptState());
wrapFunction.appendArgument(generatePreview);
bool hadException = false;
Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException);
if (hadException)
return nullptr;
RefPtr<InspectorObject> rawResult = r.toInspectorValue(scriptState())->asObject();
return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult);
}
示例3: makeCall
void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<InspectorValue>* result)
{
if (hasNoValue() || !hasAccessToInspectedScriptState()) {
*result = InspectorValue::null();
return;
}
bool hadException = false;
Deprecated::ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException);
ASSERT(!hadException);
if (!hadException) {
*result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState());
if (!*result)
*result = InspectorString::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth));
} else
*result = InspectorString::create("Exception while making a call.");
}