Skip to content

Commit

Permalink
Roll Topaz/Tonic and call Dart_NewListOfType for TextBox lists (flutt…
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons authored Feb 13, 2018
1 parent 12a7162 commit 99319a3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ deps = {
Var('fuchsia_git') + '/garnet' + '@' + 'b3ba6b6d6ab8ef658278cc43c9f839a8a8d1718e',

'src/topaz':
Var('fuchsia_git') + '/topaz' + '@' + '531e2778d86b213bc663ea51bb0e0dde33d8ac8c',
Var('fuchsia_git') + '/topaz' + '@' + 'acf6b391d5ddad479427260b8683799685319dba',

'src/third_party/benchmark':
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22',
Expand Down
20 changes: 16 additions & 4 deletions lib/ui/text/text_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@ using namespace blink;

namespace tonic {

Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
if (val.is_null)
return Dart_Null();
namespace {

Dart_Handle GetTextBoxType() {
DartClassLibrary& class_library = DartState::Current()->class_library();
Dart_Handle type =
Dart_HandleFromPersistent(class_library.GetClass("ui", "TextBox"));
FXL_DCHECK(!LogIfError(type));
return type;
}

} // anonymous namespace

Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
if (val.is_null)
return Dart_Null();
constexpr int argc = 5;
Dart_Handle argv[argc] = {
tonic::ToDart(val.sk_rect.fLeft),
Expand All @@ -28,7 +36,11 @@ Dart_Handle DartConverter<TextBox>::ToDart(const TextBox& val) {
tonic::ToDart(val.sk_rect.fBottom),
tonic::ToDart(static_cast<int>(val.direction)),
};
return Dart_New(type, tonic::ToDart("_"), argc, argv);
return Dart_New(GetTextBoxType(), tonic::ToDart("_"), argc, argv);
}

Dart_Handle DartListFactory<TextBox>::NewList(intptr_t length) {
return Dart_NewListOfType(GetTextBoxType(), length);
}

} // namespace tonic
5 changes: 5 additions & 0 deletions lib/ui/text/text_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ struct DartConverter<blink::TextBox> {
static Dart_Handle ToDart(const blink::TextBox& val);
};

template <>
struct DartListFactory<blink::TextBox> {
static Dart_Handle NewList(intptr_t length);
};

} // namespace tonic

#endif // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_
21 changes: 15 additions & 6 deletions travis/licenses_golden/licenses_topaz
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 4728e5f9d4d6e0bccb12726a4f88a58c
Signature: 057c80bad7e34289bae50bb23ed6df3e

UNUSED LICENSES:

Expand Down Expand Up @@ -97,7 +97,6 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/widgets.dart
FILE: ../../../topaz/app/chat/packages/chat_models/lib/src/user_model.dart
FILE: ../../../topaz/app/chat/services/chat_content_provider.fidl
FILE: ../../../topaz/app/chat/services/firebase_db_client.fidl
FILE: ../../../topaz/app/color/lib/src/modular/module_model.dart
FILE: ../../../topaz/app/color/lib/src/parse_int.dart
FILE: ../../../topaz/app/contacts/agents/content_provider/lib/main.dart
FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_content_provider_impl.dart
Expand Down Expand Up @@ -394,6 +393,7 @@ FILE: ../../../topaz/public/dart/widgets/lib/src/model/spring_model.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/model/ticking_model.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/device_shell_model.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/device_shell_widget.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/module_impl.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/module_model.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/module_widget.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/user_shell_model.dart
Expand All @@ -419,10 +419,7 @@ FILE: ../../../topaz/public/lib/media/flutter/media_player.dart
FILE: ../../../topaz/public/lib/media/flutter/media_player_controller.dart
FILE: ../../../topaz/public/lib/media/flutter/progress_notifier.dart
FILE: ../../../topaz/public/lib/module/dart/lib/module.dart
FILE: ../../../topaz/public/lib/module/dart/lib/src/module_impl.dart
FILE: ../../../topaz/public/lib/module/dart/lib/src/simple_module.dart
FILE: ../../../topaz/public/lib/module_resolver/dart/daisy_builder.dart
FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_impl.dart
FILE: ../../../topaz/public/lib/story/dart/lib/story.dart
FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.cc
FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.h
Expand Down Expand Up @@ -639,7 +636,6 @@ FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets/time_util.dar
FILE: ../../../topaz/app/chat/modules/conversation_list/lib/main.dart
FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/user.dart
FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/time_util.dart
FILE: ../../../topaz/app/color/lib/main.dart
FILE: ../../../topaz/app/contacts/agents/content_provider/meta/sandbox
FILE: ../../../topaz/app/contacts/modules/contacts/android/AndroidManifest.xml
FILE: ../../../topaz/app/contacts/modules/contacts/lib/main.dart
Expand Down Expand Up @@ -1169,8 +1165,11 @@ FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/widgets/particip
FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/widgets/title_section.dart
FILE: ../../../topaz/app/chat/modules/conversation_info/lib/widgets.dart
FILE: ../../../topaz/app/chat/packages/chat_models/lib/chat_models.dart
FILE: ../../../topaz/app/color/lib/main.dart
FILE: ../../../topaz/app/color/lib/src/color_model.dart
FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/header.dart
FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/multi_select_header.dart
FILE: ../../../topaz/app/video/modules/video/lib/src/modular/video_progress.dart
FILE: ../../../topaz/examples/mine_digger/main.dart
FILE: ../../../topaz/public/dart/fuchsia/lib/src/fuchsia_fakes.dart
FILE: ../../../topaz/public/dart/widgets/lib/src/modular/dank_user_shell_widget.dart
Expand All @@ -1185,9 +1184,19 @@ FILE: ../../../topaz/public/dart/zircon/lib/src/handle_wrapper.dart
FILE: ../../../topaz/public/dart/zircon/lib/src/socket.dart
FILE: ../../../topaz/public/dart/zircon/lib/src/socket_reader.dart
FILE: ../../../topaz/public/dart/zircon/lib/src/vmo.dart
FILE: ../../../topaz/public/lib/app_driver/dart/lib/module_driver.dart
FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec2.dart
FILE: ../../../topaz/public/lib/lifecycle/dart/lib/lifecycle.dart
FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart
FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_impl.dart
FILE: ../../../topaz/public/lib/module/dart/lib/src/module_context_client.dart
FILE: ../../../topaz/public/lib/module/dart/lib/src/module_host.dart
FILE: ../../../topaz/public/lib/module/dart/lib/src/module_impl.dart
FILE: ../../../topaz/public/lib/proposal/dart/lib/proposal.dart
FILE: ../../../topaz/public/lib/proposal/dart/lib/src/proposal_factory.dart
FILE: ../../../topaz/public/lib/story/dart/lib/src/link_client.dart
FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_host.dart
FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_impl.dart
FILE: ../../../topaz/public/lib/user/dart/lib/src/dank_user_shell_impl.dart
FILE: ../../../topaz/runtime/dart_runner/kernel/compiler.dart
FILE: ../../../topaz/runtime/dart_runner/mapped_resource.cc
Expand Down

0 comments on commit 99319a3

Please sign in to comment.