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

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

Issue 2342053002: binding: Refactors bindings/templates/attributes.cpp. (Closed)
Patch Set: Synced. Created 4 years, 3 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/V8TestInterfaceGarbageCollected.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
index 2b12dfff55a45bb2203f8ef24ef1f992549df351..5c0cc51b2eb34c78267cc69d4949c15db6f25592 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
@@ -56,7 +56,9 @@ namespace TestInterfaceGarbageCollectedV8Internal {
static void attr1AttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
+
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(holder);
+
v8SetReturnValueFast(info, WTF::getPtr(impl->attr1()), impl);
}
@@ -68,19 +70,26 @@ void attr1AttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
static void attr1AttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Object> holder = info.Holder();
- ExceptionState exceptionState(ExceptionState::SetterContext, "attr1", "TestInterfaceGarbageCollected", holder, info.GetIsolate());
TestInterfaceGarbageCollected* impl = V8TestInterfaceGarbageCollected::toImpl(holder);
+
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterfaceGarbageCollected", "attr1");
+
+ // Prepare the value to be set.
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
+
+ // Type check per: http://heycam.github.io/webidl/#es-interface
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
return;
}
+
impl->setAttr1(cppValue);
}
void attr1AttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::Value> v8Value = info[0];
+
TestInterfaceGarbageCollectedV8Internal::attr1AttributeSetter(v8Value, info);
}

Powered by Google App Engine
This is Rietveld 408576698