Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2225343002: Navigation: move RestoreType and ReloadType into a separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+ Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 756
758 SiteInstance* candidate_site_instance = 757 SiteInstance* candidate_site_instance =
759 speculative_render_frame_host_ 758 speculative_render_frame_host_
760 ? speculative_render_frame_host_->GetSiteInstance() 759 ? speculative_render_frame_host_->GetSiteInstance()
761 : nullptr; 760 : nullptr;
762 761
763 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( 762 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation(
764 request.common_params().url, request.source_site_instance(), 763 request.common_params().url, request.source_site_instance(),
765 request.dest_site_instance(), candidate_site_instance, 764 request.dest_site_instance(), candidate_site_instance,
766 request.common_params().transition, 765 request.common_params().transition,
767 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, 766 request.restore_type() != RestoreType::NONE, request.is_view_source());
768 request.is_view_source());
769 767
770 // The appropriate RenderFrameHost to commit the navigation. 768 // The appropriate RenderFrameHost to commit the navigation.
771 RenderFrameHostImpl* navigation_rfh = nullptr; 769 RenderFrameHostImpl* navigation_rfh = nullptr;
772 770
773 bool notify_webui_of_rv_creation = false; 771 bool notify_webui_of_rv_creation = false;
774 772
775 // Reuse the current RenderFrameHost if its SiteInstance matches the 773 // Reuse the current RenderFrameHost if its SiteInstance matches the
776 // navigation's. 774 // navigation's.
777 bool no_renderer_swap = current_site_instance == dest_site_instance.get(); 775 bool no_renderer_swap = current_site_instance == dest_site_instance.get();
778 776
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2624 resolved_url)) { 2622 resolved_url)) {
2625 DCHECK(!dest_instance || 2623 DCHECK(!dest_instance ||
2626 dest_instance == render_frame_host_->GetSiteInstance()); 2624 dest_instance == render_frame_host_->GetSiteInstance());
2627 return false; 2625 return false;
2628 } 2626 }
2629 2627
2630 return true; 2628 return true;
2631 } 2629 }
2632 2630
2633 } // namespace content 2631 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698