@@ -212,40 +212,28 @@ class PlatformView {
212212 int64_t texture_id) = 0;
213213
214214 // --------------------------------------------------------------------------
215- // / @brief Invoked when the dart VM requests that a deferred library
216- // / be loaded. Notifies the engine that the requested loading
217- // / unit should be downloaded and loaded.
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+ // / Each shared library is a loading unit, which consists of
219+ // / deferred libraries that can be compiled split from the
220+ // / base dart library by gen_snapshot.
218221 // /
219222 // / @param[in] loading_unit_id The unique id of the deferred library's
220- // / loading unit.
223+ // / loading unit. This is the same id as the
224+ // / one passed in by the corresponding
225+ // / RequestDartDeferredLibrary.
221226 // /
222- // / @return A Dart_Handle that is Dart_Null on success, and a dart error
223- // / on failure .
227+ // / @param[in] snapshot_data Dart snapshot data of the loading unit's
228+ // / shared library .
224229 // /
225- virtual Dart_Handle OnPlatformViewDartLoadLibrary (
226- intptr_t loading_unit_id) = 0;
227-
228- // --------------------------------------------------------------------------
229- // / @brief Loads the dart shared library from disk and into the dart VM
230- // / based off of the search parameters. When the dart library is
231- // / loaded successfully, the dart future returned by the
232- // / originating loadLibrary() call completes.
233- // /
234- // / @param[in] loading_unit_id The unique id of the deferred library's
235- // / loading unit.
236- // /
237- // / @param[in] lib_name The file name of the .so shared library
238- // / file.
239- // /
240- // / @param[in] apkPaths The paths of the APKs that may or may not
241- // / contain the lib_name file.
242- // /
243- // / @param[in] abi The abi of the library, eg, arm64-v8a
230+ // / @param[in] snapshot_data Dart snapshot instructions of the loading
231+ // / unit's shared library.
244232 // /
245- virtual void CompleteDartLoadLibrary ( intptr_t loading_unit_id,
246- std::string lib_name ,
247- std::vector<std::string>& apkPaths ,
248- std::string abi ) = 0;
233+ virtual void LoadDartDeferredLibrary (
234+ intptr_t loading_unit_id ,
235+ const uint8_t * snapshot_data ,
236+ const uint8_t * snapshot_instructions ) = 0;
249237
250238 // --------------------------------------------------------------------------
251239 // / @brief Sets the asset manager of the engine to asset_manager
@@ -617,33 +605,38 @@ class PlatformView {
617605 // / @param[in] loading_unit_id The unique id of the deferred library's
618606 // / loading unit.
619607 // /
620- // / @return A Dart_Handle that is Dart_Null on success, and a dart error
621- // / on failure.
622- // /
623- virtual Dart_Handle OnDartLoadLibrary (intptr_t loading_unit_id);
608+ virtual void RequestDartDeferredLibrary (intptr_t loading_unit_id);
624609
625610 // --------------------------------------------------------------------------
626- // / @brief Loads the dart shared library from disk and into the dart VM
627- // / based off of the search parameters. When the dart library is
628- // / loaded successfully, the dart future returned by the
629- // / originating loadLibrary() call completes.
611+ // / @brief Loads the dart shared library into the dart VM. When the
612+ // / dart library is loaded successfully, the dart future
613+ // / returned by the originating loadLibrary() call completes.
614+ // / Each shared library is a loading unit, which consists of
615+ // / deferred libraries that can be compiled split from the
616+ // / base dart library by gen_snapshot.
630617 // /
631618 // / @param[in] loading_unit_id The unique id of the deferred library's
632- // / loading unit.
633- // /
634- // / @param[in] lib_name The file name of the .so shared library
635- // / file.
619+ // / loading unit. This is the same id as the
620+ // / one passed in by the corresponding
621+ // / RequestDartDeferredLibrary.
636622 // /
637- // / @param[in] apkPaths The paths of the APKs that may or may not
638- // / contain the lib_name file .
623+ // / @param[in] snapshot_data Dart snapshot data of the loading unit's
624+ // / shared library .
639625 // /
640- // / @param[in] abi The abi of the library, eg, arm64-v8a
626+ // / @param[in] snapshot_data Dart snapshot instructions of the loading
627+ // / unit's shared library.
641628 // /
642- virtual void CompleteDartLoadLibrary (intptr_t loading_unit_id,
643- std::string lib_name,
644- std::vector<std::string>& apkPaths,
645- std::string abi);
629+ virtual void LoadDartDeferredLibrary (intptr_t loading_unit_id,
630+ const uint8_t * snapshot_data,
631+ const uint8_t * snapshot_instructions);
646632
633+ // TODO(garyq): Implement a proper asset_resolver replacement instead of
634+ // overwriting the entire asset manager.
635+ // --------------------------------------------------------------------------
636+ // / @brief Sets the asset manager of the engine to asset_manager
637+ // /
638+ // / @param[in] asset_manager The asset manager to use.
639+ // /
647640 virtual void UpdateAssetManager (std::shared_ptr<AssetManager> asset_manager);
648641
649642 protected:
0 commit comments