static v8::Handle<v8::Value> memoryAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    Performance* imp = V8Performance::toNative(info.Holder());
    RefPtr<MemoryInfo> result = imp->memory();
    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(), "memory", wrapper);
    }
    return wrapper;
}
Пример #2
0
v8::Handle<v8::Value> V8Performance::memoryAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Performance.memoryAccessorGetter");
    Performance* imp = V8Performance::toNative(info.Holder());
    return toV8(imp->memory(), info.GetIsolate());
}