Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 43c08bb

Browse files
authored
Revert "Split AOT Android Embedder and shell (#22179)"
This reverts commit 53fc019.
1 parent 97cacfb commit 43c08bb

29 files changed

+3
-1242
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ deps = {
482482
'packages': [
483483
{
484484
'package': 'flutter/android/embedding_bundle',
485-
'version': 'last_updated:2020-09-11T17:57:41-0700'
485+
'version': 'last_updated:2020-05-20T01:36:16-0700'
486486
}
487487
],
488488
'condition': 'download_android_deps',

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/Flutte
747747
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartExecutor.java
748748
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartMessenger.java
749749
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/PlatformMessageHandler.java
750-
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dynamicfeatures/DynamicFeatureManager.java
751-
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dynamicfeatures/PlayStoreDynamicFeatureManager.java
752750
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/ApplicationInfoLoader.java
753751
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterApplicationInfo.java
754752
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java

shell/common/engine.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -507,21 +507,4 @@ const std::string& Engine::GetLastEntrypointLibrary() const {
507507
return last_entry_point_library_;
508508
}
509509

510-
// The Following commented out code connects into part 2 of the split AOT
511-
// feature. Left commented out until it lands:
512-
513-
// // |RuntimeDelegate|
514-
// void Engine::RequestDartDeferredLibrary(intptr_t loading_unit_id) {
515-
// return delegate_.RequestDartDeferredLibrary(loading_unit_id);
516-
// }
517-
518-
void Engine::LoadDartDeferredLibrary(intptr_t loading_unit_id,
519-
const uint8_t* snapshot_data,
520-
const uint8_t* snapshot_instructions) {
521-
if (runtime_controller_->IsRootIsolateRunning()) {
522-
// runtime_controller_->LoadDartDeferredLibrary(loading_unit_id,
523-
// snapshot_data, snapshot_instructions);
524-
}
525-
}
526-
527510
} // namespace flutter

shell/common/engine.h

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -260,21 +260,6 @@ class Engine final : public RuntimeDelegate,
260260
virtual std::unique_ptr<std::vector<std::string>>
261261
ComputePlatformResolvedLocale(
262262
const std::vector<std::string>& supported_locale_data) = 0;
263-
264-
//--------------------------------------------------------------------------
265-
/// @brief Invoked when the Dart VM requests that a deferred library
266-
/// be loaded. Notifies the engine that the deferred library
267-
/// identified by the specified loading unit id should be
268-
/// downloaded and loaded into the Dart VM via
269-
/// `LoadDartDeferredLibrary`
270-
///
271-
/// @param[in] loading_unit_id The unique id of the deferred library's
272-
/// loading unit. This id is to be passed
273-
/// back into LoadDartDeferredLibrary
274-
/// in order to identify which deferred
275-
/// library to load.
276-
///
277-
virtual void RequestDartDeferredLibrary(intptr_t loading_unit_id) = 0;
278263
};
279264

280265
//----------------------------------------------------------------------------
@@ -782,38 +767,6 @@ class Engine final : public RuntimeDelegate,
782767
///
783768
const std::string& InitialRoute() const { return initial_route_; }
784769

