renderer killed when an OffscreenCanvas is transferred to another process

#40819284 + #471204157 (same root cause) Area: Blink>Canvas / viz frame sinks CL 8626307 In Review

What happens

A page calls transferControlToOffscreen() and posts the canvas to a document on another site, so the receiver lives in a different renderer process. The canvas carries the frame sink ids of the sending process. When the receiver draws, it asks viz for that frame sink, the browser sees a client id that does not belong to this renderer, and kills it with RESULT_CODE_KILLED_BAD_MESSAGE ("Invalid client ID").

The fix drops the foreign ids while deserializing, so the canvas becomes a standalone one. Nothing reaches the sender's placeholder canvas -- it never could -- but no renderer dies. Reported in 2022, and again in 2026 as #471204157; the CL carries the tests from both investigations.

Repro

The screenshots come from hjanuschka/cl-8626307-offscreencanvas. The page pings the cross-site iframe every 300ms and shows whether it still answers.

python3 serve.py &
chrome --host-resolver-rules="MAP * 127.0.0.1" http://a.test:8765/parent.html

Cross-site transfer, same build with and without the fix

After: child renderer alive
With the CL: the child renderer keeps answering and keeps drawing into its now standalone canvas.
Before: child renderer killed
Without the CL: the child frame is dead, killed for a bad message a moment after the first draw.

Verification

Open questions for review

Links

Issue 40819284 CL 8626307 Repro repo capture_screenshots.py