diff options
author | nasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 04:58:20 +0000 |
---|---|---|
committer | nasko@chromium.org <nasko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 04:58:20 +0000 |
commit | 04cbd3dca1a6f76e9f6b2ff8ea8091d5e53f4470 (patch) | |
tree | 05684841c170f43e07170a03f9cf7f0a3f898e12 /content/browser/renderer_host | |
parent | b28852bb914a3b9789901da9ca7e6e20170a8862 (diff) | |
download | chromium_src-04cbd3dca1a6f76e9f6b2ff8ea8091d5e53f4470.zip chromium_src-04cbd3dca1a6f76e9f6b2ff8ea8091d5e53f4470.tar.gz chromium_src-04cbd3dca1a6f76e9f6b2ff8ea8091d5e53f4470.tar.bz2 |
Prevent the browser process from creating duplicate RenderViewHosts.
BUG=312016
Review URL: https://codereview.chromium.org/92873004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host')
3 files changed, 11 insertions, 7 deletions
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index e5fa672..50b9d44 100644 --- a/content/browser/renderer_host/render_view_host_delegate.h +++ b/content/browser/renderer_host/render_view_host_delegate.h @@ -382,8 +382,9 @@ class CONTENT_EXPORT RenderViewHostDelegate { virtual void LostMouseLock() {} // The page is trying to open a new page (e.g. a popup window). The window - // should be created associated with the given route, but it should not be - // shown yet. That should happen in response to ShowCreatedWindow. + // should be created associated with the given |route_id| in process + // |render_process_id|, but it should not be shown yet. That should happen in + // response to ShowCreatedWindow. // |params.window_container_type| describes the type of RenderViewHost // container that is requested -- in particular, the window.open call may // have specified 'background' and 'persistent' in the feature string. @@ -394,6 +395,7 @@ class CONTENT_EXPORT RenderViewHostDelegate { // Note: this is not called "CreateWindow" because that will clash with // the Windows function which is actually a #define. virtual void CreateNewWindow( + int render_process_id, int route_id, int main_frame_route_id, const ViewHostMsg_CreateWindow_Params& params, diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 6382706..9ce8199 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -1323,8 +1323,9 @@ void RenderViewHostImpl::CreateNewWindow( FilterURL(policy, GetProcess(), true, &validated_params.opener_security_origin); - delegate_->CreateNewWindow(route_id, main_frame_route_id, - validated_params, session_storage_namespace); + delegate_->CreateNewWindow( + GetProcess()->GetID(), route_id, main_frame_route_id, validated_params, + session_storage_namespace); } void RenderViewHostImpl::CreateNewWidget(int route_id, diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index c792a6d..28728c3 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -212,9 +212,10 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, is_threaded_compositing_enabled_ = IsThreadedCompositingEnabled(); - - g_routing_id_widget_map.Get().insert(std::make_pair( - RenderWidgetHostID(process->GetID(), routing_id_), this)); + std::pair<RoutingIDWidgetMap::iterator, bool> result = + g_routing_id_widget_map.Get().insert(std::make_pair( + RenderWidgetHostID(process->GetID(), routing_id_), this)); + CHECK(result.second) << "Inserting a duplicate item!"; process_->AddRoute(routing_id_, this); // If we're initially visible, tell the process host that we're alive. |