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 e56e327c7d163be0dddcbfba4fd4a4e2b58f75aa..9cd03140a39d232b19b7e84a8e4af8d640a6a485 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -3167,13 +3167,8 @@ void WebContentsImpl::OnPpapiBrokerPermissionResult(int routing_id, |
void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host, |
const IPC::Message& message) { |
- // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin |
- // specific messages for this WebContents. This means that any message from |
- // a BrowserPlugin prior to this will be ignored. |
- // For more info, see comment above classes BrowserPluginEmbedder and |
- // BrowserPluginGuest. |
CHECK(!browser_plugin_embedder_.get()); |
- browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); |
+ CreateBrowserPluginEmbedderIfNecessary(); |
browser_plugin_embedder_->OnMessageReceived(message, render_frame_host); |
} |
#endif // defined(ENABLE_PLUGINS) |
@@ -4470,6 +4465,12 @@ BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const { |
return browser_plugin_embedder_.get(); |
} |
+void WebContentsImpl::CreateBrowserPluginEmbedderIfNecessary() { |
+ if (browser_plugin_embedder_) |
+ return; |
+ browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); |
+} |
+ |
void WebContentsImpl::ClearPowerSaveBlockers( |
RenderFrameHost* render_frame_host) { |
RemoveAllMediaPlayerEntries(render_frame_host, &active_audio_players_); |