| 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 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) { |
| 741 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 742 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 742 switches::kEnableBrowserSideNavigation)); | 743 switches::kEnableBrowserSideNavigation)); |
| 743 | 744 |
| 744 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); | 745 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 // Recreate the opener chain. | 822 // Recreate the opener chain. |
| 822 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( | 823 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager( |
| 823 navigation_rfh->GetSiteInstance()); | 824 navigation_rfh->GetSiteInstance()); |
| 824 if (!InitRenderView(navigation_rfh->render_view_host(), opener_route_id, | 825 if (!InitRenderView(navigation_rfh->render_view_host(), opener_route_id, |
| 825 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame())) { | 826 MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame())) { |
| 826 return nullptr; | 827 return nullptr; |
| 827 } | 828 } |
| 828 } | 829 } |
| 829 | 830 |
| 830 cross_navigation_pending_ = navigation_rfh != render_frame_host_.get(); | 831 cross_navigation_pending_ = navigation_rfh != render_frame_host_.get(); |
| 832 |
| 831 return navigation_rfh; | 833 return navigation_rfh; |
| 832 } | 834 } |
| 833 | 835 |
| 834 // PlzNavigate | 836 // PlzNavigate |
| 835 void RenderFrameHostManager::CleanUpNavigation() { | 837 void RenderFrameHostManager::CleanUpNavigation() { |
| 836 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 838 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 837 switches::kEnableBrowserSideNavigation)); | 839 switches::kEnableBrowserSideNavigation)); |
| 838 speculative_web_ui_.reset(); | 840 speculative_web_ui_.reset(); |
| 839 should_reuse_web_ui_ = false; | 841 should_reuse_web_ui_ = false; |
| 840 if (speculative_render_frame_host_) | 842 if (speculative_render_frame_host_) |
| (...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2019 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 2021 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 2020 SiteInstance* instance) { | 2022 SiteInstance* instance) { |
| 2021 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 2023 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
| 2022 if (iter != proxy_hosts_.end()) { | 2024 if (iter != proxy_hosts_.end()) { |
| 2023 delete iter->second; | 2025 delete iter->second; |
| 2024 proxy_hosts_.erase(iter); | 2026 proxy_hosts_.erase(iter); |
| 2025 } | 2027 } |
| 2026 } | 2028 } |
| 2027 | 2029 |
| 2028 } // namespace content | 2030 } // namespace content |
| OLD | NEW |