Browser Plugin: Add HTML5-like postMessage support
This is an implementation of HTML5-like postMessage support for the browser plugin.
It works as follows:
In BrowserPluginEmbedder:NavigateGuest, the browser process creates two swapped out RenderView: A swapped out RenderView for the guest in the embedder render process and a swapped out RenderView for the embedder in the guest render process.
The guest RenderView in the embedder process can be accessed via browserPlugin.contentWindow or through the MessageEvent object received from the guest, event.source.
The embedder RenderView in the guest process can be accessed through the MessageEvent object on message events, event.source.
BrowserPluginEmbedderHelper, and BrowserPluginGuestHelper intercept ViewHostMsg_RouteMessageEvent messages from the swapped out RenderViews and route them appropriately.
Note: BrowserPluginBindings now registers add/removeCustomEventListener instead of add/removeEventListener so that the default WebKit implementations are not shadowed by the custom implementations to allow for WebKit MessageEvents to be registered.
BUG=141238
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162353
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=162487
Review URL: https://codereview.chromium.org/10829225
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162631 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index f87f71d..6524241b 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -103,6 +103,12 @@
static webkit_glue::WebPreferences GetWebkitPrefs(
content::RenderViewHost* rvh, const GURL& url);
+ // Creates a swapped out RenderView. This is used by the browser plugin to
+ // create a swapped out RenderView in the embedder render process for the
+ // guest, to expose the guest's window object to the embedder.
+ // This returns the routing ID of the newly created swapped out RenderView.
+ int CreateSwappedOutRenderView(content::SiteInstance* instance);
+
// Complex initialization here. Specifically needed to avoid having
// members call back into our virtual functions in the constructor.
virtual void Init(content::BrowserContext* browser_context,