diff --git a/engine/src/flutter/glue/BUILD.gn b/engine/src/flutter/glue/BUILD.gn index 8a88cf1ab5..15b087d0ba 100644 --- a/engine/src/flutter/glue/BUILD.gn +++ b/engine/src/flutter/glue/BUILD.gn @@ -4,7 +4,6 @@ source_set("glue") { sources = [ - "movable_wrapper.h", "stack_trace.h", "thread.h", "trace_event.h", @@ -12,8 +11,6 @@ source_set("glue") { deps = [ "//lib/ftl", - "//mojo/public/cpp/environment", - "//mojo/public/cpp/system", ] if (is_fuchsia) { @@ -26,6 +23,8 @@ source_set("glue") { deps += [ "//lib/mtl", + "//mojo/public/cpp/environment", + "//mojo/public/cpp/system", ] public_deps = [ diff --git a/engine/src/flutter/glue/movable_wrapper.h b/engine/src/flutter/glue/movable_wrapper.h deleted file mode 100644 index 03b3645aaf..0000000000 --- a/engine/src/flutter/glue/movable_wrapper.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_GLU_MOVABLE_WRAPPER_H_ -#define FLUTTER_GLU_MOVABLE_WRAPPER_H_ - -#include - -namespace glue { - -template -class MovableWrapper { - public: - explicit MovableWrapper(T object) : object_(std::move(object)) {} - MovableWrapper(const MovableWrapper& other) - : object_(std::move(other.object_)) {} - - MovableWrapper(MovableWrapper&& other) : object_(std::move(other.object_)) {} - MovableWrapper& operator=(MovableWrapper&& other) { - object_ = std::move(other.object_); - } - - T Unwrap() { return std::move(object_); } - - private: - mutable T object_; -}; - -template -MovableWrapper WrapMovable(T object) { - return MovableWrapper(std::move(object)); -} - -} // namespace glue - -#endif // FLUTTER_GLU_MOVABLE_WRAPPER_H_ diff --git a/engine/src/flutter/lib/mojo/BUILD.gn b/engine/src/flutter/lib/mojo/BUILD.gn deleted file mode 100644 index e519c37c88..0000000000 --- a/engine/src/flutter/lib/mojo/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -source_set("mojo") { - sources = [ - "dart_mojo_internal.cc", - "dart_mojo_internal.h", - ] - - deps = [ - "//dart/runtime:libdart", - "//lib/ftl", - "//lib/tonic", - "//mojo/public/cpp/system", - "//mojo/public/platform/dart:mojo_internal_impl", - ] - - if (!is_fuchsia) { - deps += [ - "//mojo/public/cpp/environment:logging_only", - ] - } -} diff --git a/engine/src/flutter/lib/mojo/dart_mojo_internal.cc b/engine/src/flutter/lib/mojo/dart_mojo_internal.cc deleted file mode 100644 index 1206a586ca..0000000000 --- a/engine/src/flutter/lib/mojo/dart_mojo_internal.cc +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "flutter/lib/mojo/dart_mojo_internal.h" - -#include "dart/runtime/include/dart_api.h" -#include "lib/ftl/logging.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/logging/dart_error.h" -#include "mojo/public/platform/dart/mojo_natives.h" - -using tonic::LogIfError; -using tonic::ToDart; - -namespace blink { -namespace { - -MojoHandle g_handle_watcher_producer_handle = MOJO_HANDLE_INVALID; - -void SetHandleWatcherControlHandle(Dart_Handle mojo_internal) { - FTL_CHECK(g_handle_watcher_producer_handle != MOJO_HANDLE_INVALID); - Dart_Handle handle_watcher_type = - Dart_GetType(mojo_internal, ToDart("MojoHandleWatcher"), 0, nullptr); - Dart_Handle field_name = ToDart("mojoControlHandle"); - Dart_Handle control_port_value = ToDart(g_handle_watcher_producer_handle); - Dart_Handle result = - Dart_SetField(handle_watcher_type, field_name, control_port_value); - FTL_CHECK(!LogIfError(result)); -} - -} // namespace - -void DartMojoInternal::SetHandleWatcherProducerHandle(MojoHandle handle) { - FTL_CHECK(g_handle_watcher_producer_handle == MOJO_HANDLE_INVALID); - g_handle_watcher_producer_handle = handle; -} - -void DartMojoInternal::InitForIsolate() { - Dart_Handle mojo_internal = Dart_LookupLibrary(ToDart("dart:mojo.internal")); - DART_CHECK_VALID(Dart_SetNativeResolver(mojo_internal, - mojo::dart::MojoNativeLookup, - mojo::dart::MojoNativeSymbol)); - SetHandleWatcherControlHandle(mojo_internal); -} - -} // namespace blink diff --git a/engine/src/flutter/lib/mojo/dart_mojo_internal.h b/engine/src/flutter/lib/mojo/dart_mojo_internal.h deleted file mode 100644 index 8cc2e82b63..0000000000 --- a/engine/src/flutter/lib/mojo/dart_mojo_internal.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FLUTTER_LIB_MOJO_DART_MOJO_INTERNAL_H_ -#define FLUTTER_LIB_MOJO_DART_MOJO_INTERNAL_H_ - -#include "lib/ftl/macros.h" -#include "mojo/public/cpp/system/handle.h" - -namespace blink { - -class DartMojoInternal { - public: - static void InitForIsolate(); - - static void SetHandleWatcherProducerHandle(MojoHandle handle); - - private: - FTL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartMojoInternal); -}; - -} // namespace blink - -#endif // FLUTTER_LIB_MOJO_DART_MOJO_INTERNAL_H_ diff --git a/engine/src/flutter/lib/snapshot/BUILD.gn b/engine/src/flutter/lib/snapshot/BUILD.gn index 9d4e8770ce..74c40d1e9a 100644 --- a/engine/src/flutter/lib/snapshot/BUILD.gn +++ b/engine/src/flutter/lib/snapshot/BUILD.gn @@ -6,7 +6,6 @@ import("//flutter/lib/jni/dart_jni.gni") import("//flutter/lib/snapshot/toolchain.gni") import("//flutter/lib/ui/dart_ui.gni") import("//flutter/lib/ui/dart_ui.gni") -import("//mojo/dart/packages/mojo/sdk_ext_sources.gni") bindings_output_dir = "$root_gen_dir/sky/bindings" @@ -37,9 +36,6 @@ action("generate_snapshot_bin") { "snapshot.dart", ] + dart_ui_files + dart_jni_files - + rebase_path(dart_mojo_internal_sdk_sources, - "", - "//mojo/dart/packages/mojo") vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin" isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin" outputs = [ @@ -47,8 +43,6 @@ action("generate_snapshot_bin") { isolate_snapshot, ] - dart_mojo_internal_path = - rebase_path("//mojo/dart/packages/mojo/sdk_ext/internal.dart") rebased_dart_ui_path = rebase_path(dart_ui_path) rebased_dart_jni_path = rebase_path(dart_jni_path) @@ -70,7 +64,6 @@ action("generate_snapshot_bin") { rebase_path(isolate_snapshot, root_build_dir), "--target_os", target_os, - "--url_mapping=dart:mojo.internal,$dart_mojo_internal_path", "--url_mapping=dart:ui,$rebased_dart_ui_path", "--url_mapping=dart:jni,$rebased_dart_jni_path", ] diff --git a/engine/src/flutter/lib/snapshot/snapshot.dart b/engine/src/flutter/lib/snapshot/snapshot.dart index e55c48ad7b..5e1f35159e 100644 --- a/engine/src/flutter/lib/snapshot/snapshot.dart +++ b/engine/src/flutter/lib/snapshot/snapshot.dart @@ -11,6 +11,5 @@ import 'dart:io'; import 'dart:isolate'; import 'dart:jni'; import 'dart:math'; -import 'dart:mojo.internal'; import 'dart:ui'; import 'dart:typed_data'; diff --git a/engine/src/flutter/lib/snapshot/toolchain.gni b/engine/src/flutter/lib/snapshot/toolchain.gni index 49ef9c1dea..2ca434f750 100644 --- a/engine/src/flutter/lib/snapshot/toolchain.gni +++ b/engine/src/flutter/lib/snapshot/toolchain.gni @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//mojo/dart/packages/mojo/sdk_ext_sources.gni") import("//flutter/common/config.gni") # for flutter_aot if (target_os == "ios") { diff --git a/engine/src/flutter/lib/ui/dart_runtime_hooks.cc b/engine/src/flutter/lib/ui/dart_runtime_hooks.cc index 765b310807..f96d035317 100644 --- a/engine/src/flutter/lib/ui/dart_runtime_hooks.cc +++ b/engine/src/flutter/lib/ui/dart_runtime_hooks.cc @@ -72,21 +72,17 @@ static void InitDartInternal(Dart_Handle builtin_library, // Call |_setupHooks| to configure |VMLibraryHooks|. Dart_Handle method_name = Dart_NewStringFromCString("_setupHooks"); DART_CHECK_VALID(Dart_Invoke(builtin_library, method_name, 0, NULL)) - - // Call |_setupHooks| to configure |VMLibraryHooks|. - Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); - DART_CHECK_VALID(isolate_lib); - DART_CHECK_VALID(Dart_Invoke(isolate_lib, method_name, 0, NULL)); - } else { - FTL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate); - Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); - DART_CHECK_VALID(io_lib); - Dart_Handle setup_hooks = Dart_NewStringFromCString("_setupHooks"); - DART_CHECK_VALID(Dart_Invoke(io_lib, setup_hooks, 0, NULL)); - Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); - DART_CHECK_VALID(isolate_lib); - DART_CHECK_VALID(Dart_Invoke(isolate_lib, setup_hooks, 0, NULL)); } + + Dart_Handle setup_hooks = Dart_NewStringFromCString("_setupHooks"); + + Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); + DART_CHECK_VALID(io_lib); + DART_CHECK_VALID(Dart_Invoke(io_lib, setup_hooks, 0, NULL)); + + Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); + DART_CHECK_VALID(isolate_lib); + DART_CHECK_VALID(Dart_Invoke(isolate_lib, setup_hooks, 0, NULL)); } static void InitDartCore(Dart_Handle builtin, const std::string& script_uri) { diff --git a/engine/src/flutter/lib/ui/natives.dart b/engine/src/flutter/lib/ui/natives.dart index d16d0e3425..ee794c25c1 100644 --- a/engine/src/flutter/lib/ui/natives.dart +++ b/engine/src/flutter/lib/ui/natives.dart @@ -28,9 +28,6 @@ Future _scheduleFrame( } void _setupHooks() { - // Wire up timer implementation that is driven by MojoHandleWatcher. - VMLibraryHooks.eventHandlerSendData = MojoHandleWatcher.timer; - VMLibraryHooks.timerMillisecondClock = MojoCoreNatives.timerMillisecondClock; assert(() { // In debug mode, register the schedule frame extension. developer.registerExtension('ext.ui.window.scheduleFrame', _scheduleFrame); diff --git a/engine/src/flutter/lib/ui/painting/image_decoding.cc b/engine/src/flutter/lib/ui/painting/image_decoding.cc index 1698029094..4ec6e7b421 100644 --- a/engine/src/flutter/lib/ui/painting/image_decoding.cc +++ b/engine/src/flutter/lib/ui/painting/image_decoding.cc @@ -7,10 +7,10 @@ #include "flutter/common/threads.h" #include "flutter/flow/bitmap_image.h" #include "flutter/flow/texture_image.h" -#include "flutter/glue/movable_wrapper.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/resource_context.h" +#include "lib/ftl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" @@ -67,12 +67,13 @@ void InvokeImageCallback(sk_sp image, } void DecodeImageAndInvokeImageCallback( - glue::MovableWrapper> callback, + std::unique_ptr callback, std::vector buffer) { sk_sp image = DecodeImage(std::move(buffer)); - Threads::UI()->PostTask([callback, image]() mutable { - InvokeImageCallback(image, callback.Unwrap()); - }); + Threads::UI()->PostTask( + ftl::MakeCopyable([ callback = std::move(callback), image ]() mutable { + InvokeImageCallback(image, std::move(callback)); + })); } void DecodeImageFromList(Dart_NativeArguments args) { @@ -91,15 +92,16 @@ void DecodeImageFromList(Dart_NativeArguments args) { return; } - auto callback = glue::WrapMovable(std::unique_ptr( - new DartPersistentValue(tonic::DartState::Current(), callback_handle))); - const uint8_t* bytes = reinterpret_cast(list.data()); std::vector buffer(bytes, bytes + list.num_elements()); - Threads::IO()->PostTask([ callback, buffer = std::move(buffer) ]() mutable { - DecodeImageAndInvokeImageCallback(callback, std::move(buffer)); - }); + Threads::IO()->PostTask(ftl::MakeCopyable([ + callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + buffer = std::move(buffer) + ]() mutable { + DecodeImageAndInvokeImageCallback(std::move(callback), std::move(buffer)); + })); } } // namespace diff --git a/engine/src/flutter/lib/ui/ui.dart b/engine/src/flutter/lib/ui/ui.dart index fcc5f58a42..2dd261d27b 100644 --- a/engine/src/flutter/lib/ui/ui.dart +++ b/engine/src/flutter/lib/ui/ui.dart @@ -16,7 +16,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:math' as math; -import 'dart:mojo.internal'; import 'dart:nativewrappers'; import 'dart:typed_data'; diff --git a/engine/src/flutter/runtime/BUILD.gn b/engine/src/flutter/runtime/BUILD.gn index b788795ef0..0a0e6b17fd 100644 --- a/engine/src/flutter/runtime/BUILD.gn +++ b/engine/src/flutter/runtime/BUILD.gn @@ -23,9 +23,9 @@ action("gen_embedded_resources_cc") { "--output", rebase_path(output_file), "--outer_namespace", - "mojo", # TODO(abarth): Change namespace. + "flutter", "--inner_namespace", - "dart", # TODO(abarth): Change namespace. + "runtime", "--table_name", "flutter_embedded_service_isolate", "--root_prefix", @@ -71,13 +71,11 @@ source_set("runtime") { "//flutter/flow", "//flutter/glue", "//flutter/lib/io", - "//flutter/lib/mojo", "//flutter/lib/ui", "//flutter/skia", "//flutter/sky/engine/platform", "//lib/ftl", "//lib/tonic", - "//mojo/public/platform/dart:mojo_internal_impl", "//third_party/rapidjson", ] diff --git a/engine/src/flutter/runtime/dart_controller.cc b/engine/src/flutter/runtime/dart_controller.cc index a6ce086d43..ee90dec6df 100644 --- a/engine/src/flutter/runtime/dart_controller.cc +++ b/engine/src/flutter/runtime/dart_controller.cc @@ -11,7 +11,6 @@ #include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/io/dart_io.h" -#include "flutter/lib/mojo/dart_mojo_internal.h" #include "flutter/lib/ui/dart_runtime_hooks.h" #include "flutter/lib/ui/dart_ui.h" #include "flutter/lib/ui/ui_dart_state.h" @@ -137,8 +136,8 @@ void DartController::CreateIsolateFor(const std::string& script_uri, char* error = nullptr; Dart_Isolate isolate = Dart_CreateIsolate( script_uri.c_str(), "main", - reinterpret_cast(DART_SYMBOL(kIsolateSnapshot)), - nullptr, static_cast(state.get()), &error); + reinterpret_cast(DART_SYMBOL(kIsolateSnapshot)), nullptr, + static_cast(state.get()), &error); FTL_CHECK(isolate) << error; ui_dart_state_ = state.release(); dart_state()->message_handler().Initialize(blink::Threads::UI()); @@ -153,7 +152,6 @@ void DartController::CreateIsolateFor(const std::string& script_uri, tonic::DartApiScope dart_api_scope; DartIO::InitForIsolate(); DartUI::InitForIsolate(); - DartMojoInternal::InitForIsolate(); DartRuntimeHooks::Install(DartRuntimeHooks::MainIsolate, script_uri); std::unique_ptr ui_class_provider( diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index 5d018d8bc8..e4caf78de7 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -24,7 +24,6 @@ #include "flutter/common/settings.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/io/dart_io.h" -#include "flutter/lib/mojo/dart_mojo_internal.h" #include "flutter/lib/ui/dart_runtime_hooks.h" #include "flutter/lib/ui/dart_ui.h" #include "flutter/lib/ui/ui_dart_state.h" @@ -48,7 +47,6 @@ #include "lib/tonic/scopes/dart_api_scope.h" #include "lib/tonic/scopes/dart_isolate_scope.h" #include "lib/tonic/typed_data/uint8_list.h" -#include "mojo/public/platform/dart/dart_handle_watcher.h" #if defined(OS_ANDROID) #include "flutter/lib/jni/dart_jni.h" @@ -219,7 +217,6 @@ Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, tonic::DartApiScope dart_api_scope; DartIO::InitForIsolate(); DartUI::InitForIsolate(); - DartMojoInternal::InitForIsolate(); DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); const Settings& settings = Settings::Get(); if (settings.enable_observatory) { @@ -295,7 +292,6 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, tonic::DartApiScope dart_api_scope; DartIO::InitForIsolate(); DartUI::InitForIsolate(); - DartMojoInternal::InitForIsolate(); DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); std::unique_ptr ui_class_provider( @@ -582,9 +578,6 @@ void InitDartVM() { } } - DartMojoInternal::SetHandleWatcherProducerHandle( - mojo::dart::HandleWatcher::Start()); - std::vector args; // Instruct the VM to ignore unrecognized flags. diff --git a/engine/src/flutter/runtime/dart_service_isolate.cc b/engine/src/flutter/runtime/dart_service_isolate.cc index b37559901f..1dd8498446 100644 --- a/engine/src/flutter/runtime/dart_service_isolate.cc +++ b/engine/src/flutter/runtime/dart_service_isolate.cc @@ -29,8 +29,8 @@ #define kLibrarySourceNamePrefix "/vmservice" static const char* kServiceIsolateScript = "vmservice_io.dart"; -namespace mojo { -namespace dart { +namespace flutter { +namespace runtime { extern ResourcesEntry __flutter_embedded_service_isolate_resources_[]; } } @@ -104,7 +104,7 @@ bool DartServiceIsolate::Startup(std::string server_ip, if (!g_resources) { g_resources = new EmbedderResources( - &mojo::dart::__flutter_embedded_service_isolate_resources_[0]); + &flutter::runtime::__flutter_embedded_service_isolate_resources_[0]); } Dart_Handle result; diff --git a/engine/src/flutter/runtime/dart_vm_entry_points.txt b/engine/src/flutter/runtime/dart_vm_entry_points.txt index 0500cd4145..3c2a81b721 100644 --- a/engine/src/flutter/runtime/dart_vm_entry_points.txt +++ b/engine/src/flutter/runtime/dart_vm_entry_points.txt @@ -1,7 +1,6 @@ dart:io,::,_setupHooks dart:io,_Platform,set:_nativeScript dart:isolate,::,_startMainIsolate -dart:mojo.internal,MojoHandleWatcher,mojoControlHandle dart:ui,::,_beginFrame dart:ui,::,_dispatchPlatformMessage dart:ui,::,_dispatchPointerDataPacket diff --git a/engine/src/flutter/runtime/embedder_resources.cc b/engine/src/flutter/runtime/embedder_resources.cc index 851a71b448..7fe01c5372 100644 --- a/engine/src/flutter/runtime/embedder_resources.cc +++ b/engine/src/flutter/runtime/embedder_resources.cc @@ -10,7 +10,7 @@ namespace blink { -using mojo::dart::ResourcesEntry; +using flutter::runtime::ResourcesEntry; EmbedderResources::EmbedderResources(ResourcesEntry* resources_table) : resources_table_(resources_table) {} diff --git a/engine/src/flutter/runtime/embedder_resources.h b/engine/src/flutter/runtime/embedder_resources.h index 2bc25177c2..eb3a0b833f 100644 --- a/engine/src/flutter/runtime/embedder_resources.h +++ b/engine/src/flutter/runtime/embedder_resources.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_RUNTIME_EMBEDDER_RESOURCES_H_ #define FLUTTER_RUNTIME_EMBEDDER_RESOURCES_H_ -namespace mojo { -namespace dart { +namespace flutter { +namespace runtime { struct ResourcesEntry { const char* path_; @@ -14,14 +14,14 @@ struct ResourcesEntry { int length_; }; -} // namespace dart -} // namespace mojo +} // namespace runtime +} // namespace flutter namespace blink { class EmbedderResources { public: - EmbedderResources(mojo::dart::ResourcesEntry* resources_table); + EmbedderResources(flutter::runtime::ResourcesEntry* resources_table); static const int kNoSuchInstance; @@ -29,9 +29,9 @@ class EmbedderResources { const char* Path(int idx); private: - mojo::dart::ResourcesEntry* At(int idx); + flutter::runtime::ResourcesEntry* At(int idx); - mojo::dart::ResourcesEntry* resources_table_; + flutter::runtime::ResourcesEntry* resources_table_; }; } // namespace blink diff --git a/engine/src/flutter/shell/common/BUILD.gn b/engine/src/flutter/shell/common/BUILD.gn index 4af5f458dc..4ba7fd3668 100644 --- a/engine/src/flutter/shell/common/BUILD.gn +++ b/engine/src/flutter/shell/common/BUILD.gn @@ -2,7 +2,58 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//mojo/dart/embedder/embedder.gni") +# Template to generate a dart embedder resource.cc file. +# Required invoker inputs: +# String output (name of output file) +# List inputs (list of input files to be included) +# String table_name (name of symbol for resource table) +# String root_prefix (base directory of resources) +# Optional invoker inputs: +# String input_directory (directory of resources that are recursively added) +# List deps +# List datadeps +template("dart_embedder_resources") { + action(target_name) { + script = "//dart/runtime/tools/create_resources.py" + deps = [] + if (defined(invoker.deps)) { + deps += invoker.deps + } + datadeps = [] + if (defined(invoker.datadeps)) { + datadeps = invoker.datadeps + } + + output = invoker.output + outputs = [ + output, + ] + + inputs = [ script ] + invoker.inputs + + root_prefix = rebase_path(invoker.root_prefix) + + args = [ + "--output", + rebase_path(output), + "--outer_namespace", + "flutter", + "--inner_namespace", + "runtime", + "--table_name", + invoker.table_name, + "--root_prefix", + root_prefix, + ] + if (defined(invoker.input_directory)) { + args += [ + "--client_root", + rebase_path(invoker.input_directory), + ] + } + args += rebase_path(invoker.inputs) + } +} dart_embedder_resources("generate_embedder_diagnostic_server_resources_cc") { inputs = [ @@ -62,7 +113,6 @@ source_set("common") { "//flutter/synchronization", "//lib/ftl", "//lib/tonic", - "//mojo/message_pump", "//third_party/libjpeg", "//third_party/rapidjson", ":generate_embedder_diagnostic_server_resources_cc", diff --git a/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc b/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc index bcdd9d6a89..73c76fddc6 100644 --- a/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc +++ b/engine/src/flutter/shell/common/diagnostic/diagnostic_server.cc @@ -19,8 +19,8 @@ #include "lib/tonic/logging/dart_invoke.h" #include "third_party/skia/include/core/SkStream.h" -namespace mojo { -namespace dart { +namespace flutter { +namespace runtime { extern ResourcesEntry __sky_embedder_diagnostic_server_resources_[]; } } @@ -69,7 +69,7 @@ void DiagnosticServer::Start() { } EmbedderResources resources( - &mojo::dart::__sky_embedder_diagnostic_server_resources_[0]); + &flutter::runtime::__sky_embedder_diagnostic_server_resources_[0]); const char* source = nullptr; int source_length = diff --git a/engine/src/flutter/shell/common/engine.cc b/engine/src/flutter/shell/common/engine.cc index a21630aa0b..58a65b3d38 100644 --- a/engine/src/flutter/shell/common/engine.cc +++ b/engine/src/flutter/shell/common/engine.cc @@ -12,7 +12,6 @@ #include "flutter/assets/unzipper_provider.h" #include "flutter/assets/zip_asset_store.h" #include "flutter/common/threads.h" -#include "flutter/glue/movable_wrapper.h" #include "flutter/glue/trace_event.h" #include "flutter/runtime/asset_font_selector.h" #include "flutter/runtime/dart_controller.h" diff --git a/engine/src/flutter/shell/common/shell.cc b/engine/src/flutter/shell/common/shell.cc index 629e69c4c8..4c0aef4726 100644 --- a/engine/src/flutter/shell/common/shell.cc +++ b/engine/src/flutter/shell/common/shell.cc @@ -28,17 +28,12 @@ #include "flutter/shell/common/diagnostic/diagnostic_server.h" #include "flutter/skia/ext/event_tracer_impl.h" #include "lib/ftl/files/unique_fd.h" -#include "mojo/message_pump/message_pump_mojo.h" namespace shell { namespace { static Shell* g_shell = nullptr; -scoped_ptr CreateMessagePumpMojo() { - return make_scoped_ptr(new mojo::common::MessagePumpMojo); -} - bool IsInvalid(const ftl::WeakPtr& rasterizer) { return !rasterizer; } @@ -82,7 +77,6 @@ Shell::Shell() { DCHECK(!g_shell); base::Thread::Options options; - options.message_pump_factory = base::Bind(&CreateMessagePumpMojo); gpu_thread_.reset(new base::Thread("gpu_thread")); gpu_thread_->StartWithOptions(options); diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index 6d5a9f7977..95d0032296 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -50,8 +50,6 @@ shared_library("sky_shell") { "//flutter/skia", "//flutter/vulkan", "//lib/ftl", - "//mojo/edk/base_edk", - "//mojo/edk/system", ":jni_headers", ] diff --git a/engine/src/flutter/shell/platform/android/flutter_main.cc b/engine/src/flutter/shell/platform/android/flutter_main.cc index 2a790002d7..8b733731f8 100644 --- a/engine/src/flutter/shell/platform/android/flutter_main.cc +++ b/engine/src/flutter/shell/platform/android/flutter_main.cc @@ -24,8 +24,6 @@ #include "flutter/shell/common/shell.h" #include "jni/FlutterMain_jni.h" #include "lib/ftl/macros.h" -#include "mojo/edk/embedder/embedder.h" -#include "mojo/edk/embedder/simple_platform_support.h" using base::LazyInstance; @@ -78,8 +76,6 @@ static void Init(JNIEnv* env, g_java_message_loop.Get().reset(new base::MessageLoopForUI); base::MessageLoopForUI::current()->Start(); - mojo::embedder::Init(mojo::embedder::CreateSimplePlatformSupport()); - Shell::InitStandalone(); InitializeTracing(); diff --git a/engine/src/flutter/shell/platform/darwin/common/BUILD.gn b/engine/src/flutter/shell/platform/darwin/common/BUILD.gn index e75343c181..9e6ae40fd5 100644 --- a/engine/src/flutter/shell/platform/darwin/common/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/common/BUILD.gn @@ -26,7 +26,5 @@ source_set("common") { "//flutter/skia", "//flutter/sky/engine/wtf", "//lib/ftl", - "//mojo/edk/base_edk", - "//mojo/edk/system", ] } diff --git a/engine/src/flutter/shell/platform/darwin/common/platform_mac.mm b/engine/src/flutter/shell/platform/darwin/common/platform_mac.mm index 39c8934b5e..c60460df39 100644 --- a/engine/src/flutter/shell/platform/darwin/common/platform_mac.mm +++ b/engine/src/flutter/shell/platform/darwin/common/platform_mac.mm @@ -23,8 +23,6 @@ #include "flutter/shell/common/switches.h" #include "flutter/shell/common/tracing_controller.h" #include "flutter/sky/engine/wtf/MakeUnique.h" -#include "mojo/edk/embedder/embedder.h" -#include "mojo/edk/embedder/simple_platform_support.h" namespace shell { @@ -92,8 +90,6 @@ class EmbedderState { embedder_message_loop_->Attach(); #endif - mojo::embedder::Init(mojo::embedder::CreateSimplePlatformSupport()); - shell::Shell::InitStandalone(icu_data_path); } diff --git a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn index 319f7cf162..3a7d33d9f2 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn +++ b/engine/src/flutter/shell/platform/darwin/ios/BUILD.gn @@ -61,8 +61,6 @@ shared_library("flutter_framework_dylib") { "//flutter/sky/engine/platform", "//flutter/sky/engine/wtf", "//lib/ftl", - "//mojo/edk/base_edk", - "//mojo/edk/system", ] defines = [ diff --git a/engine/src/flutter/shell/platform/linux/BUILD.gn b/engine/src/flutter/shell/platform/linux/BUILD.gn index 3a1d8fbda3..3f5785fbbd 100644 --- a/engine/src/flutter/shell/platform/linux/BUILD.gn +++ b/engine/src/flutter/shell/platform/linux/BUILD.gn @@ -21,8 +21,6 @@ executable("linux") { "//flutter/shell/testing", "//flutter/skia", "//lib/ftl", - "//mojo/edk/base_edk", - "//mojo/edk/system", "//third_party/glfw", ] diff --git a/engine/src/flutter/shell/platform/linux/main_linux.cc b/engine/src/flutter/shell/platform/linux/main_linux.cc index b7599ec007..9abeb93421 100644 --- a/engine/src/flutter/shell/platform/linux/main_linux.cc +++ b/engine/src/flutter/shell/platform/linux/main_linux.cc @@ -15,15 +15,12 @@ #include "flutter/shell/platform/linux/message_pump_glfw.h" #include "flutter/shell/platform/linux/platform_view_glfw.h" #include "flutter/shell/testing/testing.h" -#include "mojo/edk/embedder/embedder.h" -#include "mojo/edk/embedder/simple_platform_support.h" namespace { int RunNonInteractive() { base::MessageLoop message_loop; - mojo::embedder::Init(mojo::embedder::CreateSimplePlatformSupport()); shell::Shell::InitStandalone(); if (!shell::InitForTesting()) { @@ -45,7 +42,6 @@ int RunInteractive() { base::MessageLoop message_loop(shell::MessagePumpGLFW::Create()); - mojo::embedder::Init(mojo::embedder::CreateSimplePlatformSupport()); shell::Shell::InitStandalone(); std::string target = command_line.GetSwitchValueASCII(shell::switches::kFLX); diff --git a/engine/src/flutter/sky/packages/sky_engine/BUILD.gn b/engine/src/flutter/sky/packages/sky_engine/BUILD.gn index 53981238ed..969168d474 100644 --- a/engine/src/flutter/sky/packages/sky_engine/BUILD.gn +++ b/engine/src/flutter/sky/packages/sky_engine/BUILD.gn @@ -5,8 +5,8 @@ import("//dart/sdk/lib/rules.gni") import("//flutter/lib/jni/dart_jni.gni") import("//flutter/lib/ui/dart_ui.gni") -import("//mojo/public/dart/rules.gni") import("//flutter/sky/engine/core/core.gni") +import("//mojo/public/dart/rules.gni") copy("copy_sky_engine_authors") { sources = [ diff --git a/engine/src/flutter/sky/packages/sky_services/BUILD.gn b/engine/src/flutter/sky/packages/sky_services/BUILD.gn index 847d533274..d51dd3604a 100644 --- a/engine/src/flutter/sky/packages/sky_services/BUILD.gn +++ b/engine/src/flutter/sky/packages/sky_services/BUILD.gn @@ -23,6 +23,5 @@ dart_pkg("sky_services") { deps = [ ":copy_sky_services_license", - "//flutter/services/platform:interfaces", ] } diff --git a/engine/src/flutter/sky/packages/sky_services/README.md b/engine/src/flutter/sky/packages/sky_services/README.md index bc21610ce6..350846c272 100644 --- a/engine/src/flutter/sky/packages/sky_services/README.md +++ b/engine/src/flutter/sky/packages/sky_services/README.md @@ -1,6 +1,4 @@ Flutter Services ================ -This packages contains `mojom` interfaces to services associated with Flutter. Most -developers should depend on the [Flutter package](http://docs.flutter.io/flutter/services/services-library.html) -instead of using this package directly. +This packages is empty. \ No newline at end of file diff --git a/engine/src/flutter/sky/packages/sky_services/pubspec.yaml b/engine/src/flutter/sky/packages/sky_services/pubspec.yaml index d1ff625eae..a6ff01e596 100644 --- a/engine/src/flutter/sky/packages/sky_services/pubspec.yaml +++ b/engine/src/flutter/sky/packages/sky_services/pubspec.yaml @@ -1,9 +1,7 @@ name: sky_services version: 0.0.99 author: Flutter Authors -description: Mojom interfaces associated with Flutter +description: An empty package homepage: http://flutter.io -dependencies: - mojo_sdk: 0.2.31 environment: sdk: '>=1.8.0 <2.0.0'