Chromium Code Reviews| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 724 | 724 |
| 725 // PlzNavigate | 725 // PlzNavigate |
| 726 void RenderFrameHostManager::BeginNavigation(const NavigationRequest& request) { | 726 void RenderFrameHostManager::BeginNavigation(const NavigationRequest& request) { |
| 727 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 727 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 728 switches::kEnableBrowserSideNavigation)); | 728 switches::kEnableBrowserSideNavigation)); |
| 729 // Clean up any state in case there's an ongoing navigation. | 729 // Clean up any state in case there's an ongoing navigation. |
| 730 // TODO(carlosk): remove this cleanup here once we properly cancel ongoing | 730 // TODO(carlosk): remove this cleanup here once we properly cancel ongoing |
| 731 // navigations. | 731 // navigations. |
| 732 CleanUpNavigation(); | 732 CleanUpNavigation(); |
| 733 | 733 |
| 734 RenderFrameHostImpl* dest_rfh = GetFrameHostForNavigation(request); | 734 RenderFrameHostImpl* dest_rfh = GetFrameHostForNavigation(request, false); |
| 735 cross_navigation_pending_ = false; | |
| 735 DCHECK(dest_rfh); | 736 DCHECK(dest_rfh); |
| 736 } | 737 } |
| 737 | 738 |
| 738 // PlzNavigate | 739 // PlzNavigate |
| 739 RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation( | 740 RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation( |
| 740 const NavigationRequest& request) { | 741 const NavigationRequest& request, |
| 742 bool for_commit) { | |
| 741 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 743 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 742 switches::kEnableBrowserSideNavigation)); | 744 switches::kEnableBrowserSideNavigation)); |
| 743 | 745 |
| 744 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); | 746 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); |
| 745 | 747 |
| 746 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( | 748 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( |
| 747 request.common_params().url, request.source_site_instance(), | 749 request.common_params().url, request.source_site_instance(), |
| 748 request.dest_site_instance(), request.common_params().transition, | 750 request.dest_site_instance(), request.common_params().transition, |
| 749 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, | 751 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, |
| 750 request.is_view_source()); | 752 request.is_view_source()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 if (!navigation_rfh->IsRenderFrameLive()) { | 822 if (!navigation_rfh->IsRenderFrameLive()) { |
| 821 // Recreate the opener chain. | 823 // Recreate the opener chain. |
| 822 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( | 824 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( |
| 823 navigation_rfh->GetSiteInstance()); | 825 navigation_rfh->GetSiteInstance()); |
| 824 if (!InitRenderView(navigation_rfh->render_view_host(), opener_route_id, | 826 if (!InitRenderView(navigation_rfh->render_view_host(), opener_route_id, |
| 825 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame())) { | 827 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame())) { |
| 826 return nullptr; | 828 return nullptr; |
| 827 } | 829 } |
| 828 } | 830 } |
| 829 | 831 |
| 830 cross_navigation_pending_ = navigation_rfh != render_frame_host_.get(); | 832 if (for_commit) |
|
nasko
2015/03/30 22:35:22
Can't this be replaced by an earlier check for exi
clamy
2015/03/31 12:58:17
I'm now resetting it to false in BeginNavigation (
carlosk
2015/03/31 13:01:32
I think the explicit parameter is a better choice
| |
| 833 cross_navigation_pending_ = navigation_rfh != render_frame_host_.get(); | |
| 834 | |
| 831 return navigation_rfh; | 835 return navigation_rfh; |
| 832 } | 836 } |
| 833 | 837 |
| 834 // PlzNavigate | 838 // PlzNavigate |
| 835 void RenderFrameHostManager::CleanUpNavigation() { | 839 void RenderFrameHostManager::CleanUpNavigation() { |
| 836 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 840 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 837 switches::kEnableBrowserSideNavigation)); | 841 switches::kEnableBrowserSideNavigation)); |
| 838 speculative_web_ui_.reset(); | 842 speculative_web_ui_.reset(); |
| 839 should_reuse_web_ui_ = false; | 843 should_reuse_web_ui_ = false; |
| 840 if (speculative_render_frame_host_) | 844 if (speculative_render_frame_host_) |
| (...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2019 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 2023 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 2020 SiteInstance* instance) { | 2024 SiteInstance* instance) { |
| 2021 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 2025 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
| 2022 if (iter != proxy_hosts_.end()) { | 2026 if (iter != proxy_hosts_.end()) { |
| 2023 delete iter->second; | 2027 delete iter->second; |
| 2024 proxy_hosts_.erase(iter); | 2028 proxy_hosts_.erase(iter); |
| 2025 } | 2029 } |
| 2026 } | 2030 } |
| 2027 | 2031 |
| 2028 } // namespace content | 2032 } // namespace content |
| OLD | NEW |