Bug 73337

Summary: [chromium] adding support for cross-process postMessage
Product: WebKit Reporter: Karl Koscher <supersat>
Component: WebKit APIAssignee: Karl Koscher <supersat>
Status: RESOLVED FIXED    
Severity: Normal CC: creis, fishd
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://crbug.com/99202
Bug Depends on: 73259, 73339, 73346, 73359, 73379, 73883, 75155, 85815    
Bug Blocks:    

Description Karl Koscher 2011-11-29 10:54:55 PST
This is a high-level bug to track the progress of getting all the necessary plumbing into WebKit that Chromium will need to support cross-process postMessage. The corresponding Chromium bug is http://crbug.com/99202.

The high-level idea is to add a message event listener to proxy frames that we install in each process. The proxy frames are installed when we swap processes, and Chromium tracks the actual frames these are proxies for. The event listeners will live in the chromium code base and know how to inject message events into the actual target frame.

To support this, a few things are needed from WebKit:

1. A way to add event listeners and dispatch events to a WebFrame's DOMWindow.
2. A way to allow the proxy frame to receive all postMessages, regardless of its origin. Proxy frames won't have any origin, and we need to do the origin check on the receiver side, otherwise we run the risk of the target's origin changing while the postMessage IPCs are in flight.
3. A way for the message event listener to get the intended target origin so we can do the origin check.
4. A way to get information out of WebDOMMessageEvent objects, such as the data, origin, etc.
5. A way for Chromium to set the opener of a frame.

Bugs implementing these changes will be filed soon, and will be marked as blocking this one.
Comment 1 Karl Koscher 2011-12-05 17:39:06 PST
Per the discussion in bug 73359, we are going to make a callback to the embedder on a postMessage instead of installing event listeners.

This makes bugs 73339 and 73359 obsolete. A new bug will be filed for adding the postMessage callback.
Comment 2 Charles Reis 2012-05-18 10:30:17 PDT
All required WebKit patches have landed, and Chromium now supports cross-process postMessage between top-level windows (as of http://crrev.com/137024 for http://crbug.com/99202).