本文整理汇总了C++中TestInterfaceGarbageCollected类的典型用法代码示例。如果您正苦于以下问题:C++ TestInterfaceGarbageCollected类的具体用法?C++ TestInterfaceGarbageCollected怎么用?C++ TestInterfaceGarbageCollected使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestInterfaceGarbageCollected类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: forEachMethod
static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
exceptionState.throwIfNeeded();
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
ScriptValue callback;
ScriptValue thisArg;
{
if (!info[0]->IsFunction()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
exceptionState.throwIfNeeded();
return;
}
callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.This()), callback, thisArg, exceptionState);
if (exceptionState.hadException()) {
exceptionState.throwIfNeeded();
return;
}
}
开发者ID:,项目名称:,代码行数:27,代码来源:
示例2: attr1AttributeSetter
static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(holder);
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
impl->setAttr1(WTF::getPtr(cppValue));
}
开发者ID:335969568,项目名称:Blink-1,代码行数:7,代码来源:V8TestInterfaceGarbageCollected.cpp
示例3: clearMethod
static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "clear", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
impl->clearForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
exceptionState.throwIfNeeded();
return;
}
}
开发者ID:,项目名称:,代码行数:11,代码来源:
示例4: iteratorMethod
static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState);
if (exceptionState.hadException()) {
exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result.release());
}
开发者ID:,项目名称:,代码行数:12,代码来源:
示例5: attr1AttributeSetter
static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "attr1", "TestInterfaceGarbageCollected", holder, info.GetIsolate());
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(holder);
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
exceptionState.throwIfNeeded();
return;
}
impl->setAttr1(WTF::getPtr(cppValue));
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例6: funcMethod
static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("func", "TestInterfaceGarbageCollected", 1, info.Length(), info.GetIsolate()), info.GetIsolate());
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
TestInterfaceGarbageCollected* arg;
{
arg = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), info[0]);
}
impl->func(arg);
}
开发者ID:335969568,项目名称:Blink-1,代码行数:13,代码来源:V8TestInterfaceGarbageCollected.cpp
示例7: funcMethod
static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
throwMinimumArityTypeErrorForMethod("func", "TestInterfaceGarbageCollected", 1, info.Length(), info.GetIsolate());
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toNative(info.Holder());
TestInterfaceGarbageCollected* arg;
{
v8::TryCatch block;
TONATIVE_VOID_INTERNAL(arg, V8TestInterfaceGarbageCollected::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
}
impl->func(arg);
}
开发者ID:ericwilligers,项目名称:blink,代码行数:14,代码来源:V8TestInterfaceGarbageCollected.cpp
示例8: funcMethod
static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (UNLIKELY(info.Length() < 1)) {
V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "func", "TestInterfaceGarbageCollected", 1, info.Length()), info.GetIsolate());
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
TestInterfaceGarbageCollected* arg;
{
arg = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), info[0]);
if (!arg) {
V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("func", "TestInterfaceGarbageCollected", "parameter 1 is not of type 'TestInterfaceGarbageCollected'."));
return;
}
}
impl->func(arg);
}
开发者ID:,项目名称:,代码行数:17,代码来源:
示例9: deleteMethod
static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "TestInterfaceGarbageCollected", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
exceptionState.throwIfNeeded();
return;
}
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(info.Holder());
V8StringResource<> value;
{
value = info[0];
if (!value.prepare())
return;
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->deleteForBinding(scriptState, value, exceptionState);
if (exceptionState.hadException()) {
exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueBool(info, result);
}
开发者ID:,项目名称:,代码行数:23,代码来源:
示例10: attr1AttributeGetter
static void attr1AttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(holder);
v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl);
}
开发者ID:,项目名称:,代码行数:6,代码来源:
示例11: attr1AttributeGetter
static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
v8::Handle<v8::Object> holder = info.Holder();
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toNative(holder);
v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl);
}
开发者ID:ewilligers,项目名称:blink,代码行数:6,代码来源:V8TestInterfaceGarbageCollected.cpp
注:本文中的TestInterfaceGarbageCollected类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论