Browser Plugin: browser process side changes
Major classes:
BrowserPluginHost: This is the host-side of both the guest and the embedder
renderers. The embedder BrowserPluginHost keeps track of its guests, and cleans
them up when it navigates away, or whe tabs are switched or when it crashes. The
guest BrowserPluginHost knows about its embdder, and about its instance ID, as well
as some initialization parameters such as URL and initial size.
BUG=117897
TEST=manually
Review URL: https://chromiumcodereview.appspot.com/10377170
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138475 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c4af801a..2facf47 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -14,6 +14,7 @@
#include "base/string_util.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "content/browser/browser_plugin/browser_plugin_host.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/debugger/devtools_manager_impl.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
@@ -324,6 +325,8 @@
java_bridge_dispatcher_host_manager_.reset(
new JavaBridgeDispatcherHostManager(this));
#endif
+
+ browser_plugin_host_.reset(new content::BrowserPluginHost(this));
}
WebContentsImpl::~WebContentsImpl() {
@@ -1148,6 +1151,11 @@
dest_render_view_host,
entry.GetURL());
+ // Tell BrowserPluginHost about the pending cross-process navigation.
+ // TODO(fsamuel): Remove this once this issue is addressed:
+ // https://code.google.com/p/chromium/issues/detail?id=128976
+ browser_plugin_host()->OnPendingNavigation(dest_render_view_host);
+
// Used for page load time metrics.
current_load_start_ = base::TimeTicks::Now();
@@ -2728,11 +2736,15 @@
int32 max_page_id =
GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
+ content::RenderProcessHost* embedder_render_process_host =
+ browser_plugin_host()->embedder_render_process_host();
+ int embedder_process_id =
+ embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
if (!static_cast<RenderViewHostImpl*>(
render_view_host)->CreateRenderView(string16(),
opener_route_id,
max_page_id,
- -1)) {
+ embedder_process_id)) {
return false;
}