Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp

Issue 1980553002: bindings: Supports [SameObject] extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed layouttests. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6da60852a6a328c7c57e7cf4c53b5477781c5746..44b3ebd4dbaea255431e998548d84407d012d399 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -2189,8 +2189,8 @@ static void activityLoggingSetterForAllWorldsLongAttributeAttributeSetterCallbac
static void cachedAttributeAnyAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeAnyAttribute");
TestObject* impl = V8TestObject::toImpl(holder);
+ v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeAnyAttribute");
if (!impl->isValueDirty()) {
v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName);
if (!v8Value.IsEmpty() && !v8Value->IsUndefined()) {
@@ -2227,8 +2227,8 @@ static void cachedAttributeAnyAttributeAttributeSetterCallback(const v8::Functio
static void cachedArrayAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedArrayAttribute");
TestObject* impl = V8TestObject::toImpl(holder);
+ v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedArrayAttribute");
if (!impl->isArrayDirty()) {
v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName);
if (!v8Value.IsEmpty() && !v8Value->IsUndefined()) {
@@ -2268,8 +2268,8 @@ static void cachedArrayAttributeAttributeSetterCallback(const v8::FunctionCallba
static void cachedStringOrNoneAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedStringOrNoneAttribute");
TestObject* impl = V8TestObject::toImpl(holder);
+ v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedStringOrNoneAttribute");
if (!impl->isStringDirty()) {
v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName);
if (!v8Value.IsEmpty() && !v8Value->IsUndefined()) {
@@ -3445,8 +3445,8 @@ static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback(co
static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute");
TestObject* impl = V8TestObject::toImpl(holder);
+ v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute");
if (!impl->isValueDirty()) {
v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName);
if (!v8Value.IsEmpty() && !v8Value->IsUndefined()) {
@@ -4513,7 +4513,16 @@ static void sameObjectAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8
{
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
+ v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "sameobject_sameObjectAttribute");
+ {
+ v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName);
+ if (!v8Value.IsEmpty()) {
+ v8SetReturnValue(info, v8Value);
+ return;
+ }
+ }
v8SetReturnValueFast(info, WTF::getPtr(impl->sameObjectAttribute()), impl);
+ V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName, info.GetReturnValue().Get());
}
static void sameObjectAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698