785-
//--------------------------------------------------------------------------
786-
/// @brief Loads the Dart shared library into the Dart VM. When the
787-
/// Dart library is loaded successfully, the Dart future
788-
/// returned by the originating loadLibrary() call completes.
789-
///
790-
/// The Dart compiler may generate separate shared libraries
791-
/// files called 'loading units' when libraries are imported
792-
/// as deferred. Each of these shared libraries are identified
793-
/// by a unique loading unit id. Callers should dlopen the
794-
/// shared library file and use dlsym to resolve the dart
795-
/// symbols. These symbols can then be passed to this method to
796-
/// be dynamically loaded into the VM.
797-
///
798-
/// This method is paired with a RequestDartDeferredLibrary
799-
/// invocation that provides the embedder with the loading unit id
800-
/// of the deferred library to load.
801-
///
802-
///
803-
/// @param[in] loading_unit_id The unique id of the deferred library's
804-
/// loading unit, as passed in by
805-
/// RequestDartDeferredLibrary.
806-
///
807-
/// @param[in] snapshot_data Dart snapshot data of the loading unit's
808-
/// shared library.
809-
///
810-
/// @param[in] snapshot_data Dart snapshot instructions of the loading
811-
/// unit's shared library.
812-
///
813-
void LoadDartDeferredLibrary(intptr_t loading_unit_id,
814-
const uint8_t* snapshot_data,
815-
const uint8_t* snapshot_instructions);
816-
817770
private:
818771
Engine::Delegate& delegate_;
819772
const Settings settings_;
@@ -862,12 +815,6 @@ class Engine final : public RuntimeDelegate,
862815
std::unique_ptr<std::vector<std::string>> ComputePlatformResolvedLocale(
863816
const std::vector<std::string>& supported_locale_data) override;
864817

865-
// The Following commented out code connects into part 2 of the split AOT
866-
// feature. Left commented out until it lands:
867-
868-
// // |RuntimeDelegate|
869-
// void RequestDartDeferredLibrary(intptr_t loading_unit_id) override;
870-
871818
void SetNeedsReportTimings(bool value) override;
872819

873820
void StopAnimator();

shell/common/engine_unittests.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class MockDelegate : public Engine::Delegate {
3232
MOCK_METHOD1(ComputePlatformResolvedLocale,
3333
std::unique_ptr<std::vector<std::string>>(
3434
const std::vector<std::string>&));
35-
MOCK_METHOD1(RequestDartDeferredLibrary, void(intptr_t));
3635
};
3736

