未验证 提交 fa11ee6e 编写于 作者: C Chinmay Garde 提交者: GitHub

Fix native constructor of list of zircon handles and remove unused list...

Fix native constructor of list of zircon handles and remove unused list factory specializations. (#21980)
上级 0747f2f4
......@@ -25,18 +25,4 @@ struct TextBox {
} // namespace flutter
namespace tonic {
template <>
struct DartConverter<flutter::TextBox> {
static Dart_Handle ToDart(const flutter::TextBox& val);
};
template <>
struct DartListFactory<flutter::TextBox> {
static Dart_Handle NewList(intptr_t length);
};
} // namespace tonic
#endif // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_
......@@ -98,7 +98,8 @@ Dart_Handle MakeHandleList(const std::vector<zx_handle_t>& in_handles) {
tonic::DartClassLibrary& class_library =
tonic::DartState::Current()->class_library();
Dart_Handle handle_type = class_library.GetClass("zircon", "Handle");
Dart_Handle list = Dart_NewListOfType(handle_type, in_handles.size());
Dart_Handle list = Dart_NewListOfTypeFilled(
handle_type, Handle::CreateInvalid(), in_handles.size());
if (Dart_IsError(list))
return list;
for (size_t i = 0; i < in_handles.size(); i++) {
......
......@@ -166,18 +166,6 @@ struct DartConverter<PTR<T>> {
}
};
template <template <typename T> class PTR, typename T>
struct DartListFactory<
PTR<T>,
typename std::enable_if<
std::is_convertible<T*, const DartWrappable*>::value>::type> {
static Dart_Handle NewList(intptr_t length) {
Dart_PersistentHandle type = T::GetDartType(DartState::Current());
TONIC_DCHECK(!LogIfError(type));
return Dart_NewListOfType(Dart_HandleFromPersistent(type), length);
}
};
template <typename T>
inline T* GetReceiver(Dart_NativeArguments args) {
intptr_t receiver;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册