Index: trunk/src/content/browser/frame_host/interstitial_page_impl.cc |
=================================================================== |
--- trunk/src/content/browser/frame_host/interstitial_page_impl.cc (revision 241158) |
+++ trunk/src/content/browser/frame_host/interstitial_page_impl.cc (working copy) |
@@ -162,7 +162,7 @@ |
// TODO(creis): We will also need to pass delegates for the RVHM as we |
// start to use it. |
frame_tree_(new InterstitialPageNavigatorImpl(this, controller_), |
- this, this, this, NULL), |
+ NULL, NULL, NULL, NULL), |
original_child_id_(web_contents->GetRenderProcessHost()->GetID()), |
original_rvh_id_(web_contents->GetRenderViewHost()->GetRoutingID()), |
should_revert_web_contents_title_(false), |
@@ -284,15 +284,15 @@ |
controller_->delegate()->GetRenderViewHost()->GetView())->Focus(); |
} |
- // Delete this and call Shutdown on the RVH asynchronously, as we may have |
- // been called from a RVH delegate method, and we can't delete the RVH out |
- // from under itself. |
+ // Shutdown the RVH asynchronously, as we may have been called from a RVH |
+ // delegate method, and we can't delete the RVH out from under itself. |
base::MessageLoop::current()->PostNonNestableTask( |
FROM_HERE, |
base::Bind(&InterstitialPageImpl::Shutdown, |
- weak_ptr_factory_.GetWeakPtr())); |
+ weak_ptr_factory_.GetWeakPtr(), |
+ render_view_host_)); |
render_view_host_ = NULL; |
- frame_tree_.ResetForMainFrameSwap(); |
+ frame_tree_.SwapMainFrame(NULL); |
controller_->delegate()->DetachInterstitialPage(); |
// Let's revert to the original title if necessary. |
NavigationEntry* entry = controller_->GetVisibleEntry(); |
@@ -479,8 +479,7 @@ |
void InterstitialPageImpl::RenderWidgetDeleted( |
RenderWidgetHostImpl* render_widget_host) { |
- // TODO(creis): Remove this method once we verify the shutdown path is sane. |
- CHECK(!web_contents_); |
+ delete this; |
} |
bool InterstitialPageImpl::PreHandleKeyboardEvent( |
@@ -525,10 +524,14 @@ |
session_storage_namespace_ = |
new SessionStorageNamespaceImpl(dom_storage_context); |
- // Use the RenderViewHost from our FrameTree. |
- frame_tree_.root()->render_manager()->Init( |
- browser_context, site_instance.get(), MSG_ROUTING_NONE, MSG_ROUTING_NONE); |
- return frame_tree_.root()->current_frame_host()->render_view_host(); |
+ return RenderViewHostFactory::Create(site_instance.get(), |
+ this, |
+ this, |
+ this, |
+ MSG_ROUTING_NONE, |
+ MSG_ROUTING_NONE, |
+ false, |
+ false); |
} |
WebContentsView* InterstitialPageImpl::CreateWebContentsView() { |
@@ -746,8 +749,9 @@ |
enabled_ = false; |
} |
-void InterstitialPageImpl::Shutdown() { |
- delete this; |
+void InterstitialPageImpl::Shutdown(RenderViewHostImpl* render_view_host) { |
+ render_view_host->Shutdown(); |
+ // We are deleted now. |
} |
void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() { |