Skip to content

Embedders are directly calling methods on the engine instead of the shell #35889

@dnfield

Description

@dnfield

The Android, iOS, and Embedder API all directly make calls on the Engine instead of the shell for SetViewportMetrics and DispatchPointerDataPacket.

In fact, they all use very similar code that looks to be copy-pasted from shell.cc:

https://github.com/flutter/engine/tree/6cf0d1350e0ac03df9ebcbb15c35a4a035010460/shell/platform/embedder/embedder_engine.cc#L82-L115

https://github.com/flutter/engine/blob/6cf0d1350e0ac03df9ebcbb15c35a4a035010460/shell/platform/android/android_shell_holder.cc#L175-L207

https://github.com/flutter/engine/blob/6cf0d1350e0ac03df9ebcbb15c35a4a035010460/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm#L128-L147

We should refactor all of these to use the same path through shell.cc, and ideally make it impossible for embedders to call these methods directly on the engine (which I believe would be breaking).

/cc @chinmaygarde @cbracken @jason-simmons

Metadata

Metadata

Assignees

Labels

e: embedderUsers of the Embedder APIengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions