Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1056)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11956022: Browser Plugin: Allocate Instance IDs in BrowserPluginEmbedder instead of BrowserPluginManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 545ebf339ac8f32938257a07ec784ff1945799d2..07231f6472a0b739ac1c79f5aecb13943a350825 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -745,8 +745,8 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend)
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission,
OnRequestPpapiBrokerPermission)
- IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_CreateGuest,
- OnBrowserPluginCreateGuest)
+ IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_AllocateInstanceID,
+ OnBrowserPluginAllocateInstanceID)
IPC_MESSAGE_HANDLER(IconHostMsg_DidDownloadFavicon, OnDidDownloadFavicon)
IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL)
#if defined(OS_ANDROID)
@@ -2372,27 +2372,22 @@ void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id,
result));
}
-void WebContentsImpl::OnBrowserPluginCreateGuest(
- int instance_id,
- const BrowserPluginHostMsg_CreateGuest_Params& params) {
+void WebContentsImpl::OnBrowserPluginAllocateInstanceID(
+ const IPC::Message& message, int request_id) {
// This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin
- // specific messages for this WebContents (through its
- // BrowserPluginEmbedderHelper). This means that any message from browser
- // plugin renderer prior to CreateGuest will be ignored.
+ // specific messages for this WebContents. This means that any message from
+ // a BrowserPlugin prior to AllocateInstanceID will be ignored.
// For more info, see comment above classes BrowserPluginEmbedder and
// BrowserPluginGuest.
- // The first BrowserPluginHostMsg_CreateGuest message from this WebContents'
- // embedder render process is handled here. Once BrowserPluginEmbedder is
- // created, all subsequent BrowserPluginHostMsg_CreateGuest messages are
- // intercepted by the BrowserPluginEmbedderHelper and handled by the
- // BrowserPluginEmbedder. Thus, this code will not be executed if a
- // BrowserPluginEmbedder exists for this WebContents.
+ // The first BrowserPluginHostMsg_AllocateInstanceID message from this
+ // WebContents' embedder render process is handled here. Once
+ // BrowserPluginEmbedder is created, all subsequent BrowserPluginHostMsg_*
+ // messages are handled in BrowserPluginEmbedder. Thus, this code will not be
+ // executed if a BrowserPluginEmbedder exists for this WebContents.
CHECK(!browser_plugin_embedder_.get());
browser_plugin_embedder_.reset(
BrowserPluginEmbedder::Create(this, GetRenderViewHost()));
- BrowserPluginHostMsg_CreateGuest create_guest_msg(
- GetRenderViewHost()->GetRoutingID(), instance_id, params);
- browser_plugin_embedder_->OnMessageReceived(create_guest_msg);
+ browser_plugin_embedder_->OnMessageReceived(message);
}
void WebContentsImpl::OnDidDownloadFavicon(
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698