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

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

Issue 1539813002: bindings: Fixes [LenientThis] to refer to the correct object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/attributes.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
index 594df2158d130a957f7bdb5ebc4bc7fe480f51da..f55ea7a3e8ae2121f3f32b41c9c8f8aa8b7f952c 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -634,11 +634,9 @@ static void windowExposedAttributeAttributeSetterCallback(const v8::FunctionCall
static void lenientThisAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- v8::Local<v8::Object> holder = V8TestInterface::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
- if (holder.IsEmpty())
+ if (!V8TestInterface::hasInstance(info.Holder(), info.GetIsolate()))
return; // Return silently because of [LenientThis].
- // Note that it's okay to use |holder|, but |info.Holder()| is still unsafe
- // and must not be used.
+ v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
v8SetReturnValue(info, impl->lenientThisAttribute().v8Value());
}
@@ -652,11 +650,9 @@ static void lenientThisAttributeAttributeGetterCallback(const v8::FunctionCallba
static void lenientThisAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
- v8::Local<v8::Object> holder = V8TestInterface::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
- if (holder.IsEmpty())
+ if (!V8TestInterface::hasInstance(info.Holder(), info.GetIsolate()))
return; // Return silently because of [LenientThis].
- // Note that it's okay to use |holder|, but |info.Holder()| is still unsafe
- // and must not be used.
+ v8::Local<v8::Object> holder = info.Holder();
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder);
ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value);
impl->setLenientThisAttribute(cppValue);
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/attributes.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698