| Index: content/browser/frame_host/interstitial_page_impl.cc
|
| diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
|
| index 7af8d029f7ee0ca82f99283619118ff0e06a9c4c..f3bfb8c23773d0eb77fb0a74507a372bcb07ee10 100644
|
| --- a/content/browser/frame_host/interstitial_page_impl.cc
|
| +++ b/content/browser/frame_host/interstitial_page_impl.cc
|
| @@ -162,7 +162,7 @@ InterstitialPageImpl::InterstitialPageImpl(
|
| // TODO(creis): We will also need to pass delegates for the RVHM as we
|
| // start to use it.
|
| frame_tree_(new InterstitialPageNavigatorImpl(this, controller_),
|
| - NULL, NULL, NULL, NULL),
|
| + this, this, this, 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 @@ void InterstitialPageImpl::Hide() {
|
| controller_->delegate()->GetRenderViewHost()->GetView())->Focus();
|
| }
|
|
|
| - // 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.
|
| + // 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.
|
| base::MessageLoop::current()->PostNonNestableTask(
|
| FROM_HERE,
|
| base::Bind(&InterstitialPageImpl::Shutdown,
|
| - weak_ptr_factory_.GetWeakPtr(),
|
| - render_view_host_));
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| render_view_host_ = NULL;
|
| - frame_tree_.SwapMainFrame(NULL);
|
| + frame_tree_.ResetForMainFrameSwap();
|
| controller_->delegate()->DetachInterstitialPage();
|
| // Let's revert to the original title if necessary.
|
| NavigationEntry* entry = controller_->GetVisibleEntry();
|
| @@ -479,7 +479,8 @@ WebPreferences InterstitialPageImpl::GetWebkitPrefs() {
|
|
|
| void InterstitialPageImpl::RenderWidgetDeleted(
|
| RenderWidgetHostImpl* render_widget_host) {
|
| - delete this;
|
| + // TODO(creis): Remove this method once we verify the shutdown path is sane.
|
| + CHECK(!web_contents_);
|
| }
|
|
|
| bool InterstitialPageImpl::PreHandleKeyboardEvent(
|
| @@ -524,14 +525,10 @@ RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() {
|
| session_storage_namespace_ =
|
| new SessionStorageNamespaceImpl(dom_storage_context);
|
|
|
| - return RenderViewHostFactory::Create(site_instance.get(),
|
| - this,
|
| - this,
|
| - this,
|
| - MSG_ROUTING_NONE,
|
| - MSG_ROUTING_NONE,
|
| - false,
|
| - false);
|
| + // 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();
|
| }
|
|
|
| WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
|
| @@ -749,9 +746,8 @@ void InterstitialPageImpl::Disable() {
|
| enabled_ = false;
|
| }
|
|
|
| -void InterstitialPageImpl::Shutdown(RenderViewHostImpl* render_view_host) {
|
| - render_view_host->Shutdown();
|
| - // We are deleted now.
|
| +void InterstitialPageImpl::Shutdown() {
|
| + delete this;
|
| }
|
|
|
| void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() {
|
|
|