• C
    Allow embedders to post Dart objects on send ports from the native side. (#14477) · f0583215
    Chinmay Garde 提交于
    This is a non-breaking addition to the stable Flutter Embedder API and exposes a
    subset of the functionality provided by Dart_PostCObject API in a stable and
    tested manner to custom embedder implementations.
    
    Send port acquisition can currently be done as described in the unit-test but
    there may be opportunities to extend this API in the future to access ports more
    easily or create ports from the native side.
    
    The following capabilities of the the Dart_PostCObject API are explicitly NOT
    exposed:
    * Object arrays: This allows callers to create complex object graphs but only
      using the primitives specified in the native API. I could find no current use
      case for this and would have made the implementation a lot more complex. This
      is something we can add in the future if necessary however.
    * Capabilities and ports: Again no use cases and I honestly I didn’t understand
      how to use capabilities. If needed, these can be added at a later point by
      appending to the union.
    
    Fixes https://github.com/flutter/flutter/issues/46624
    Fixes b/145982720
    f0583215
embedder_unittests.cc 130.4 KB