Skip to content

Commit

Permalink
Fix native constructor of list of zircon handles and remove unused li…
Browse files Browse the repository at this point in the history
…st factory specializations. (flutter#21980)
  • Loading branch information
chinmaygarde authored Oct 20, 2020
1 parent 0747f2f commit fa11ee6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
14 changes: 0 additions & 14 deletions lib/ui/text/text_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
3 changes: 2 additions & 1 deletion shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
12 changes: 0 additions & 12 deletions third_party/tonic/dart_wrappable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa11ee6

Please sign in to comment.