本文整理汇总了C++中JSDOMPluginArray::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ JSDOMPluginArray::impl方法的具体用法?C++ JSDOMPluginArray::impl怎么用?C++ JSDOMPluginArray::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSDOMPluginArray
的用法示例。
在下文中一共展示了JSDOMPluginArray::impl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOwnPropertySlotByIndex
bool JSDOMPluginArray::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)
{
JSDOMPluginArray* thisObject = jsCast<JSDOMPluginArray*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
if (index < thisObject->impl().length()) {
unsigned attributes = DontDelete | ReadOnly;
slot.setCustomIndex(thisObject, attributes, index, thisObject->indexGetter);
return true;
}
PropertyName propertyName = Identifier::from(exec, index);
if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
return true;
}
return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
}
示例2: finalize
void JSDOMPluginArrayOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
JSDOMPluginArray* jsDOMPluginArray = jsCast<JSDOMPluginArray*>(handle.get().asCell());
DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, &jsDOMPluginArray->impl(), jsDOMPluginArray);
jsDOMPluginArray->releaseImpl();
}
示例3: getOwnPropertyNames
void JSDOMPluginArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSDOMPluginArray* thisObject = jsCast<JSDOMPluginArray*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
for (unsigned i = 0, count = thisObject->impl().length(); i < count; ++i)
propertyNames.add(Identifier::from(exec, i));
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
示例4: jsDOMPluginArrayLength
JSValue jsDOMPluginArrayLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDOMPluginArray* castedThis = static_cast<JSDOMPluginArray*>(asObject(slotBase));
UNUSED_PARAM(exec);
DOMPluginArray* imp = static_cast<DOMPluginArray*>(castedThis->impl());
JSValue result = jsNumber(imp->length());
return result;
}
示例5: isReachableFromOpaqueRoots
bool JSDOMPluginArrayOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
JSDOMPluginArray* jsDOMPluginArray = static_cast<JSDOMPluginArray*>(handle.get().asCell());
if (!isObservable(jsDOMPluginArray))
return false;
Frame* root = jsDOMPluginArray->impl()->frame();
if (!root)
return false;
return visitor.containsOpaqueRoot(root);
}
示例6: jsDOMPluginArrayLength
EncodedJSValue jsDOMPluginArrayLength(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
JSDOMPluginArray* castedThis = jsDynamicCast<JSDOMPluginArray*>(JSValue::decode(thisValue));
UNUSED_PARAM(slotBase);
if (!castedThis)
return throwVMTypeError(exec);
UNUSED_PARAM(exec);
DOMPluginArray& impl = castedThis->impl();
JSValue result = jsNumber(impl.length());
return JSValue::encode(result);
}
示例7: getOwnPropertySlot
bool JSDOMPluginArray::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
JSDOMPluginArray* thisObject = jsCast<JSDOMPluginArray*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
const HashEntry* entry = getStaticValueSlotEntryWithoutCaching<JSDOMPluginArray>(exec, propertyName);
if (entry) {
slot.setCustom(thisObject, entry->attributes(), entry->propertyGetter());
return true;
}
unsigned index = propertyName.asIndex();
if (index != PropertyName::NotAnIndex && index < thisObject->impl().length()) {
unsigned attributes = DontDelete | ReadOnly;
slot.setCustomIndex(thisObject, attributes, index, indexGetter);
return true;
}
if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
return true;
}
return getStaticValueSlot<JSDOMPluginArray, Base>(exec, JSDOMPluginArrayTable, thisObject, propertyName, slot);
}
示例8: jsDOMPluginArrayPrototypeFunctionRefresh
EncodedJSValue JSC_HOST_CALL jsDOMPluginArrayPrototypeFunctionRefresh(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSDOMPluginArray* castedThis = jsDynamicCast<JSDOMPluginArray*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMPluginArray::info());
DOMPluginArray& impl = castedThis->impl();
bool reload(exec->argument(0).toBoolean(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl.refresh(reload);
return JSValue::encode(jsUndefined());
}
示例9: jsDOMPluginArrayPrototypeFunctionRefresh
EncodedJSValue JSC_HOST_CALL jsDOMPluginArrayPrototypeFunctionRefresh(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSDOMPluginArray::s_info))
return throwVMTypeError(exec);
JSDOMPluginArray* castedThis = static_cast<JSDOMPluginArray*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMPluginArray::s_info);
DOMPluginArray* imp = static_cast<DOMPluginArray*>(castedThis->impl());
bool reload(exec->argument(0).toBoolean(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->refresh(reload);
return JSValue::encode(jsUndefined());
}
示例10: jsDOMPluginArrayPrototypeFunctionItem
EncodedJSValue JSC_HOST_CALL jsDOMPluginArrayPrototypeFunctionItem(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSDOMPluginArray* castedThis = jsDynamicCast<JSDOMPluginArray*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMPluginArray::info());
DOMPluginArray& impl = castedThis->impl();
unsigned index(toUInt32(exec, exec->argument(0), NormalConversion));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.item(index)));
return JSValue::encode(result);
}
示例11: jsDOMPluginArrayPrototypeFunctionNamedItem
EncodedJSValue JSC_HOST_CALL jsDOMPluginArrayPrototypeFunctionNamedItem(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSDOMPluginArray* castedThis = jsDynamicCast<JSDOMPluginArray*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMPluginArray::info());
DOMPluginArray& impl = castedThis->impl();
const String& name(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.namedItem(name)));
return JSValue::encode(result);
}
示例12: jsDOMPluginArrayPrototypeFunctionNamedItem
EncodedJSValue JSC_HOST_CALL jsDOMPluginArrayPrototypeFunctionNamedItem(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSDOMPluginArray::s_info))
return throwVMTypeError(exec);
JSDOMPluginArray* castedThis = static_cast<JSDOMPluginArray*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMPluginArray::s_info);
DOMPluginArray* imp = static_cast<DOMPluginArray*>(castedThis->impl());
const String& name(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->namedItem(name)));
return JSValue::encode(result);
}
示例13: indexGetter
JSValue JSDOMPluginArray::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
{
JSDOMPluginArray* thisObj = static_cast<JSDOMPluginArray*>(asObject(slotBase));
ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
return toJS(exec, thisObj->globalObject(), static_cast<DOMPluginArray*>(thisObj->impl())->item(index));
}
示例14: nameGetter
JSValue JSDOMPluginArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSDOMPluginArray* thisObj = static_cast<JSDOMPluginArray*>(asObject(slotBase));
return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
}
示例15: nameGetter
JSValue JSDOMPluginArray::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSDOMPluginArray* thisObj = jsCast<JSDOMPluginArray*>(asObject(slotBase));
return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
}