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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 RenderFrameHostImpl* RenderFrameHostManager::Navigate( | 200 RenderFrameHostImpl* RenderFrameHostManager::Navigate( |
201 const GURL& dest_url, | 201 const GURL& dest_url, |
202 const FrameNavigationEntry& frame_entry, | 202 const FrameNavigationEntry& frame_entry, |
203 const NavigationEntryImpl& entry, | 203 const NavigationEntryImpl& entry, |
204 bool is_reload) { | 204 bool is_reload) { |
205 TRACE_EVENT1("navigation", "RenderFrameHostManager:Navigate", | 205 TRACE_EVENT1("navigation", "RenderFrameHostManager:Navigate", |
206 "FrameTreeNode id", frame_tree_node_->frame_tree_node_id()); | 206 "FrameTreeNode id", frame_tree_node_->frame_tree_node_id()); |
207 // Create a pending RenderFrameHost to use for the navigation. | 207 // Create a pending RenderFrameHost to use for the navigation. |
208 RenderFrameHostImpl* dest_render_frame_host = UpdateStateForNavigate( | 208 RenderFrameHostImpl* dest_render_frame_host = UpdateStateForNavigate( |
209 dest_url, frame_entry.source_site_instance(), frame_entry.site_instance(), | 209 dest_url, frame_entry.source_site_instance(), frame_entry.site_instance(), |
210 entry.GetTransitionType(), | 210 entry.GetTransitionType(), entry.restore_type() != RestoreType::NONE, |
211 entry.restore_type() != NavigationEntryImpl::RESTORE_NONE, | |
212 entry.IsViewSourceMode(), entry.transferred_global_request_id(), | 211 entry.IsViewSourceMode(), entry.transferred_global_request_id(), |
213 entry.bindings(), is_reload); | 212 entry.bindings(), is_reload); |
214 if (!dest_render_frame_host) | 213 if (!dest_render_frame_host) |
215 return nullptr; // We weren't able to create a pending render frame host. | 214 return nullptr; // We weren't able to create a pending render frame host. |
216 | 215 |
217 // If the current render_frame_host_ isn't live, we should create it so | 216 // If the current render_frame_host_ isn't live, we should create it so |
218 // that we don't show a sad tab while the dest_render_frame_host fetches | 217 // that we don't show a sad tab while the dest_render_frame_host fetches |
219 // its first page. (Bug 1145340) | 218 // its first page. (Bug 1145340) |
220 if (dest_render_frame_host != render_frame_host_.get() && | 219 if (dest_render_frame_host != render_frame_host_.get() && |
221 !render_frame_host_->IsRenderFrameLive()) { | 220 !render_frame_host_->IsRenderFrameLive()) { |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 | 753 |
755 SiteInstance* candidate_site_instance = | 754 SiteInstance* candidate_site_instance = |
756 speculative_render_frame_host_ | 755 speculative_render_frame_host_ |
757 ? speculative_render_frame_host_->GetSiteInstance() | 756 ? speculative_render_frame_host_->GetSiteInstance() |
758 : nullptr; | 757 : nullptr; |
759 | 758 |
760 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( | 759 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( |
761 request.common_params().url, request.source_site_instance(), | 760 request.common_params().url, request.source_site_instance(), |
762 request.dest_site_instance(), candidate_site_instance, | 761 request.dest_site_instance(), candidate_site_instance, |
763 request.common_params().transition, | 762 request.common_params().transition, |
764 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, | 763 request.restore_type() != RestoreType::NONE, request.is_view_source()); |
765 request.is_view_source()); | |
766 | 764 |
767 // The appropriate RenderFrameHost to commit the navigation. | 765 // The appropriate RenderFrameHost to commit the navigation. |
768 RenderFrameHostImpl* navigation_rfh = nullptr; | 766 RenderFrameHostImpl* navigation_rfh = nullptr; |
769 | 767 |
770 bool notify_webui_of_rv_creation = false; | 768 bool notify_webui_of_rv_creation = false; |
771 | 769 |
772 // Reuse the current RenderFrameHost if its SiteInstance matches the | 770 // Reuse the current RenderFrameHost if its SiteInstance matches the |
773 // navigation's. | 771 // navigation's. |
774 bool no_renderer_swap = current_site_instance == dest_site_instance.get(); | 772 bool no_renderer_swap = current_site_instance == dest_site_instance.get(); |
775 | 773 |
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2679 resolved_url)) { | 2677 resolved_url)) { |
2680 DCHECK(!dest_instance || | 2678 DCHECK(!dest_instance || |
2681 dest_instance == render_frame_host_->GetSiteInstance()); | 2679 dest_instance == render_frame_host_->GetSiteInstance()); |
2682 return false; | 2680 return false; |
2683 } | 2681 } |
2684 | 2682 |
2685 return true; | 2683 return true; |
2686 } | 2684 } |
2687 | 2685 |
2688 } // namespace content | 2686 } // namespace content |
OLD | NEW |