Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
index a6a904ad66cae04b7cec58ec9ed68e3bf60c2275..f21f494267a9db96fca9de471cfda1acfb3863c3 100644 |
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
@@ -3905,6 +3905,41 @@ static void saveSameObjectAttributeAttributeGetter(const v8::FunctionCallbackInf |
privateSameObject.Set(holder, info.GetReturnValue().Get()); |
} |
+static void staticSaveSameObjectAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ |
+ // [SaveSameObject] |
+ // If you see a compile error that |
+ // V8PrivateProperty::GetSameObjectTestObjectStaticSaveSameObjectAttribute |
+ // is not defined, then you need to register your attribute at |
+ // V8_PRIVATE_PROPERTY_FOR_EACH defined in V8PrivateProperty.h as |
+ // X(SameObject, TestObjectStaticSaveSameObjectAttribute) |
+ auto privateSameObject = V8PrivateProperty::GetSameObjectTestObjectStaticSaveSameObjectAttribute(info.GetIsolate()); |
+ { |
+ v8::Local<v8::Value> v8Value = privateSameObject.GetOrEmpty(holder); |
+ if (!v8Value.IsEmpty()) { |
+ V8SetReturnValue(info, v8Value); |
+ return; |
+ } |
+ } |
+ |
+ TestInterfaceImplementation* cppValue(WTF::GetPtr(TestObject::staticSaveSameObjectAttribute())); |
+ |
+ // Keep the wrapper object for the return value alive as long as |this| |
+ // object is alive in order to save creation time of the wrapper object. |
+ if (cppValue && DOMDataStore::SetReturnValue(info.GetReturnValue(), cppValue)) |
+ return; |
+ v8::Local<v8::Value> v8Value(ToV8(cppValue, holder, info.GetIsolate())); |
+ V8PrivateProperty::GetSymbol( |
+ info.GetIsolate(), "KeepAlive#TestObject#staticSaveSameObjectAttribute") |
+ .Set(holder, v8Value); |
+ |
+ V8SetReturnValue(info, v8Value); |
+ |
+ // [SaveSameObject] |
+ privateSameObject.Set(holder, info.GetReturnValue().Get()); |
+} |
+ |
static void unscopableLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) { |
v8::Local<v8::Object> holder = info.Holder(); |
@@ -10739,6 +10774,10 @@ void V8TestObject::saveSameObjectAttributeAttributeGetterCallback(const v8::Func |
TestObjectV8Internal::saveSameObjectAttributeAttributeGetter(info); |
} |
+void V8TestObject::staticSaveSameObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
+ TestObjectV8Internal::staticSaveSameObjectAttributeAttributeGetter(info); |
+} |
+ |
void V8TestObject::unscopableLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { |
TestObjectV8Internal::unscopableLongAttributeAttributeGetter(info); |
} |
@@ -12062,6 +12101,7 @@ static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = |
{"measuredLongAttribute", V8TestObject::measuredLongAttributeAttributeGetterCallback, V8TestObject::measuredLongAttributeAttributeSetterCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |
{"sameObjectAttribute", V8TestObject::sameObjectAttributeAttributeGetterCallback, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |
{"saveSameObjectAttribute", V8TestObject::saveSameObjectAttributeAttributeGetterCallback, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |
+ {"staticSaveSameObjectAttribute", V8TestObject::staticSaveSameObjectAttributeAttributeGetterCallback, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V8DOMConfiguration::kOnInterface, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |
{"unscopableLongAttribute", V8TestObject::unscopableLongAttributeAttributeGetterCallback, V8TestObject::unscopableLongAttributeAttributeSetterCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |
{"testInterfaceAttribute", V8TestObject::testInterfaceAttributeAttributeGetterCallback, V8TestObject::testInterfaceAttributeAttributeSetterCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |
{"testInterfaceGarbageCollectedAttribute", V8TestObject::testInterfaceGarbageCollectedAttributeAttributeGetterCallback, V8TestObject::testInterfaceGarbageCollectedAttributeAttributeSetterCallback, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kAllWorlds}, |