This is something that especially tabs trays make use of. Can be helpful for fancy animations or previews outside of the app too (e.g. notifications?).
Fennec has a thumbnail for every Tab (in our case Session). It even saves them to disk to use in (the old version of) top sites.
Fire TV has a method for that too: https://github.com/mozilla-mobile/firefox-tv/blob/master/app/src/amazonWebview/java/org/mozilla/focus/webview/FirefoxAmazonWebView.kt#L167-L174
This is used for taking screenshots of pages when adding them as tile to the home screen.
GeckoView bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1462018
Talked to snorp and if GeckoView would add such an API then it would probably exist on GeckoSession. So we may want to add this API to EngineSession and only implement it for WebView for now.
In Firefox for Fire TV I wrote an extension method to add this functionality until we implement it here (On EngineView instead of EngineSession though):
https://github.com/mozilla-mobile/firefox-tv/blob/7742000ee1b1b870a6ed20cc6bcdf4001cbf8071/app/src/main/java/org/mozilla/focus/ext/EngineView.kt#L106-L119
We may want to add this to Sessionas Consumable<Bitmap>.
With that we may want to add a onLowMemory() or onTrimMemory() method to sessionManager and then sessionManager would remove the bitmap from all Sessions (Maybe keep it for the selected one?).
I'll un-assign myself: I'm still pretty busy with browser-engine integration into Firefox for Fire TV and browser-session integration into Focus.