Fix native constructor of list of zircon handles and remove unused list factory specializations. (#21980)

This commit is contained in:
Chinmay Garde 2020-10-19 19:42:01 -07:00 committed by GitHub
parent 0747f2f4b1
commit fa11ee6e2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 27 deletions

View File

@ -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_

View File

@ -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++) {

View File

@ -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;