mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix native constructor of list of zircon handles and remove unused list factory specializations. (#21980)
This commit is contained in:
parent
0747f2f4b1
commit
fa11ee6e2a
@ -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++) {
|
||||
|
||||
12
third_party/tonic/dart_wrappable.h
vendored
12
third_party/tonic/dart_wrappable.h
vendored
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user