summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-25 00:13:13 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-25 00:13:13 +0000
commit500ca7f1978ccb12a3aff3a9cabf9bd37def0667 (patch)
tree82b624214673cf62878a88f08e77d0c0da7e9028
parent234f11d4dbeaee43f5c6c1eb773fe07fab15422f (diff)
downloadchromium_src-500ca7f1978ccb12a3aff3a9cabf9bd37def0667.zip
chromium_src-500ca7f1978ccb12a3aff3a9cabf9bd37def0667.tar.gz
chromium_src-500ca7f1978ccb12a3aff3a9cabf9bd37def0667.tar.bz2
Browser Plugin: Deleted old implementation (browser side)
BUG=142378 Review URL: https://chromiumcodereview.appspot.com/11273005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163962 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/visitedlink/visitedlink_unittest.cc4
-rw-r--r--content/browser/browser_plugin/old/old_browser_plugin_host.cc237
-rw-r--r--content/browser/browser_plugin/old/old_browser_plugin_host.h135
-rw-r--r--content/browser/browser_plugin/old/old_browser_plugin_host_helper.cc63
-rw-r--r--content/browser/browser_plugin/old/old_browser_plugin_host_helper.h53
-rw-r--r--content/browser/renderer_host/render_view_host_impl.cc6
-rw-r--r--content/browser/renderer_host/render_view_host_impl.h7
-rw-r--r--content/browser/renderer_host/test_render_view_host.cc4
-rw-r--r--content/browser/renderer_host/test_render_view_host.h4
-rw-r--r--content/browser/web_contents/interstitial_page_impl.cc4
-rw-r--r--content/browser/web_contents/test_web_contents.cc2
-rw-r--r--content/browser/web_contents/web_contents_impl.cc39
-rw-r--r--content/browser/web_contents/web_contents_impl.h14
-rw-r--r--content/content_browser.gypi4
-rw-r--r--content/public/test/test_renderer_host.h4
15 files changed, 7 insertions, 573 deletions
diff --git a/chrome/browser/visitedlink/visitedlink_unittest.cc b/chrome/browser/visitedlink/visitedlink_unittest.cc
index fced519..6703149 100644
--- a/chrome/browser/visitedlink/visitedlink_unittest.cc
+++ b/chrome/browser/visitedlink/visitedlink_unittest.cc
@@ -652,8 +652,6 @@ TEST_F(VisitedLinkEventsTest, Basics) {
VisitedLinkMaster* master = VisitedLinkMaster::FromProfile(profile());
rvh_tester()->CreateRenderView(string16(),
MSG_ROUTING_NONE,
- -1,
- std::string(),
-1);
// Add a few URLs.
@@ -680,8 +678,6 @@ TEST_F(VisitedLinkEventsTest, TabVisibility) {
VisitedLinkMaster* master = VisitedLinkMaster::FromProfile(profile());
rvh_tester()->CreateRenderView(string16(),
MSG_ROUTING_NONE,
- -1,
- std::string(),
-1);
// Simulate tab becoming inactive.
diff --git a/content/browser/browser_plugin/old/old_browser_plugin_host.cc b/content/browser/browser_plugin/old/old_browser_plugin_host.cc
deleted file mode 100644
index bd8086b..0000000
--- a/content/browser/browser_plugin/old/old_browser_plugin_host.cc
+++ /dev/null
@@ -1,237 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/browser_plugin/old/old_browser_plugin_host.h"
-
-#include "content/browser/browser_plugin/old/old_browser_plugin_host_helper.h"
-#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/common/old_browser_plugin_messages.h"
-#include "content/public/common/url_constants.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/notification_types.h"
-#include "content/public/browser/render_process_host.h"
-#include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/site_instance.h"
-#include "content/public/browser/web_contents_view.h"
-#include "ppapi/proxy/ppapi_messages.h"
-
-namespace content {
-namespace old {
-
-BrowserPluginHost::BrowserPluginHost(
- WebContentsImpl* web_contents)
- : WebContentsObserver(web_contents),
- embedder_render_process_host_(NULL),
- instance_id_(0) {
- // Listen to visibility changes so that an embedder hides its guests
- // as well.
- registrar_.Add(this,
- NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED,
- Source<WebContents>(web_contents));
- // Construct plumbing helpers when a new RenderViewHost is created for
- // this BrowserPluginHost's WebContentsImpl.
- registrar_.Add(this,
- NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED,
- Source<WebContents>(web_contents));
-}
-
-BrowserPluginHost::~BrowserPluginHost() {
-}
-
-BrowserPluginHost* BrowserPluginHost::GetGuestByContainerID(int container_id) {
- ContainerInstanceMap::const_iterator it =
- guests_by_container_id_.find(container_id);
- if (it != guests_by_container_id_.end())
- return it->second;
- return NULL;
-}
-
-void BrowserPluginHost::RegisterContainerInstance(
- int container_id,
- BrowserPluginHost* observer) {
- DCHECK(guests_by_container_id_.find(container_id) ==
- guests_by_container_id_.end());
- guests_by_container_id_[container_id] = observer;
-}
-
-bool BrowserPluginHost::TakeFocus(WebContents* web_contents, bool reverse) {
- embedder_render_process_host()->Send(
- new OldBrowserPluginMsg_AdvanceFocus(instance_id(), reverse));
- return true;
-}
-
-bool BrowserPluginHost::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(BrowserPluginHost, message)
- IPC_MESSAGE_HANDLER(OldBrowserPluginHostMsg_NavigateFromGuest,
- OnNavigateFromGuest)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void BrowserPluginHost::NavigateGuestFromEmbedder(
- RenderViewHost* render_view_host,
- int container_instance_id,
- long long frame_id,
- const std::string& src) {
- BrowserPluginHost* guest_observer =
- GetGuestByContainerID(container_instance_id);
- WebContentsImpl* guest_web_contents =
- guest_observer ?
- static_cast<WebContentsImpl*>(guest_observer->web_contents()): NULL;
- GURL url(src);
- if (!guest_observer) {
- std::string host = render_view_host->GetSiteInstance()->GetSiteURL().host();
- GURL guest_url(
- base::StringPrintf("%s://%s", chrome::kGuestScheme, host.c_str()));
- // The SiteInstance of a given guest is based on the fact that it's a guest
- // in addition to which platform application the guest belongs to, rather
- // than the URL that the guest is being navigated to.
- SiteInstance* guest_site_instance =
- SiteInstance::CreateForURL(web_contents()->GetBrowserContext(),
- guest_url);
- guest_web_contents =
- WebContentsImpl::Create(
- web_contents()->GetBrowserContext(),
- guest_site_instance,
- MSG_ROUTING_NONE,
- NULL // base WebContents
- );
- guest_observer =
- guest_web_contents->old_browser_plugin_host();
- guest_observer->set_embedder_render_process_host(
- render_view_host->GetProcess());
- guest_observer->set_instance_id(container_instance_id);
- RegisterContainerInstance(container_instance_id, guest_observer);
- AddGuest(guest_web_contents, frame_id);
- }
- guest_observer->web_contents()->SetDelegate(guest_observer);
- guest_observer->web_contents()->GetController().LoadURL(
- url,
- Referrer(),
- PAGE_TRANSITION_AUTO_SUBFRAME,
- std::string());
-}
-
-void BrowserPluginHost::OnNavigateFromGuest(
- PP_Instance instance,
- const std::string& src) {
- DCHECK(embedder_render_process_host());
- GURL url(src);
- web_contents()->GetController().LoadURL(
- url,
- Referrer(),
- PAGE_TRANSITION_AUTO_SUBFRAME,
- std::string());
-}
-
-void BrowserPluginHost::ConnectEmbedderToChannel(
- RenderViewHost* render_view_host,
- const IPC::ChannelHandle& channel_handle) {
- DCHECK(embedder_render_process_host());
- // Tell the BrowserPlugin in the embedder that we're done and that it can
- // begin using the guest renderer.
- embedder_render_process_host()->Send(
- new OldBrowserPluginMsg_LoadGuest(
- instance_id(),
- render_view_host->GetProcess()->
- GetID(),
- channel_handle));
-}
-
-void BrowserPluginHost::AddGuest(WebContentsImpl* guest, int64 frame_id) {
- guests_[guest] = frame_id;
-}
-
-void BrowserPluginHost::RemoveGuest(WebContentsImpl* guest) {
- guests_.erase(guest);
-}
-
-void BrowserPluginHost::DestroyGuests() {
- for (GuestMap::const_iterator it = guests_.begin();
- it != guests_.end(); ++it) {
- WebContentsImpl* web_contents = it->first;
- delete web_contents;
- }
- guests_.clear();
- guests_by_container_id_.clear();
-}
-
-void BrowserPluginHost::DidCommitProvisionalLoadForFrame(
- int64 frame_id,
- bool is_main_frame,
- const GURL& url,
- PageTransition transition_type,
- RenderViewHost* render_view_host) {
- // Clean-up guests that lie in the frame that we're navigating.
- typedef std::set<WebContentsImpl*> GuestSet;
- GuestSet guests_to_delete;
- for (GuestMap::const_iterator it = guests_.begin();
- it != guests_.end(); ++it) {
- WebContentsImpl* web_contents = it->first;
- if (it->second == frame_id) {
- guests_to_delete.insert(web_contents);
- }
- }
- for (GuestSet::const_iterator it = guests_to_delete.begin();
- it != guests_to_delete.end(); ++it) {
- delete *it;
- guests_.erase(*it);
- }
-}
-
-void BrowserPluginHost::RenderViewDeleted(RenderViewHost* render_view_host) {
- // TODO(fsamuel): For some reason ToT hangs when killing a guest, this wasn't
- // the case earlier. Presumably, when a guest is killed/crashes, one of
- // RenderViewDeleted, RenderViewGone or WebContentsDestroyed will get called.
- // At that point, we should remove reference to this BrowserPluginHost
- // from its embedder, in addition to destroying its guests, to ensure
- // that we do not attempt a double delete.
- DestroyGuests();
-}
-
-void BrowserPluginHost::RenderViewGone(base::TerminationStatus status) {
- DestroyGuests();
-}
-
-void BrowserPluginHost::WebContentsDestroyed(WebContents* web_contents) {
- DestroyGuests();
-}
-
-void BrowserPluginHost::Observe(
- int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- switch (type) {
- case NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED: {
- RenderViewHost* render_view_host =
- Details<RenderViewHost>(details).ptr();
- // BrowserPluginHostHelper is destroyed when its associated RenderViewHost
- // is destroyed.
- new BrowserPluginHostHelper(this, render_view_host);
- break;
- }
- case NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED: {
- bool visible = *Details<bool>(details).ptr();
- // If the embedder is hidden we need to hide the guests as well.
- for (GuestMap::const_iterator it = guests_.begin();
- it != guests_.end(); ++it) {
- WebContentsImpl* web_contents = it->first;
- if (visible)
- web_contents->WasShown();
- else
- web_contents->WasHidden();
- }
- break;
- }
- default:
- NOTREACHED() << "Unexpected notification type: " << type;
- }
-}
-
-} // namespace old
-} // namespace content
diff --git a/content/browser/browser_plugin/old/old_browser_plugin_host.h b/content/browser/browser_plugin/old/old_browser_plugin_host.h
deleted file mode 100644
index 4edeb46..0000000
--- a/content/browser/browser_plugin/old/old_browser_plugin_host.h
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_BROWSER_BROWSER_PLUGIN_OLD_OLD_BROWSER_PLUGIN_HOST_H__
-#define CONTENT_BROWSER_BROWSER_PLUGIN_OLD_OLD_BROWSER_PLUGIN_HOST_H__
-
-#include <map>
-
-#include "base/compiler_specific.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "ppapi/c/pp_instance.h"
-#include "ui/gfx/size.h"
-
-namespace IPC {
-struct ChannelHandle;
-}
-
-namespace content {
-
-class RenderProcessHost;
-class WebContentsImpl;
-
-namespace old {
-
-
-// A BrowserPluginHost object is used by both embedders and guests.
-// The primary purpose of BrowserPluginHost is to allow an embedder
-// to manage the lifetime of its guests. It cleans up its guests
-// on navigation, crashes, and "hides" guests when it hides.
-// For the guest, BrowserPluginHost keeps track of its embedder,
-// and its BrowserPlugin instance ID.
-class BrowserPluginHost : public WebContentsObserver,
- public NotificationObserver,
- public WebContentsDelegate {
- public:
- // BrowserPluginHost is owned by a WebContentsImpl. Here it takes in its
- // owner. The owner can be either a guest or embedder WebContents.
- explicit BrowserPluginHost(WebContentsImpl* web_contents);
-
- virtual ~BrowserPluginHost();
-
- void ConnectEmbedderToChannel(RenderViewHost* render_view_host,
- const IPC::ChannelHandle& handle);
-
- // This is called on the first navigation of the browser plugin. It creates
- // a new WebContentsImpl for the guest, associates it with its embedder, sets
- // its size and navigates it to the src URL.
- void NavigateGuestFromEmbedder(RenderViewHost* render_view_host,
- int container_instance_id,
- long long frame_id,
- const std::string& src);
-
- RenderProcessHost* embedder_render_process_host() const {
- return embedder_render_process_host_;
- }
- int instance_id() const { return instance_id_; }
-
- private:
- typedef std::map<WebContentsImpl*, int64> GuestMap;
- typedef std::map<int, BrowserPluginHost*> ContainerInstanceMap;
-
- // Get a guest BrowserPluginHost by its container ID specified
- // in BrowserPlugin.
- BrowserPluginHost* GetGuestByContainerID(int container_id);
-
- // Associate a guest with its container instance ID.
- void RegisterContainerInstance(
- int container_id,
- BrowserPluginHost* observer);
-
- // An embedder BrowserPluginHost keeps track of
- // its guests so that if it navigates away, its associated RenderView
- // crashes or it is hidden, it takes appropriate action on the guest.
- void AddGuest(WebContentsImpl* guest, int64 frame_id);
-
- // This removes a guest from an embedder's guest list.
- // TODO(fsamuel): Use this when deleting guest after they crash.
- // ToT plugin crash handling seems to be broken in this case and so I can't
- // test this scenario at the moment. Delete this comment once fixed.
- void RemoveGuest(WebContentsImpl* guest);
-
- void set_embedder_render_process_host(
- RenderProcessHost* embedder_render_process_host) {
- embedder_render_process_host_ = embedder_render_process_host;
- }
- void set_instance_id(int instance_id) { instance_id_ = instance_id; }
-
- void OnNavigateFromGuest(PP_Instance instance,
- const std::string& src);
-
- void DestroyGuests();
-
- // WebContentsDelegate implementation.
- virtual bool TakeFocus(WebContents* web_contents, bool reverse) OVERRIDE;
-
- // WebContentObserver implementation.
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- // Used to monitor frame navigation to cleanup guests when a frame navigates
- // away from the browser plugin it's hosting.
- virtual void DidCommitProvisionalLoadForFrame(
- int64 frame_id,
- bool is_main_frame,
- const GURL& url,
- PageTransition transition_type,
- RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE;
- virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
-
- // NotificationObserver method override.
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
-
- // A scoped container for notification registries.
- NotificationRegistrar registrar_;
- RenderProcessHost* embedder_render_process_host_;
- std::string embedder_channel_name_;
- // An identifier that uniquely identifies a browser plugin container
- // within an embedder.
- int instance_id_;
- GuestMap guests_;
- ContainerInstanceMap guests_by_container_id_;
-
- DISALLOW_COPY_AND_ASSIGN(BrowserPluginHost);
-};
-
-} // namespace old
-} // namespace content
-
-#endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_OLD_BROWSER_PLUGIN_HOST_H_
diff --git a/content/browser/browser_plugin/old/old_browser_plugin_host_helper.cc b/content/browser/browser_plugin/old/old_browser_plugin_host_helper.cc
deleted file mode 100644
index 795267c..0000000
--- a/content/browser/browser_plugin/old/old_browser_plugin_host_helper.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/browser_plugin/old/old_browser_plugin_host_helper.h"
-
-#include "content/browser/browser_plugin/old/old_browser_plugin_host.h"
-#include "content/common/old_browser_plugin_messages.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_widget_host_view.h"
-#include "ui/gfx/size.h"
-
-namespace content {
-namespace old {
-
-BrowserPluginHostHelper::BrowserPluginHostHelper(
- BrowserPluginHost* browser_plugin_host,
- RenderViewHost* render_view_host)
- : RenderViewHostObserver(render_view_host),
- browser_plugin_host_(browser_plugin_host) {
-}
-
-BrowserPluginHostHelper::~BrowserPluginHostHelper() {
-}
-
-
-bool BrowserPluginHostHelper::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(BrowserPluginHostHelper, message)
- IPC_MESSAGE_HANDLER(OldBrowserPluginHostMsg_ConnectToChannel,
- OnConnectToChannel)
- IPC_MESSAGE_HANDLER(OldBrowserPluginHostMsg_NavigateFromEmbedder,
- OnNavigateGuestFromEmbedder)
- IPC_MESSAGE_HANDLER(OldBrowserPluginHostMsg_ResizeGuest, OnResizeGuest)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void BrowserPluginHostHelper::OnConnectToChannel(
- const IPC::ChannelHandle& channel_handle) {
- browser_plugin_host_->ConnectEmbedderToChannel(
- render_view_host(),
- channel_handle);
-}
-
-void BrowserPluginHostHelper::OnNavigateGuestFromEmbedder(
- int32 instance_id,
- long long frame_id,
- const std::string& src) {
- browser_plugin_host_->NavigateGuestFromEmbedder(
- render_view_host(),
- instance_id,
- frame_id,
- src);
-}
-
-void BrowserPluginHostHelper::OnResizeGuest(int width, int height) {
- render_view_host()->GetView()->SetSize(gfx::Size(width, height));
-}
-
-} // namespace old
-} // namespace content
diff --git a/content/browser/browser_plugin/old/old_browser_plugin_host_helper.h b/content/browser/browser_plugin/old/old_browser_plugin_host_helper.h
deleted file mode 100644
index 9c4b375..0000000
--- a/content/browser/browser_plugin/old/old_browser_plugin_host_helper.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_BROWSER_BROWSER_PLUGIN_OLD_OLD_BROWSER_PLUGIN_HOST_HELPER_H__
-#define CONTENT_BROWSER_BROWSER_PLUGIN_OLD_OLD_BROWSER_PLUGIN_HOST_HELPER_H__
-
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "content/public/browser/render_view_host_observer.h"
-#include "ipc/ipc_channel_handle.h"
-
-namespace gfx {
-class Size;
-}
-
-namespace content {
-namespace old {
-
-class BrowserPluginHost;
-
-// This class acts as a plumber helper for BrowserPluginHost. A lot
-// of messages coming from guests need to know the guest's RenderViewHost.
-// BrowserPluginHostHelper handles BrowserPluginHost messages and relays
-// them with their associated RenderViewHosts to BrowserPluginHost where they
-// will be handled.
-class BrowserPluginHostHelper : public RenderViewHostObserver {
- public:
- BrowserPluginHostHelper(BrowserPluginHost* browser_plugin_host,
- RenderViewHost* render_view_host);
- virtual ~BrowserPluginHostHelper();
-
- private:
- void OnConnectToChannel(const IPC::ChannelHandle& channel_handle);
- void OnNavigateGuestFromEmbedder(int container_instance_id,
- long long frame_id,
- const std::string& src);
- void OnResizeGuest(int width, int height);
-
- // RenderViewHostObserver implementation.
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
-
- BrowserPluginHost* browser_plugin_host_;
-
- DISALLOW_COPY_AND_ASSIGN(BrowserPluginHostHelper);
-};
-
-} // namespace old
-} // namespace content
-
-#endif // CONTENT_BROWSER_BROWSER_PLUGIN_OLD_BROWSER_PLUGIN_HOST_HELPER_H__
-
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 0884f44..e6cdcc9 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -223,9 +223,7 @@ SiteInstance* RenderViewHostImpl::GetSiteInstance() const {
bool RenderViewHostImpl::CreateRenderView(
const string16& frame_name,
int opener_route_id,
- int32 max_page_id,
- const std::string& embedder_channel_name,
- int embedder_container_id) {
+ int32 max_page_id) {
DCHECK(!IsRenderViewLive()) << "Creating view twice";
// The process may (if we're sharing a process with another host that already
@@ -263,8 +261,6 @@ bool RenderViewHostImpl::CreateRenderView(
params.next_page_id = next_page_id;
GetWebScreenInfo(&params.screen_info);
- params.embedder_channel_name = embedder_channel_name;
- params.embedder_container_id = embedder_container_id;
params.accessibility_mode =
BrowserAccessibilityStateImpl::GetInstance()->GetAccessibilityMode();
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index ff87845..c62a70ba 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -248,14 +248,9 @@ class CONTENT_EXPORT RenderViewHostImpl
// The |opener_route_id| parameter indicates which RenderView created this
// (MSG_ROUTING_NONE if none). If |max_page_id| is larger than -1, the
// RenderView is told to start issuing page IDs at |max_page_id| + 1.
- // If this RenderView is a guest, the embedder's process ID is also passed in
- // so that the RenderView's process can establish a channel with its embedder
- // if it's not already established.
virtual bool CreateRenderView(const string16& frame_name,
int opener_route_id,
- int32 max_page_id,
- const std::string& embedder_channel_name,
- int embedder_container_id);
+ int32 max_page_id);
base::TerminationStatus render_view_termination_status() const {
return render_view_termination_status_;
diff --git a/content/browser/renderer_host/test_render_view_host.cc b/content/browser/renderer_host/test_render_view_host.cc
index a1cb4bb..6879b4c 100644
--- a/content/browser/renderer_host/test_render_view_host.cc
+++ b/content/browser/renderer_host/test_render_view_host.cc
@@ -274,9 +274,7 @@ TestRenderViewHost::~TestRenderViewHost() {
bool TestRenderViewHost::CreateRenderView(
const string16& frame_name,
int opener_route_id,
- int32 max_page_id,
- const std::string& embedder_channel_name,
- int embedder_container_id) {
+ int32 max_page_id) {
DCHECK(!render_view_created_);
render_view_created_ = true;
return true;
diff --git a/content/browser/renderer_host/test_render_view_host.h b/content/browser/renderer_host/test_render_view_host.h
index 9d87ad2..798aeb5 100644
--- a/content/browser/renderer_host/test_render_view_host.h
+++ b/content/browser/renderer_host/test_render_view_host.h
@@ -305,9 +305,7 @@ class TestRenderViewHost
virtual bool CreateRenderView(const string16& frame_name,
int opener_route_id,
- int32 max_page_id,
- const std::string& embedder_channel_name,
- int embedder_container_id) OVERRIDE;
+ int32 max_page_id) OVERRIDE;
virtual bool IsRenderViewLive() const OVERRIDE;
private:
diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc
index ef6582d..0185f5b 100644
--- a/content/browser/web_contents/interstitial_page_impl.cc
+++ b/content/browser/web_contents/interstitial_page_impl.cc
@@ -491,9 +491,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
GetMaxPageIDForSiteInstance(render_view_host_->GetSiteInstance());
render_view_host_->CreateRenderView(string16(),
MSG_ROUTING_NONE,
- max_page_id,
- std::string(),
- -1);
+ max_page_id);
view->SetSize(web_contents_view->GetContainerSize());
// Don't show the interstitial until we have navigated to it.
view->Hide();
diff --git a/content/browser/web_contents/test_web_contents.cc b/content/browser/web_contents/test_web_contents.cc
index 4cbfc58..ab0fe84 100644
--- a/content/browser/web_contents/test_web_contents.cc
+++ b/content/browser/web_contents/test_web_contents.cc
@@ -97,8 +97,6 @@ bool TestWebContents::CreateRenderViewForRenderManager(
static_cast<RenderViewHostImpl*>(
render_view_host)->CreateRenderView(string16(),
opener_route_id,
- -1,
- std::string(),
-1);
return true;
}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 566b05f..0aa2a72 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -18,7 +18,6 @@
#include "cc/switches.h"
#include "content/browser/browser_plugin/browser_plugin_embedder.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
-#include "content/browser/browser_plugin/old/old_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/dom_storage_context_impl.h"
@@ -188,8 +187,6 @@ void MakeNavigateParams(const NavigationEntryImpl& entry,
const NavigationControllerImpl& controller,
WebContentsDelegate* delegate,
NavigationController::ReloadType reload_type,
- const std::string& embedder_channel_name,
- int embedder_container_id,
ViewMsg_Navigate_Params* params) {
params->page_id = entry.GetPageID();
params->pending_history_list_offset = controller.GetIndexOfEntry(&entry);
@@ -213,8 +210,6 @@ void MakeNavigateParams(const NavigationEntryImpl& entry,
params->is_overriding_user_agent = entry.GetIsOverridingUserAgent();
// Avoid downloading when in view-source mode.
params->allow_download = !entry.IsViewSourceMode();
- params->embedder_channel_name = embedder_channel_name;
- params->embedder_container_id = embedder_container_id;
params->is_post = entry.GetHasPostData();
if(entry.GetBrowserInitiatedPostData()) {
params->browser_initiated_post_data.assign(
@@ -1147,8 +1142,6 @@ void WebContentsImpl::Init(BrowserContext* browser_context,
java_bridge_dispatcher_host_manager_.reset(
new JavaBridgeDispatcherHostManager(this));
#endif
-
- old_browser_plugin_host_.reset(new old::BrowserPluginHost(this));
}
void WebContentsImpl::OnWebContentsDestroyed(WebContents* web_contents) {
@@ -1591,15 +1584,8 @@ bool WebContentsImpl::NavigateToEntry(
current_load_start_ = base::TimeTicks::Now();
// Navigate in the desired RenderViewHost.
- std::string embedder_channel_name;
- int embedder_container_id;
- GetBrowserPluginEmbedderInfo(dest_render_view_host,
- &embedder_channel_name,
- &embedder_container_id);
ViewMsg_Navigate_Params navigate_params;
MakeNavigateParams(entry, controller_, delegate_, reload_type,
- embedder_channel_name,
- embedder_container_id,
&navigate_params);
dest_render_view_host->Navigate(navigate_params);
@@ -3282,17 +3268,10 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
int32 max_page_id =
GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
- std::string embedder_channel_name;
- int embedder_container_id;
- GetBrowserPluginEmbedderInfo(render_view_host,
- &embedder_channel_name,
- &embedder_container_id);
if (!static_cast<RenderViewHostImpl*>(
render_view_host)->CreateRenderView(string16(),
opener_route_id,
- max_page_id,
- embedder_channel_name,
- embedder_container_id)) {
+ max_page_id)) {
return false;
}
@@ -3367,22 +3346,6 @@ RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
}
-void WebContentsImpl::GetBrowserPluginEmbedderInfo(
- RenderViewHost* render_view_host,
- std::string* embedder_channel_name,
- int* embedder_container_id) {
- RenderProcessHost* embedder_render_process_host =
- old_browser_plugin_host()->embedder_render_process_host();
- *embedder_container_id = old_browser_plugin_host()->instance_id();
- int embedder_process_id =
- embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
- if (embedder_process_id != -1) {
- *embedder_channel_name =
- StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
- embedder_process_id);
- }
-}
-
BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
return browser_plugin_guest_.get();
}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index cbbbea7..b8d04a8 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -13,7 +13,6 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
-#include "content/browser/browser_plugin/old/old_browser_plugin_host.h"
#include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
@@ -167,10 +166,6 @@ class CONTENT_EXPORT WebContentsImpl
return java_bridge_dispatcher_host_manager_.get();
}
- old::BrowserPluginHost* old_browser_plugin_host() const {
- return old_browser_plugin_host_.get();
- }
-
// Expose the render manager for testing.
RenderViewHostManager* GetRenderManagerForTesting();
@@ -670,10 +665,6 @@ class CONTENT_EXPORT WebContentsImpl
RenderViewHostImpl* GetRenderViewHostImpl();
- void GetBrowserPluginEmbedderInfo(RenderViewHost* render_view_host,
- std::string* embedder_channel_name,
- int* embedder_container_id);
-
// Removes browser plugin embedder if there is one.
void RemoveBrowserPluginEmbedder();
@@ -723,11 +714,6 @@ class CONTENT_EXPORT WebContentsImpl
scoped_ptr<JavaBridgeDispatcherHostManager>
java_bridge_dispatcher_host_manager_;
- // TODO(fsamuel): Remove this once upstreaming of the new browser plugin
- // implementation is complete.
- // Manages the browser plugin instances hosted by this WebContents.
- scoped_ptr<old::BrowserPluginHost> old_browser_plugin_host_;
-
// SavePackage, lazily created.
scoped_refptr<SavePackage> save_package_;
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index ca3ad9c..c970711 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -248,10 +248,6 @@
'browser/browser_plugin/browser_plugin_guest_helper.cc',
'browser/browser_plugin/browser_plugin_guest_helper.h',
'browser/browser_plugin/browser_plugin_host_factory.h',
- 'browser/browser_plugin/old/old_browser_plugin_host.cc',
- 'browser/browser_plugin/old/old_browser_plugin_host.h',
- 'browser/browser_plugin/old/old_browser_plugin_host_helper.cc',
- 'browser/browser_plugin/old/old_browser_plugin_host_helper.h',
'browser/browser_process_sub_thread.cc',
'browser/browser_process_sub_thread.h',
'browser/browser_thread_impl.cc',
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h
index 6f38c44..7dba135 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -69,9 +69,7 @@ class RenderViewHostTester {
// Gives tests access to RenderViewHostImpl::CreateRenderView.
virtual bool CreateRenderView(const string16& frame_name,
int opener_route_id,
- int32 max_page_id,
- const std::string& embedder_channel_name,
- int embedder_container_id) = 0;
+ int32 max_page_id) = 0;
// Calls OnMsgNavigate on the RenderViewHost with the given information,
// setting the rest of the parameters in the message to the "typical" values.