cc.mojom.CopyOutputResult could cause huge data volume over message pipe |
||
Issue descriptioncc/ipc/copy_output_result.mojom defines a CopyOutputResult struct (and struct traits) to adapt cc::CopyOutputResult for use with mojo APIs. Unfortunately, there are many common cases where the size of the bitmap carried in this struct can be huge (i.e., several megabytes), which means the struct could easily overwhelm and stall the IPC channel between VIZ and browser process. Therefore, the struct should instead provide a handle whereby the consumer would access the bitmap data on a side channel (e.g., a mojo data pipe or shmem buffer). The details of this process could be seamlessly hidden from client code via the struct traits implementation. It could manage the transfer of the bitmap by transferring the bitmaps of cc::CopyOutputResult via some mechanism outside the mojom struct; and then later on the client-side, re-build a cc::CopyOutputResult, automatically populating the bitmap data from the outside mechanism.
,
Mar 22 2018
No, but it still needs attention! I think the issue is that there isn't anyone available to work on it. FWIW, I did a scan using the following: find chromium/src/ -name '*.mojom' | xargs grep -i bitmap ...and it seems that almost all mojo SkBitmap APIs use the skia/public/interfaces/bitmap.mojom; which never uses shmem, unfortunately. Then, there is a TODO comment in ui/gfx/image/mojo/image.mojom that suggests their SkBitmap struct traits (that ONLY use shmem, never the message pipe) could be merged into bitmap.mojom. What would be ideal is a single struct traits solution that sends "small" SkBitmaps over the message pipe, and larger ones using shmem. I'm not sure what the threshold for "small" should be...maybe 4 KB or 8 KB?
,
Mar 22 2018
gfx.mojom.ImageSkia uses shared buffer for transport. Can we use that instead of skia.mojom.Bitmap ? Last time I tried to change skia.mojom.Bitmap to use shared buffer, I hit a bump that it is used inside sandboxed renderer and could not create shared buffer.
,
Mar 22 2018
Regarding the sandboxed renderer issue: I wonder if the struct traits could detect this case, and just fall-back to using the message pipe (AND also follow-up with feature owners to fix their SkBitmap transport mechanism to avoid clogging-up the mojo IPC transport). |
||
►
Sign in to add a comment |
||
Comment 1 by thestig@chromium.org
, Mar 22 2018