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

Unified Diff: Source/bindings/tests/results/V8TestObject.cpp

Issue 357413003: IDL: Drop redundant null check for string and wrapper type attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/bindings/tests/results/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp
index 2baf6d646b3635be31434abfc21a8d577df3351c..ba66181195013b7ca85f13426abd2a9a256407a1 100644
--- a/Source/bindings/tests/results/V8TestObject.cpp
+++ b/Source/bindings/tests/results/V8TestObject.cpp
@@ -1372,12 +1372,7 @@ static void readonlyEventTargetOrNullAttributeAttributeGetter(const v8::Property
{
v8::Handle<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toNative(holder);
- RefPtrWillBeRawPtr<EventTarget> cppValue(impl->readonlyEventTargetOrNullAttribute());
- if (!cppValue) {
- v8SetReturnValueNull(info);
- return;
- }
- v8SetReturnValueFast(info, WTF::getPtr(cppValue.release()), impl);
+ v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyEventTargetOrNullAttribute()), impl);
}
static void readonlyEventTargetOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -1520,12 +1515,7 @@ static void stringOrNullAttributeAttributeGetter(const v8::PropertyCallbackInfo<
{
v8::Handle<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toNative(holder);
- String cppValue(impl->stringOrNullAttribute());
- if (!cppValue) {
- v8SetReturnValueNull(info);
- return;
- }
- v8SetReturnValueString(info, cppValue, info.GetIsolate());
+ v8SetReturnValueStringOrNull(info, impl->stringOrNullAttribute(), info.GetIsolate());
}
static void stringOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -1590,12 +1580,7 @@ static void testInterfaceOrNullAttributeAttributeGetter(const v8::PropertyCallba
{
v8::Handle<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toNative(holder);
- RefPtr<TestInterfaceImplementation> cppValue(impl->testInterfaceOrNullAttribute());
- if (!cppValue) {
- v8SetReturnValueNull(info);
- return;
- }
- v8SetReturnValueFast(info, WTF::getPtr(cppValue.release()), impl);
+ v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceOrNullAttribute()), impl);
}
static void testInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -4441,12 +4426,7 @@ static void typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeGetter(con
{
v8::Handle<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toNative(holder);
- RefPtr<TestInterfaceImplementation> cppValue(impl->typeCheckingInterfaceTestInterfaceOrNullAttribute());
- if (!cppValue) {
- v8SetReturnValueNull(info);
- return;
- }
- v8SetReturnValueFast(info, WTF::getPtr(cppValue.release()), impl);
+ v8SetReturnValueFast(info, WTF::getPtr(impl->typeCheckingInterfaceTestInterfaceOrNullAttribute()), impl);
}
static void typeCheckingInterfaceTestInterfaceOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -4710,12 +4690,7 @@ static void testInterfaceGarbageCollectedOrNullAttributeAttributeGetter(const v8
{
v8::Handle<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toNative(holder);
- RawPtr<TestInterfaceGarbageCollected> cppValue(impl->testInterfaceGarbageCollectedOrNullAttribute());
- if (!cppValue) {
- v8SetReturnValueNull(info);
- return;
- }
- v8SetReturnValueFast(info, WTF::getPtr(cppValue.release()), impl);
+ v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceGarbageCollectedOrNullAttribute()), impl);
}
static void testInterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -4773,12 +4748,7 @@ static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetter(co
{
v8::Handle<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toNative(holder);
- RefPtrWillBeRawPtr<TestInterfaceWillBeGarbageCollected> cppValue(impl->testInterfaceWillBeGarbageCollectedOrNullAttribute());
- if (!cppValue) {
- v8SetReturnValueNull(info);
- return;
- }
- v8SetReturnValueFast(info, WTF::getPtr(cppValue.release()), impl);
+ v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceWillBeGarbageCollectedOrNullAttribute()), impl);
}
static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698