Ejemplo n.º 1
0
JSValue jsClipboardItems(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSClipboard* castedThis = static_cast<JSClipboard*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    Clipboard* imp = static_cast<Clipboard*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->items()));
    return result;
}
static v8::Handle<v8::Value> itemsAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    Clipboard* imp = V8Clipboard::toNative(info.Holder());
    RefPtr<DataTransferItemList> result = imp->items();
    v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMDataStore::getWrapper(result.get(), info.GetIsolate())) : v8Undefined();
    if (wrapper.IsEmpty()) {
        wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
        if (!wrapper.IsEmpty())
            V8DOMWrapper::setNamedHiddenReference(info.Holder(), "items", wrapper);
    }
    return wrapper;
}