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

Commit

Permalink
Comments on embedder API
Browse files Browse the repository at this point in the history
  • Loading branch information
dkwingsmt committed Apr 10, 2024
1 parent ef8ed56 commit d4ce15a
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2582,23 +2582,20 @@ FlutterEngineResult FlutterEngineRunInitialized(
//------------------------------------------------------------------------------
/// @brief Adds a view.
///
/// This operation notifies the engine to allocate resources and
/// inform Dart about the view, and on success, schedules a new
/// frame. Finally, it invokes |info.add_view_callback| with whether
/// the operation is successful.
/// This is an asynchronous operation. The view should not be used
/// until the |info.add_view_callback| is invoked with an |added|
/// value of true. The embedder should prepare resources in advance
/// but be ready to clean up on failure.
///
/// This operation is asynchronous; avoid using the view until
/// |info.add_view_callback| returns true. The embedder should
/// prepare resources in advance but be ready to clean up on
/// failure.
/// A frame is scheduled if the operation succeeds.
///
/// The callback is called on a different thread managed by the
/// engine. The embedder must re-thread if needed.
/// The callback is invoked on a thread managed by the engine. The
/// embedder should re-thread if needed.
///
/// Do not use for implicit views, which are added internally during
/// initialization. Adding the implicit view ID or an existing view
/// ID will fail, indicated by |info.add_view_callback| returning
/// false.
/// Attempting to add the implicit view will fail and will return
/// kInvalidArguments. Attempting to add a view with an already
/// existing view ID will fail, and |info.add_view_callback| will be
/// invoked with an |added| value of false.
///
/// @param[in] engine A running engine instance.
/// @param[in] info The add view arguments. This can be deallocated
Expand All @@ -2615,18 +2612,17 @@ FlutterEngineResult FlutterEngineAddView(FLUTTER_API_SYMBOL(FlutterEngine)
//------------------------------------------------------------------------------
/// @brief Removes a view.
///
/// This operation notifies the engine to deallocate resources and
/// inform Dart about the removal. Finally, it invokes
/// |info.remove_view_callback| with whether the operation is
/// successful.
/// This is an asynchronous operation. The view's resources must not
/// be cleaned up until |info.remove_view_callback| is invoked with
/// a |removed| value of true.
///
/// This operation is asynchronous. The embedder should not
/// deallocate resources until the |callback| is invoked.
/// The callback is invoked on a thread managed by the engine. The
/// embedder should re-thread if needed.
///
/// Do not use for implicit views, which are never removed
/// throughout the lifetime of the app. Removing
/// |kFlutterImplicitViewId| or an non-existent view ID will fail,
/// indicated by |callback| returning false.
/// Attempting to remove the implicit view will fail and will return
/// kInvalidArguments. Attempting to remove a view with a
/// non-existent view ID will fail, and |info.remove_view_callback|
/// will be invoked with a |removed| value of false.
///
/// @param[in] engine A running engine instance.
/// @param[in] info The remove view arguments. This can be deallocated
Expand Down

0 comments on commit d4ce15a

Please sign in to comment.