3837
class MockResponse : public PlatformMessageResponse {
@@ -56,7 +55,6 @@ class MockRuntimeDelegate : public RuntimeDelegate {
5655
MOCK_METHOD1(ComputePlatformResolvedLocale,
5756
std::unique_ptr<std::vector<std::string>>(
5857
const std::vector<std::string>&));
59-
MOCK_METHOD1(RequestDartDeferredLibrary, void(intptr_t));
6058
};
6159

6260
class MockRuntimeController : public RuntimeController {

shell/common/platform_view.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,4 @@ PlatformView::ComputePlatformResolvedLocales(
159159
return out;
160160
}
161161

162-
void PlatformView::RequestDartDeferredLibrary(intptr_t loading_unit_id) {}
163-
164-
void PlatformView::LoadDartDeferredLibrary(
165-
intptr_t loading_unit_id,
166-
const uint8_t* snapshot_data,
167-
const uint8_t* snapshot_instructions) {}
168-
169-
void PlatformView::UpdateAssetManager(
170-
std::shared_ptr<AssetManager> asset_manager) {}
171-
172162
} // namespace flutter

shell/common/platform_view.h

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -210,43 +210,6 @@ class PlatformView {
210210
///
211211
virtual void OnPlatformViewMarkTextureFrameAvailable(
212212
int64_t texture_id) = 0;
213-
214-
//--------------------------------------------------------------------------
215-
/// @brief Loads the dart shared library into the dart VM. When the
216-
/// dart library is loaded successfully, the dart future
217-
/// returned by the originating loadLibrary() call completes.
218-
///
219-
/// The Dart compiler may generate separate shared library .so
220-
/// files called 'loading units' when libraries are imported
221-
/// as deferred. Each of these shared libraries are identified
222-
/// by a unique loading unit id and can be dynamically loaded
223-
/// into the VM by dlopen-ing and resolving the data and
224-
/// instructions symbols.
225-
///
226-
///
227-
/// @param[in] loading_unit_id The unique id of the deferred library's
228-
/// loading unit.
229-
///
230-
/// @param[in] snapshot_data Dart snapshot data of the loading unit's
231-
/// shared library.
232-
///
233-
/// @param[in] snapshot_data Dart snapshot instructions of the loading
234-
/// unit's shared library.
235-
///
236-
virtual void LoadDartDeferredLibrary(
237-
intptr_t loading_unit_id,
238-
const uint8_t* snapshot_data,
239-
const uint8_t* snapshot_instructions) = 0;
240-
241-
// TODO(garyq): Implement a proper asset_resolver replacement instead of
242-
// overwriting the entire asset manager.
243-
//--------------------------------------------------------------------------
244-
/// @brief Sets the asset manager of the engine to asset_manager
245-
///
246-
/// @param[in] asset_manager The asset manager to use.
247-
///
248-
virtual void UpdateAssetManager(
249-
std::shared_ptr<AssetManager> asset_manager) = 0;
250213
};
251214

252215
//----------------------------------------------------------------------------
@@ -602,62 +565,6 @@ class PlatformView {
602565

603566
virtual std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder();
604567

605-
//--------------------------------------------------------------------------
606-
/// @brief Invoked when the dart VM requests that a deferred library
607-
/// be loaded. Notifies the engine that the deferred library
608-
/// identified by the specified loading unit id should be
609-
/// downloaded and loaded into the Dart VM via
610-
/// `LoadDartDeferredLibrary`
611-
///
612-
/// @param[in] loading_unit_id The unique id of the deferred library's
613-
/// loading unit. This id is to be passed
614-
/// back into LoadDartDeferredLibrary
615-
/// in order to identify which deferred
616-
/// library to load.
617-
///
618-
virtual void RequestDartDeferredLibrary(intptr_t loading_unit_id);
619-
620-
//--------------------------------------------------------------------------
621-
/// @brief Loads the Dart shared library into the Dart VM. When the
622-
/// Dart library is loaded successfully, the Dart future
623-
/// returned by the originating loadLibrary() call completes.
624-
///
625-
/// The Dart compiler may generate separate shared libraries
626-
/// files called 'loading units' when libraries are imported
627-
/// as deferred. Each of these shared libraries are identified
628-
/// by a unique loading unit id. Callers should dlopen the
629-
/// shared library file and use dlsym to resolve the dart
630-
/// symbols. These symbols can then be passed to this method to
631-
/// be dynamically loaded into the VM.
632-
///
633-
/// This method is paired with a RequestDartDeferredLibrary
634-
/// invocation that provides the embedder with the loading unit id
635-
/// of the deferred library to load.
636-
///
637-
///
638-
/// @param[in] loading_unit_id The unique id of the deferred library's
639-
/// loading unit, as passed in by
640-
/// RequestDartDeferredLibrary.
641-
///
642-
/// @param[in] snapshot_data Dart snapshot data of the loading unit's
643-
/// shared library.
644-
///
645-
/// @param[in] snapshot_data Dart snapshot instructions of the loading
646-
/// unit's shared library.
647-
///
648-
virtual void LoadDartDeferredLibrary(intptr_t loading_unit_id,
649-
const uint8_t* snapshot_data,
650-
const uint8_t* snapshot_instructions);
651-
652-
// TODO(garyq): Implement a proper asset_resolver replacement instead of
653-
// overwriting the entire asset manager.
654-
//--------------------------------------------------------------------------
655-
/// @brief Sets the asset manager of the engine to asset_manager
656-
///
657-
/// @param[in] asset_manager The asset manager to use.
658-
///
659-
virtual void UpdateAssetManager(std::shared_ptr<AssetManager> asset_manager);
660-
661568
protected:
662569
PlatformView::Delegate& delegate_;
663570
const TaskRunners task_runners_;

shell/common/shell.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,22 +1185,6 @@ std::unique_ptr<std::vector<std::string>> Shell::ComputePlatformResolvedLocale(
11851185
return platform_view_->ComputePlatformResolvedLocales(supported_locale_data);
11861186
}
11871187

1188-
void Shell::LoadDartDeferredLibrary(intptr_t loading_unit_id,
1189-
const uint8_t* snapshot_data,
1190-
const uint8_t* snapshot_instructions) {
1191-
engine_->LoadDartDeferredLibrary(loading_unit_id, snapshot_data,
1192-
snapshot_instructions);
1193-
}
1194-
1195-
void Shell::UpdateAssetManager(std::shared_ptr<AssetManager> asset_manager) {
1196-
engine_->UpdateAssetManager(std::move(asset_manager));
1197-
}
1198-
1199-
// |Engine::Delegate|
1200-
void Shell::RequestDartDeferredLibrary(intptr_t loading_unit_id) {
1201-
platform_view_->RequestDartDeferredLibrary(loading_unit_id);
1202-
}
1203-
12041188
void Shell::ReportTimings() {
12051189
FML_DCHECK(is_setup_);
12061190
FML_DCHECK(task_runners_.GetRasterTaskRunner()->RunsTasksOnCurrentThread());

shell/common/shell.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,6 @@ class Shell final : public PlatformView::Delegate,
507507
// |PlatformView::Delegate|
508508
void OnPlatformViewSetNextFrameCallback(const fml::closure& closure) override;
509509

510-
// |PlatformView::Delegate|
511-
void LoadDartDeferredLibrary(intptr_t loading_unit_id,
512-
const uint8_t* snapshot_data,
513-
const uint8_t* snapshot_instructions) override;
514-
515-
// |PlatformView::Delegate|
516-
void UpdateAssetManager(std::shared_ptr<AssetManager> asset_manager) override;
517-
518510
// |Animator::Delegate|
519511
void OnAnimatorBeginFrame(fml::TimePoint frame_target_time) override;
520512

@@ -556,9 +548,6 @@ class Shell final : public PlatformView::Delegate,
556548
std::unique_ptr<std::vector<std::string>> ComputePlatformResolvedLocale(
557549
const std::vector<std::string>& supported_locale_data) override;
558550

559-
// |Engine::Delegate|
560-
void RequestDartDeferredLibrary(intptr_t loading_unit_id) override;
561-
562551
// |Rasterizer::Delegate|
563552
void OnFrameRasterized(const FrameTiming&) override;
564553

shell/platform/android/BUILD.gn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ android_java_sources = [
156156
"io/flutter/embedding/engine/dart/DartExecutor.java",
157157
"io/flutter/embedding/engine/dart/DartMessenger.java",
158158
"io/flutter/embedding/engine/dart/PlatformMessageHandler.java",
159-
"io/flutter/embedding/engine/dynamicfeatures/DynamicFeatureManager.java",
160-
"io/flutter/embedding/engine/dynamicfeatures/PlayStoreDynamicFeatureManager.java",
161159
"io/flutter/embedding/engine/loader/ApplicationInfoLoader.java",
162160
"io/flutter/embedding/engine/loader/FlutterApplicationInfo.java",
163161
"io/flutter/embedding/engine/loader/FlutterLoader.java",
@@ -464,7 +462,6 @@ action("robolectric_tests") {
464462
"test/io/flutter/embedding/engine/RenderingComponentTest.java",
465463
"test/io/flutter/embedding/engine/dart/DartExecutorTest.java",
466464
"test/io/flutter/embedding/engine/dart/DartMessengerTest.java",
467-
"test/io/flutter/embedding/engine/dynamicfeatures/PlayStoreDynamicFeatureManagerTest.java",
468465
"test/io/flutter/embedding/engine/loader/ApplicationInfoLoaderTest.java",
469466
"test/io/flutter/embedding/engine/loader/FlutterLoaderTest.java",
470467
"test/io/flutter/embedding/engine/mutatorsstack/FlutterMutatorViewTest.java",

0 commit comments

Comments
 (0)