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