← All reports

Thread-local `Connection::MessageDispatchScope` for `MESSAGE_CHECK` from work queues

Component: WebKit IPC | c0fbc10

WebKit processes communicate via IPC, and MESSAGE_CHECK macros validate incoming message contents at dispatch time since a WebContent process is untrusted. Previously the "this message was invalid" flag lived on the Connection object and was consumed only by dispatchMessage() on the client run loop — but a connection also dispatches to work-queue receivers concurrently on other threads, and dispatch can nest on synchronous IPC. This commit replaces that per-connection state with a stack-allocated, thread-local Connection::MessageDispatchScope.

MESSAGE_CHECK failures can now be reported from work-queue receivers (GPU/Network receive queues), not just the client run loop, by tracking validity per-dispatch on a thread-local stack. Connection-wide state could not distinguish concurrent or nested dispatches; the scope object disambiguates them.