OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 } | 154 } |
155 return new_web_ui.Pass(); | 155 return new_web_ui.Pass(); |
156 } | 156 } |
157 | 157 |
158 RenderFrameHostImpl* RenderFrameHostManager::Navigate( | 158 RenderFrameHostImpl* RenderFrameHostManager::Navigate( |
159 const NavigationEntryImpl& entry) { | 159 const NavigationEntryImpl& entry) { |
160 TRACE_EVENT1("navigation", "RenderFrameHostManager:Navigate", | 160 TRACE_EVENT1("navigation", "RenderFrameHostManager:Navigate", |
161 "FrameTreeNode id", frame_tree_node_->frame_tree_node_id()); | 161 "FrameTreeNode id", frame_tree_node_->frame_tree_node_id()); |
162 // Create a pending RenderFrameHost to use for the navigation. | 162 // Create a pending RenderFrameHost to use for the navigation. |
163 RenderFrameHostImpl* dest_render_frame_host = UpdateStateForNavigate( | 163 RenderFrameHostImpl* dest_render_frame_host = UpdateStateForNavigate( |
164 entry.GetURL(), | 164 entry.GetURL(), entry.source_site_instance(), entry.site_instance(), |
165 entry.site_instance(), | |
166 entry.GetTransitionType(), | 165 entry.GetTransitionType(), |
167 entry.restore_type() != NavigationEntryImpl::RESTORE_NONE, | 166 entry.restore_type() != NavigationEntryImpl::RESTORE_NONE, |
168 entry.IsViewSourceMode(), | 167 entry.IsViewSourceMode(), entry.transferred_global_request_id(), |
169 entry.transferred_global_request_id(), | |
170 entry.bindings()); | 168 entry.bindings()); |
171 if (!dest_render_frame_host) | 169 if (!dest_render_frame_host) |
172 return NULL; // We weren't able to create a pending render frame host. | 170 return NULL; // We weren't able to create a pending render frame host. |
173 | 171 |
174 // If the current render_frame_host_ isn't live, we should create it so | 172 // If the current render_frame_host_ isn't live, we should create it so |
175 // that we don't show a sad tab while the dest_render_frame_host fetches | 173 // that we don't show a sad tab while the dest_render_frame_host fetches |
176 // its first page. (Bug 1145340) | 174 // its first page. (Bug 1145340) |
177 if (dest_render_frame_host != render_frame_host_ && | 175 if (dest_render_frame_host != render_frame_host_ && |
178 !render_frame_host_->IsRenderFrameLive()) { | 176 !render_frame_host_->IsRenderFrameLive()) { |
179 // Note: we don't call InitRenderView here because we are navigating away | 177 // Note: we don't call InitRenderView here because we are navigating away |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 // the redirect chain. | 369 // the redirect chain. |
372 CHECK(transfer_url_chain.size()); | 370 CHECK(transfer_url_chain.size()); |
373 GURL transfer_url = transfer_url_chain.back(); | 371 GURL transfer_url = transfer_url_chain.back(); |
374 std::vector<GURL> rest_of_chain = transfer_url_chain; | 372 std::vector<GURL> rest_of_chain = transfer_url_chain; |
375 rest_of_chain.pop_back(); | 373 rest_of_chain.pop_back(); |
376 | 374 |
377 // We don't know whether the original request had |user_action| set to true. | 375 // We don't know whether the original request had |user_action| set to true. |
378 // However, since we force the navigation to be in the current tab, it | 376 // However, since we force the navigation to be in the current tab, it |
379 // doesn't matter. | 377 // doesn't matter. |
380 pending_render_frame_host->frame_tree_node()->navigator()->RequestTransferURL( | 378 pending_render_frame_host->frame_tree_node()->navigator()->RequestTransferURL( |
381 pending_render_frame_host, | 379 pending_render_frame_host, transfer_url, nullptr, rest_of_chain, referrer, |
Charlie Reis
2014/12/06 00:18:50
Darn. We don't have the source SiteInstance at th
lfg
2014/12/08 20:45:33
Done.
| |
382 transfer_url, | 380 page_transition, CURRENT_TAB, global_request_id, |
383 rest_of_chain, | 381 should_replace_current_entry, true); |
384 referrer, | |
385 page_transition, | |
386 CURRENT_TAB, | |
387 global_request_id, | |
388 should_replace_current_entry, | |
389 true); | |
390 | 382 |
391 // The transferring request was only needed during the RequestTransferURL | 383 // The transferring request was only needed during the RequestTransferURL |
392 // call, so it is safe to clear at this point. | 384 // call, so it is safe to clear at this point. |
393 cross_site_transferring_request_.reset(); | 385 cross_site_transferring_request_.reset(); |
394 } | 386 } |
395 | 387 |
396 void RenderFrameHostManager::OnDeferredAfterResponseStarted( | 388 void RenderFrameHostManager::OnDeferredAfterResponseStarted( |
397 const GlobalRequestID& global_request_id, | 389 const GlobalRequestID& global_request_id, |
398 RenderFrameHostImpl* pending_render_frame_host) { | 390 RenderFrameHostImpl* pending_render_frame_host) { |
399 DCHECK(!response_started_id_.get()); | 391 DCHECK(!response_started_id_.get()); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
624 ui::PageTransition transition) { | 616 ui::PageTransition transition) { |
625 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( | 617 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( |
626 switches::kEnableBrowserSideNavigation)); | 618 switches::kEnableBrowserSideNavigation)); |
627 // TODO(clamy): When we handle renderer initiated navigations, make sure not | 619 // TODO(clamy): When we handle renderer initiated navigations, make sure not |
628 // to use a different process for subframes if --site-per-process is not | 620 // to use a different process for subframes if --site-per-process is not |
629 // enabled. | 621 // enabled. |
630 | 622 |
631 // Pick the right RenderFrameHost to commit the navigation. | 623 // Pick the right RenderFrameHost to commit the navigation. |
632 // TODO(clamy): Replace the default values by the right ones. | 624 // TODO(clamy): Replace the default values by the right ones. |
633 RenderFrameHostImpl* render_frame_host = UpdateStateForNavigate( | 625 RenderFrameHostImpl* render_frame_host = UpdateStateForNavigate( |
634 url, NULL, transition, false, false, GlobalRequestID(), | 626 url, nullptr, nullptr, transition, false, false, GlobalRequestID(), |
635 NavigationEntryImpl::kInvalidBindings); | 627 NavigationEntryImpl::kInvalidBindings); |
636 | 628 |
637 // If the renderer that needs to navigate is not live (it was just created or | 629 // If the renderer that needs to navigate is not live (it was just created or |
638 // it crashed), initialize it. | 630 // it crashed), initialize it. |
639 if (!render_frame_host->render_view_host()->IsRenderViewLive()) { | 631 if (!render_frame_host->render_view_host()->IsRenderViewLive()) { |
640 // Recreate the opener chain. | 632 // Recreate the opener chain. |
641 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( | 633 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( |
642 render_frame_host->GetSiteInstance()); | 634 render_frame_host->GetSiteInstance()); |
643 if (!InitRenderView(render_frame_host->render_view_host(), | 635 if (!InitRenderView(render_frame_host->render_view_host(), |
644 opener_route_id, | 636 opener_route_id, |
645 MSG_ROUTING_NONE, | 637 MSG_ROUTING_NONE, |
646 frame_tree_node_->IsMainFrame())) { | 638 frame_tree_node_->IsMainFrame())) { |
647 return NULL; | 639 return nullptr; |
648 } | 640 } |
649 } | 641 } |
650 return render_frame_host; | 642 return render_frame_host; |
651 } | 643 } |
652 | 644 |
653 void RenderFrameHostManager::Observe( | 645 void RenderFrameHostManager::Observe( |
654 int type, | 646 int type, |
655 const NotificationSource& source, | 647 const NotificationSource& source, |
656 const NotificationDetails& details) { | 648 const NotificationDetails& details) { |
657 switch (type) { | 649 switch (type) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 delegate_->GetControllerForRenderManager(); | 763 delegate_->GetControllerForRenderManager(); |
772 return current_entry && web_ui_.get() && | 764 return current_entry && web_ui_.get() && |
773 (WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( | 765 (WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( |
774 controller.GetBrowserContext(), current_entry->GetURL()) == | 766 controller.GetBrowserContext(), current_entry->GetURL()) == |
775 WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( | 767 WebUIControllerFactoryRegistry::GetInstance()->GetWebUIType( |
776 controller.GetBrowserContext(), new_url)); | 768 controller.GetBrowserContext(), new_url)); |
777 } | 769 } |
778 | 770 |
779 SiteInstance* RenderFrameHostManager::GetSiteInstanceForNavigation( | 771 SiteInstance* RenderFrameHostManager::GetSiteInstanceForNavigation( |
780 const GURL& dest_url, | 772 const GURL& dest_url, |
773 SiteInstance* source_instance, | |
781 SiteInstance* dest_instance, | 774 SiteInstance* dest_instance, |
782 ui::PageTransition dest_transition, | 775 ui::PageTransition dest_transition, |
783 bool dest_is_restore, | 776 bool dest_is_restore, |
784 bool dest_is_view_source_mode) { | 777 bool dest_is_view_source_mode) { |
785 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); | 778 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); |
786 SiteInstance* new_instance = current_instance; | 779 SiteInstance* new_instance = current_instance; |
787 | 780 |
788 // We do not currently swap processes for navigations in webview tag guests. | 781 // We do not currently swap processes for navigations in webview tag guests. |
789 if (current_instance->GetSiteURL().SchemeIs(kGuestScheme)) | 782 if (current_instance->GetSiteURL().SchemeIs(kGuestScheme)) |
790 return current_instance; | 783 return current_instance; |
(...skipping 15 matching lines...) Expand all Loading... | |
806 bool current_is_view_source_mode = current_entry ? | 799 bool current_is_view_source_mode = current_entry ? |
807 current_entry->IsViewSourceMode() : dest_is_view_source_mode; | 800 current_entry->IsViewSourceMode() : dest_is_view_source_mode; |
808 bool force_swap = ShouldSwapBrowsingInstancesForNavigation( | 801 bool force_swap = ShouldSwapBrowsingInstancesForNavigation( |
809 current_effective_url, | 802 current_effective_url, |
810 current_is_view_source_mode, | 803 current_is_view_source_mode, |
811 dest_instance, | 804 dest_instance, |
812 SiteInstanceImpl::GetEffectiveURL(browser_context, dest_url), | 805 SiteInstanceImpl::GetEffectiveURL(browser_context, dest_url), |
813 dest_is_view_source_mode); | 806 dest_is_view_source_mode); |
814 if (ShouldTransitionCrossSite() || force_swap) { | 807 if (ShouldTransitionCrossSite() || force_swap) { |
815 new_instance = GetSiteInstanceForURL( | 808 new_instance = GetSiteInstanceForURL( |
816 dest_url, | 809 dest_url, source_instance, dest_instance, dest_transition, |
817 dest_instance, | 810 dest_is_restore, dest_is_view_source_mode, current_instance, |
818 dest_transition, | |
819 dest_is_restore, | |
820 dest_is_view_source_mode, | |
821 current_instance, | |
822 force_swap); | 811 force_swap); |
823 } | 812 } |
824 | 813 |
825 // If force_swap is true, we must use a different SiteInstance. If we didn't, | 814 // If force_swap is true, we must use a different SiteInstance. If we didn't, |
826 // we would have two RenderFrameHosts in the same SiteInstance and the same | 815 // we would have two RenderFrameHosts in the same SiteInstance and the same |
827 // frame, resulting in page_id conflicts for their NavigationEntries. | 816 // frame, resulting in page_id conflicts for their NavigationEntries. |
828 if (force_swap) | 817 if (force_swap) |
829 CHECK_NE(new_instance, current_instance); | 818 CHECK_NE(new_instance, current_instance); |
830 return new_instance; | 819 return new_instance; |
831 } | 820 } |
832 | 821 |
833 SiteInstance* RenderFrameHostManager::GetSiteInstanceForURL( | 822 SiteInstance* RenderFrameHostManager::GetSiteInstanceForURL( |
834 const GURL& dest_url, | 823 const GURL& dest_url, |
824 SiteInstance* source_instance, | |
835 SiteInstance* dest_instance, | 825 SiteInstance* dest_instance, |
836 ui::PageTransition dest_transition, | 826 ui::PageTransition dest_transition, |
837 bool dest_is_restore, | 827 bool dest_is_restore, |
838 bool dest_is_view_source_mode, | 828 bool dest_is_view_source_mode, |
839 SiteInstance* current_instance, | 829 SiteInstance* current_instance, |
840 bool force_browsing_instance_swap) { | 830 bool force_browsing_instance_swap) { |
841 NavigationControllerImpl& controller = | 831 NavigationControllerImpl& controller = |
842 delegate_->GetControllerForRenderManager(); | 832 delegate_->GetControllerForRenderManager(); |
843 BrowserContext* browser_context = controller.GetBrowserContext(); | 833 BrowserContext* browser_context = controller.GetBrowserContext(); |
844 | 834 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
971 return SiteInstance::CreateForURL(browser_context, dest_url); | 961 return SiteInstance::CreateForURL(browser_context, dest_url); |
972 } | 962 } |
973 | 963 |
974 // Use the current SiteInstance for same site navigations, as long as the | 964 // Use the current SiteInstance for same site navigations, as long as the |
975 // process type is correct. (The URL may have been installed as an app since | 965 // process type is correct. (The URL may have been installed as an app since |
976 // the last time we visited it.) | 966 // the last time we visited it.) |
977 const GURL& current_url = | 967 const GURL& current_url = |
978 GetCurrentURLForSiteInstance(current_instance, current_entry); | 968 GetCurrentURLForSiteInstance(current_instance, current_entry); |
979 if (SiteInstance::IsSameWebSite(browser_context, current_url, dest_url) && | 969 if (SiteInstance::IsSameWebSite(browser_context, current_url, dest_url) && |
980 !current_site_instance->HasWrongProcessForURL(dest_url)) { | 970 !current_site_instance->HasWrongProcessForURL(dest_url)) { |
981 return current_instance; | 971 return source_instance ? source_instance : current_instance; |
Charlie Reis
2014/12/06 00:18:50
Ooh, this is wrong, and if we don't have any tests
lfg
2014/12/08 20:45:33
I switched to a specific case instead of using IsS
| |
982 } | 972 } |
983 | 973 |
984 // Start the new renderer in a new SiteInstance, but in the current | 974 // Start the new renderer in a new SiteInstance, but in the current |
985 // BrowsingInstance. It is important to immediately give this new | 975 // BrowsingInstance. It is important to immediately give this new |
986 // SiteInstance to a RenderViewHost (if it is different than our current | 976 // SiteInstance to a RenderViewHost (if it is different than our current |
987 // SiteInstance), so that it is ref counted. This will happen in | 977 // SiteInstance), so that it is ref counted. This will happen in |
988 // CreateRenderView. | 978 // CreateRenderView. |
989 return current_instance->GetRelatedSiteInstance(dest_url); | 979 return current_instance->GetRelatedSiteInstance(dest_url); |
990 } | 980 } |
991 | 981 |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1430 // |rvh| to Shutdown. | 1420 // |rvh| to Shutdown. |
1431 FrameTree* tree = rvh->GetDelegate()->GetFrameTree(); | 1421 FrameTree* tree = rvh->GetDelegate()->GetFrameTree(); |
1432 tree->ForEach(base::Bind( | 1422 tree->ForEach(base::Bind( |
1433 &RenderFrameHostManager::ClearProxiesInSiteInstance, | 1423 &RenderFrameHostManager::ClearProxiesInSiteInstance, |
1434 site_instance_id)); | 1424 site_instance_id)); |
1435 } | 1425 } |
1436 } | 1426 } |
1437 } | 1427 } |
1438 | 1428 |
1439 RenderFrameHostImpl* RenderFrameHostManager::UpdateStateForNavigate( | 1429 RenderFrameHostImpl* RenderFrameHostManager::UpdateStateForNavigate( |
1440 const GURL& url, | 1430 const GURL& dest_url, |
1441 SiteInstance* instance, | 1431 SiteInstance* source_instance, |
1442 ui::PageTransition transition, | 1432 SiteInstance* dest_instance, |
1443 bool is_restore, | 1433 ui::PageTransition dest_transition, |
1444 bool is_view_source_mode, | 1434 bool dest_is_restore, |
1435 bool dest_is_view_source_mode, | |
1445 const GlobalRequestID& transferred_request_id, | 1436 const GlobalRequestID& transferred_request_id, |
1446 int bindings) { | 1437 int bindings) { |
1447 // If we are currently navigating cross-process, we want to get back to normal | 1438 // If we are currently navigating cross-process, we want to get back to normal |
1448 // and then navigate as usual. | 1439 // and then navigate as usual. |
1449 if (cross_navigation_pending_) { | 1440 if (cross_navigation_pending_) { |
1450 if (pending_render_frame_host_) | 1441 if (pending_render_frame_host_) |
1451 CancelPending(); | 1442 CancelPending(); |
1452 cross_navigation_pending_ = false; | 1443 cross_navigation_pending_ = false; |
1453 } | 1444 } |
1454 | 1445 |
1455 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); | 1446 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); |
1456 scoped_refptr<SiteInstance> new_instance = GetSiteInstanceForNavigation( | 1447 scoped_refptr<SiteInstance> new_instance = GetSiteInstanceForNavigation( |
1457 url, instance, transition, is_restore, is_view_source_mode); | 1448 dest_url, source_instance, dest_instance, dest_transition, |
1449 dest_is_restore, dest_is_view_source_mode); | |
1458 | 1450 |
1459 const NavigationEntry* current_entry = | 1451 const NavigationEntry* current_entry = |
1460 delegate_->GetLastCommittedNavigationEntryForRenderManager(); | 1452 delegate_->GetLastCommittedNavigationEntryForRenderManager(); |
1461 | 1453 |
1462 if (new_instance.get() != current_instance) { | 1454 if (new_instance.get() != current_instance) { |
1463 TRACE_EVENT_INSTANT2( | 1455 TRACE_EVENT_INSTANT2( |
1464 "navigation", | 1456 "navigation", |
1465 "RenderFrameHostManager::UpdateStateForNavigate:New SiteInstance", | 1457 "RenderFrameHostManager::UpdateStateForNavigate:New SiteInstance", |
1466 TRACE_EVENT_SCOPE_THREAD, | 1458 TRACE_EVENT_SCOPE_THREAD, |
1467 "current_instance id", current_instance->GetId(), | 1459 "current_instance id", current_instance->GetId(), |
1468 "new_instance id", new_instance->GetId()); | 1460 "new_instance id", new_instance->GetId()); |
1469 | 1461 |
1470 // New SiteInstance: create a pending RFH to navigate. | 1462 // New SiteInstance: create a pending RFH to navigate. |
1471 DCHECK(!cross_navigation_pending_); | 1463 DCHECK(!cross_navigation_pending_); |
1472 | 1464 |
1473 // This will possibly create (set to NULL) a Web UI object for the pending | 1465 // This will possibly create (set to NULL) a Web UI object for the pending |
1474 // page. We'll use this later to give the page special access. This must | 1466 // page. We'll use this later to give the page special access. This must |
1475 // happen before the new renderer is created below so it will get bindings. | 1467 // happen before the new renderer is created below so it will get bindings. |
1476 // It must also happen after the above conditional call to CancelPending(), | 1468 // It must also happen after the above conditional call to CancelPending(), |
1477 // otherwise CancelPending may clear the pending_web_ui_ and the page will | 1469 // otherwise CancelPending may clear the pending_web_ui_ and the page will |
1478 // not have its bindings set appropriately. | 1470 // not have its bindings set appropriately. |
1479 SetPendingWebUI(url, bindings); | 1471 SetPendingWebUI(dest_url, bindings); |
1480 CreatePendingRenderFrameHost(current_instance, new_instance.get(), | 1472 CreatePendingRenderFrameHost(current_instance, new_instance.get(), |
1481 frame_tree_node_->IsMainFrame()); | 1473 frame_tree_node_->IsMainFrame()); |
1482 if (!pending_render_frame_host_.get()) { | 1474 if (!pending_render_frame_host_.get()) { |
1483 return NULL; | 1475 return NULL; |
1484 } | 1476 } |
1485 | 1477 |
1486 // Check if our current RFH is live before we set up a transition. | 1478 // Check if our current RFH is live before we set up a transition. |
1487 if (!render_frame_host_->IsRenderFrameLive()) { | 1479 if (!render_frame_host_->IsRenderFrameLive()) { |
1488 if (!cross_navigation_pending_) { | 1480 if (!cross_navigation_pending_) { |
1489 // The current RFH is not live. There's no reason to sit around with a | 1481 // The current RFH is not live. There's no reason to sit around with a |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1547 // Otherwise the same SiteInstance can be used. Navigate render_frame_host_. | 1539 // Otherwise the same SiteInstance can be used. Navigate render_frame_host_. |
1548 DCHECK(!cross_navigation_pending_); | 1540 DCHECK(!cross_navigation_pending_); |
1549 | 1541 |
1550 // It's possible to swap out the current RFH and then decide to navigate in it | 1542 // It's possible to swap out the current RFH and then decide to navigate in it |
1551 // anyway (e.g., a cross-process navigation that redirects back to the | 1543 // anyway (e.g., a cross-process navigation that redirects back to the |
1552 // original site). In that case, we have a proxy for the current RFH but | 1544 // original site). In that case, we have a proxy for the current RFH but |
1553 // haven't deleted it yet. The new navigation will swap it back in, so we can | 1545 // haven't deleted it yet. The new navigation will swap it back in, so we can |
1554 // delete the proxy. | 1546 // delete the proxy. |
1555 DeleteRenderFrameProxyHost(new_instance.get()); | 1547 DeleteRenderFrameProxyHost(new_instance.get()); |
1556 | 1548 |
1557 if (ShouldReuseWebUI(current_entry, url)) { | 1549 if (ShouldReuseWebUI(current_entry, dest_url)) { |
1558 pending_web_ui_.reset(); | 1550 pending_web_ui_.reset(); |
1559 pending_and_current_web_ui_ = web_ui_->AsWeakPtr(); | 1551 pending_and_current_web_ui_ = web_ui_->AsWeakPtr(); |
1560 } else { | 1552 } else { |
1561 SetPendingWebUI(url, bindings); | 1553 SetPendingWebUI(dest_url, bindings); |
1562 // Make sure the new RenderViewHost has the right bindings. | 1554 // Make sure the new RenderViewHost has the right bindings. |
1563 if (pending_web_ui() && | 1555 if (pending_web_ui() && |
1564 !render_frame_host_->GetProcess()->IsIsolatedGuest()) { | 1556 !render_frame_host_->GetProcess()->IsIsolatedGuest()) { |
1565 render_frame_host_->render_view_host()->AllowBindings( | 1557 render_frame_host_->render_view_host()->AllowBindings( |
1566 pending_web_ui()->GetBindings()); | 1558 pending_web_ui()->GetBindings()); |
1567 } | 1559 } |
1568 } | 1560 } |
1569 | 1561 |
1570 if (pending_web_ui() && render_frame_host_->IsRenderFrameLive()) { | 1562 if (pending_web_ui() && render_frame_host_->IsRenderFrameLive()) { |
1571 pending_web_ui()->GetController()->RenderViewReused( | 1563 pending_web_ui()->GetController()->RenderViewReused( |
1572 render_frame_host_->render_view_host()); | 1564 render_frame_host_->render_view_host()); |
1573 } | 1565 } |
1574 | 1566 |
1575 // The renderer can exit view source mode when any error or cancellation | 1567 // The renderer can exit view source mode when any error or cancellation |
1576 // happen. We must overwrite to recover the mode. | 1568 // happen. We must overwrite to recover the mode. |
1577 if (is_view_source_mode) { | 1569 if (dest_is_view_source_mode) { |
1578 render_frame_host_->render_view_host()->Send( | 1570 render_frame_host_->render_view_host()->Send( |
1579 new ViewMsg_EnableViewSourceMode( | 1571 new ViewMsg_EnableViewSourceMode( |
1580 render_frame_host_->render_view_host()->GetRoutingID())); | 1572 render_frame_host_->render_view_host()->GetRoutingID())); |
1581 } | 1573 } |
1582 | 1574 |
1583 return render_frame_host_.get(); | 1575 return render_frame_host_.get(); |
1584 } | 1576 } |
1585 | 1577 |
1586 void RenderFrameHostManager::CancelPending() { | 1578 void RenderFrameHostManager::CancelPending() { |
1587 TRACE_EVENT1("navigation", "RenderFrameHostManager::CancelPending", | 1579 TRACE_EVENT1("navigation", "RenderFrameHostManager::CancelPending", |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1674 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1666 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1675 SiteInstance* instance) { | 1667 SiteInstance* instance) { |
1676 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1668 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1677 if (iter != proxy_hosts_.end()) { | 1669 if (iter != proxy_hosts_.end()) { |
1678 delete iter->second; | 1670 delete iter->second; |
1679 proxy_hosts_.erase(iter); | 1671 proxy_hosts_.erase(iter); |
1680 } | 1672 } |
1681 } | 1673 } |
1682 | 1674 |
1683 } // namespace content | 1675 } // namespace content |
OLD | NEW |