本文整理汇总了C++中TestSerializedScriptValueInterface::cachedValue方法的典型用法代码示例。如果您正苦于以下问题:C++ TestSerializedScriptValueInterface::cachedValue方法的具体用法?C++ TestSerializedScriptValueInterface::cachedValue怎么用?C++ TestSerializedScriptValueInterface::cachedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSerializedScriptValueInterface
的用法示例。
在下文中一共展示了TestSerializedScriptValueInterface::cachedValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsTestSerializedScriptValueInterfaceCachedValue
JSValue jsTestSerializedScriptValueInterfaceCachedValue(ExecState* exec, JSValue slotBase, PropertyName)
{
JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
if (JSValue cachedValue = castedThis->m_cachedValue.get())
return cachedValue;
TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
JSValue result = impl->cachedValue() ? impl->cachedValue()->deserialize(exec, castedThis->globalObject(), 0) : jsNull();
castedThis->m_cachedValue.set(exec->vm(), castedThis, result);
return result;
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:11,代码来源:JSTestSerializedScriptValueInterface.cpp
示例2: cachedValueAttrGetter
static v8::Handle<v8::Value> cachedValueAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
v8::Handle<v8::String> propertyName = v8::String::NewSymbol("cachedValue");
v8::Handle<v8::Value> value = info.Holder()->GetHiddenValue(propertyName);
if (!value.IsEmpty())
return value;
TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
RefPtr<SerializedScriptValue> serialized = imp->cachedValue();
value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8Null(info.GetIsolate()));
info.Holder()->SetHiddenValue(propertyName, value);
return value;
}