当前位置: 首页>>代码示例>>C++>>正文


C++ InjectedScriptHost类代码示例

本文整理汇总了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]));
}
开发者ID:golden628,项目名称:ChromiumGStreamerBackend,代码行数:10,代码来源:V8InjectedScriptHost.cpp

示例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>();
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:10,代码来源:V8InjectedScriptHost.cpp

示例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;
        }
    }
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:11,代码来源:V8InjectedScriptHostCustom.cpp

示例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));
}
开发者ID:golden628,项目名称:ChromiumGStreamerBackend,代码行数:11,代码来源:V8InjectedScriptHost.cpp

示例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));
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:11,代码来源:V8InjectedScriptHostCustom.cpp

示例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);
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:11,代码来源:V8InjectedScriptHostCustom.cpp

示例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();
}
开发者ID:XUZHOUWANG,项目名称:webkit,代码行数:11,代码来源:V8InjectedScriptHostCustom.cpp

示例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);
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:11,代码来源:V8InjectedScriptHostCustom.cpp

示例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();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:12,代码来源:V8InjectedScriptHostCustom.cpp

示例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();
}
开发者ID:husninazer,项目名称:qt,代码行数:12,代码来源:JSInjectedScriptHost.cpp

示例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();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:12,代码来源:V8InjectedScriptHostCustom.cpp

示例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;
}
开发者ID:husninazer,项目名称:qt,代码行数:13,代码来源:JSInjectedScriptHost.cpp

示例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);
}
开发者ID:paul99,项目名称:third_party,代码行数:14,代码来源:V8InjectedScriptHostCustom.cpp

示例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));
}
开发者ID:golden628,项目名称:ChromiumGStreamerBackend,代码行数:14,代码来源:V8InjectedScriptHost.cpp

示例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());
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:14,代码来源:V8InjectedScriptHostCustom.cpp


注:本文中的InjectedScriptHost类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。