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

Side by Side Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 20924002: Try to restore window.opener when opening blocked popups (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sessionStorage+opener Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/render_view_host_manager.h" 5 #include "content/browser/web_contents/render_view_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 !render_view_host_->IsRenderViewLive()) { 142 !render_view_host_->IsRenderViewLive()) {
143 // Note: we don't call InitRenderView here because we are navigating away 143 // Note: we don't call InitRenderView here because we are navigating away
144 // soon anyway, and we don't have the NavigationEntry for this host. 144 // soon anyway, and we don't have the NavigationEntry for this host.
145 delegate_->CreateRenderViewForRenderManager(render_view_host_, 145 delegate_->CreateRenderViewForRenderManager(render_view_host_,
146 MSG_ROUTING_NONE); 146 MSG_ROUTING_NONE);
147 } 147 }
148 148
149 // If the renderer crashed, then try to create a new one to satisfy this 149 // If the renderer crashed, then try to create a new one to satisfy this
150 // navigation request. 150 // navigation request.
151 if (!dest_render_view_host->IsRenderViewLive()) { 151 if (!dest_render_view_host->IsRenderViewLive()) {
152 if (!InitRenderView(dest_render_view_host, MSG_ROUTING_NONE)) 152 // Ensure that we have created RVHs for the new RVH's opener chain if
Charlie Reis 2013/07/30 01:26:30 I think this makes sense, but I would be very surp
jochen (gone - plz use gerrit) 2013/07/30 14:50:39 done.
153 // we are staying in the same BrowsingInstance. This allows the pending RVH
154 // to send cross-process script calls to its opener(s).
155 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager(
156 dest_render_view_host->GetSiteInstance());
157
158 if (!InitRenderView(dest_render_view_host, opener_route_id))
153 return NULL; 159 return NULL;
154 160
155 // Now that we've created a new renderer, be sure to hide it if it isn't 161 // Now that we've created a new renderer, be sure to hide it if it isn't
156 // our primary one. Otherwise, we might crash if we try to call Show() 162 // our primary one. Otherwise, we might crash if we try to call Show()
157 // on it later. 163 // on it later.
158 if (dest_render_view_host != render_view_host_ && 164 if (dest_render_view_host != render_view_host_ &&
159 dest_render_view_host->GetView()) { 165 dest_render_view_host->GetView()) {
160 dest_render_view_host->GetView()->Hide(); 166 dest_render_view_host->GetView()->Hide();
161 } else { 167 } else {
162 // This is our primary renderer, notify here as we won't be calling 168 // This is our primary renderer, notify here as we won't be calling
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( 1060 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost(
1055 SiteInstance* instance) { 1061 SiteInstance* instance) {
1056 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); 1062 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId());
1057 if (iter != swapped_out_hosts_.end()) 1063 if (iter != swapped_out_hosts_.end())
1058 return iter->second; 1064 return iter->second;
1059 1065
1060 return NULL; 1066 return NULL;
1061 } 1067 }
1062 1068
1063 } // namespace content 1069 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698