本文整理汇总了C++中InjectedScriptHost类的典型用法代码示例。如果您正苦于以下问题:C++ InjectedScriptHost类的具体用法?C++ InjectedScriptHost怎么用?C++ InjectedScriptHost使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InjectedScriptHost类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scope
void V8InjectedScriptHost::inspectCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 2)
return;
InjectedScriptHost* host = V8InjectedScriptHost::unwrap(info.GetIsolate()->GetCurrentContext(), info.Holder());
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
ScriptState::Scope scope(scriptState);
host->inspectImpl(toJSONValue(scriptState->context(), info[0]), toJSONValue(scriptState->context(), info[1]));
}
示例2: didCreateWorkerCallback
static v8::Handle<v8::Value> didCreateWorkerCallback(const v8::Arguments& args)
{
INC_STATS("DOM.InjectedScriptHost.didCreateWorker");
InjectedScriptHost* imp = V8InjectedScriptHost::toNative(args.Holder());
EXCEPTION_BLOCK(int, id, toInt32(args[0]));
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, url, args[1]);
EXCEPTION_BLOCK(bool, isFakeWorker, args[2]->BooleanValue());
imp->didCreateWorker(id, url, isFakeWorker);
return v8::Handle<v8::Value>();
}
示例3:
void V8InjectedScriptHost::storageIdMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() > 0 && V8Storage::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
Storage* storage = V8Storage::toNative(v8::Handle<v8::Object>::Cast(info[0]));
if (storage) {
InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder());
v8SetReturnValueStringOrUndefined(info, host->storageIdImpl(storage), info.GetIsolate());
return;
}
}
}
示例4:
void V8InjectedScriptHost::collectionEntriesCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1 || !info[0]->IsObject())
return;
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(info[0]);
InjectedScriptHost* host = V8InjectedScriptHost::unwrap(info.GetIsolate()->GetCurrentContext(), info.Holder());
V8DebuggerImpl& debugger = static_cast<V8DebuggerImpl&>(host->debugger());
v8SetReturnValue(info, debugger.collectionEntries(object));
}
示例5: toWebCoreStringWithUndefinedOrNullCheck
void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Value> functionValue = info[0];
int scopeIndex = info[1]->Int32Value();
String variableName = toWebCoreStringWithUndefinedOrNullCheck(info[2]);
v8::Handle<v8::Value> newValue = info[3];
InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder());
ScriptDebugServer& debugServer = host->scriptDebugServer();
v8SetReturnValue(info, debugServer.setFunctionVariableValue(functionValue, scopeIndex, variableName, newValue));
}
示例6: toWebCoreStringWithUndefinedOrNullCheck
v8::Handle<v8::Value> V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Arguments& args)
{
v8::Handle<v8::Value> functionValue = args[0];
int scopeIndex = args[1]->Int32Value();
String variableName = toWebCoreStringWithUndefinedOrNullCheck(args[2]);
v8::Handle<v8::Value> newValue = args[3];
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
ScriptDebugServer& debugServer = host->scriptDebugServer();
return debugServer.setFunctionVariableValue(functionValue, scopeIndex, variableName, newValue);
}
示例7: INC_STATS
v8::Handle<v8::Value> V8InjectedScriptHost::storageIdCallback(const v8::Arguments& args)
{
if (args.Length() < 1)
return v8::Undefined();
INC_STATS("InjectedScriptHost.storageId()");
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
Storage* storage = V8Storage::toNative(v8::Handle<v8::Object>::Cast(args[0]));
if (storage)
return v8StringOrUndefined(host->storageIdImpl(storage), args.GetIsolate());
return v8::Undefined();
}
示例8:
v8::Handle<v8::Value> V8InjectedScriptHost::getInternalPropertiesMethodCustom(const v8::Arguments& args)
{
if (args.Length() < 1)
return v8::Undefined();
v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(args[0]);
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
ScriptDebugServer& debugServer = host->scriptDebugServer();
return debugServer.getInternalProperties(object);
}
示例9: throwTypeError
v8::Handle<v8::Value> V8InjectedScriptHost::inspectedObjectMethodCustom(const v8::Arguments& args)
{
if (args.Length() < 1)
return v8::Undefined();
if (!args[0]->IsInt32())
return throwTypeError("argument has to be an integer", args.GetIsolate());
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
InjectedScriptHost::InspectableObject* object = host->inspectedObject(args[0]->ToInt32()->Value());
return object->get(ScriptState::current()).v8Value();
}
示例10: jsInjectedScriptHostPrototypeFunctionAddNodesToSearchResult
JSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionAddNodesToSearchResult(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSInjectedScriptHost::s_info))
return throwError(exec, TypeError);
JSInjectedScriptHost* castedThisObj = static_cast<JSInjectedScriptHost*>(asObject(thisValue));
InjectedScriptHost* imp = static_cast<InjectedScriptHost*>(castedThisObj->impl());
const UString& nodeIds = args.at(0).toString(exec);
imp->addNodesToSearchResult(nodeIds);
return jsUndefined();
}
示例11: object
v8::Handle<v8::Value> V8InjectedScriptHost::inspectMethodCustom(const v8::Arguments& args)
{
if (args.Length() < 2)
return v8::Undefined();
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
ScriptValue object(args[0]);
ScriptValue hints(args[1]);
host->inspectImpl(object.toInspectorValue(ScriptState::current()), hints.toInspectorValue(ScriptState::current()));
return v8::Undefined();
}
示例12: jsInjectedScriptHostPrototypeFunctionPushNodeByPathToFrontend
JSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionPushNodeByPathToFrontend(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSInjectedScriptHost::s_info))
return throwError(exec, TypeError);
JSInjectedScriptHost* castedThisObj = static_cast<JSInjectedScriptHost*>(asObject(thisValue));
InjectedScriptHost* imp = static_cast<InjectedScriptHost*>(castedThisObj->impl());
const UString& path = args.at(0).toString(exec);
JSC::JSValue result = jsNumber(exec, imp->pushNodeByPathToFrontend(path));
return result;
}
示例13: INC_STATS
v8::Handle<v8::Value> V8InjectedScriptHost::inspectedNodeCallback(const v8::Arguments& args)
{
INC_STATS("InjectedScriptHost.inspectedNode()");
if (args.Length() < 1)
return v8::Undefined();
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
Node* node = host->inspectedNode(args[0]->ToInt32()->Value());
if (!node)
return v8::Undefined();
return toV8(node);
}
示例14: toCoreStringWithUndefinedOrNullCheck
void V8InjectedScriptHost::setFunctionVariableValueCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 4 || !info[0]->IsFunction() || !info[1]->IsInt32() || !info[2]->IsString())
return;
v8::Local<v8::Value> functionValue = info[0];
int scopeIndex = info[1].As<v8::Int32>()->Value();
String variableName = toCoreStringWithUndefinedOrNullCheck(info[2]);
v8::Local<v8::Value> newValue = info[3];
InjectedScriptHost* host = V8InjectedScriptHost::unwrap(info.GetIsolate()->GetCurrentContext(), info.Holder());
V8DebuggerImpl& debugger = static_cast<V8DebuggerImpl&>(host->debugger());
v8SetReturnValue(info, debugger.setFunctionVariableValue(functionValue, scopeIndex, variableName, newValue));
}
示例15: throwTypeError
void V8InjectedScriptHost::inspectedObjectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1)
return;
if (!info[0]->IsInt32()) {
throwTypeError("argument has to be an integer", info.GetIsolate());
return;
}
InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder());
InjectedScriptHost::InspectableObject* object = host->inspectedObject(info[0]->ToInt32()->Value());
v8SetReturnValue(info, object->get(ScriptState::current()).v8Value());
}