Commit 58394589 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Replace Foo::Create() with MakeGarbageCollected<Foo> in dictionary_v8.cc.tmpl

As a step to remove Create() factory functions, this CL converts
<{{cpp_class}}>::Create() to MakeGarbageCollected<{{cpp_class}}>.

As this CL modifies the template file, dependent tests are modified
by the change.

Bug: 939691
Change-Id: I9546faf3e5c43b583d2f4694a75f5cbd70e4d10a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946048Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#720411}
parent 5c4166e2
......@@ -198,7 +198,7 @@ bool toV8{{cpp_class}}(const {{cpp_class}}* impl, v8::Local<v8::Object> dictiona
}
{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exception_state) {
{{cpp_class}}* impl = {{cpp_class}}::Create();
{{cpp_class}}* impl = MakeGarbageCollected<{{cpp_class}}>();
{{v8_class}}::ToImpl(isolate, value, impl, exception_state);
return impl;
}
......
......@@ -1837,7 +1837,7 @@ bool toV8TestDictionary(const TestDictionary* impl, v8::Local<v8::Object> dictio
}
TestDictionary* NativeValueTraits<TestDictionary>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exception_state) {
TestDictionary* impl = TestDictionary::Create();
TestDictionary* impl = MakeGarbageCollected<TestDictionary>();
V8TestDictionary::ToImpl(isolate, value, impl, exception_state);
return impl;
}
......
......@@ -184,7 +184,7 @@ bool toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
}
TestDictionaryDerivedImplementedAs* NativeValueTraits<TestDictionaryDerivedImplementedAs>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exception_state) {
TestDictionaryDerivedImplementedAs* impl = TestDictionaryDerivedImplementedAs::Create();
TestDictionaryDerivedImplementedAs* impl = MakeGarbageCollected<TestDictionaryDerivedImplementedAs>();
V8TestDictionaryDerivedImplementedAs::ToImpl(isolate, value, impl, exception_state);
return impl;
}
......
......@@ -99,7 +99,7 @@ bool toV8TestInterfaceEventInit(const TestInterfaceEventInit* impl, v8::Local<v8
}
TestInterfaceEventInit* NativeValueTraits<TestInterfaceEventInit>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exception_state) {
TestInterfaceEventInit* impl = TestInterfaceEventInit::Create();
TestInterfaceEventInit* impl = MakeGarbageCollected<TestInterfaceEventInit>();
V8TestInterfaceEventInit::ToImpl(isolate, value, impl, exception_state);
return impl;
}
......
......@@ -91,7 +91,7 @@ bool toV8TestPermissiveDictionary(const TestPermissiveDictionary* impl, v8::Loca
}
TestPermissiveDictionary* NativeValueTraits<TestPermissiveDictionary>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exception_state) {
TestPermissiveDictionary* impl = TestPermissiveDictionary::Create();
TestPermissiveDictionary* impl = MakeGarbageCollected<TestPermissiveDictionary>();
V8TestPermissiveDictionary::ToImpl(isolate, value, impl, exception_state);
return impl;
}
......
......@@ -125,7 +125,7 @@ bool toV8TestDictionary2(const TestDictionary2* impl, v8::Local<v8::Object> dict
}
TestDictionary2* NativeValueTraits<TestDictionary2>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exception_state) {
TestDictionary2* impl = TestDictionary2::Create();
TestDictionary2* impl = MakeGarbageCollected<TestDictionary2>();
V8TestDictionary2::ToImpl(isolate, value, impl, exception_state);
return impl;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment