| 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 | 265 |
| 266 bool NavigatorImpl::NavigateToEntry( | 266 bool NavigatorImpl::NavigateToEntry( |
| 267 FrameTreeNode* frame_tree_node, | 267 FrameTreeNode* frame_tree_node, |
| 268 const FrameNavigationEntry& frame_entry, | 268 const FrameNavigationEntry& frame_entry, |
| 269 const NavigationEntryImpl& entry, | 269 const NavigationEntryImpl& entry, |
| 270 NavigationController::ReloadType reload_type, | 270 NavigationController::ReloadType reload_type, |
| 271 bool is_same_document_history_load, | 271 bool is_same_document_history_load, |
| 272 bool is_pending_entry, | 272 bool is_pending_entry, |
| 273 const scoped_refptr<ResourceRequestBody>& post_body) { | 273 const scoped_refptr<ResourceRequestBodyImpl>& post_body) { |
| 274 TRACE_EVENT0("browser,navigation", "NavigatorImpl::NavigateToEntry"); | 274 TRACE_EVENT0("browser,navigation", "NavigatorImpl::NavigateToEntry"); |
| 275 | 275 |
| 276 GURL dest_url = frame_entry.url(); | 276 GURL dest_url = frame_entry.url(); |
| 277 Referrer dest_referrer = frame_entry.referrer(); | 277 Referrer dest_referrer = frame_entry.referrer(); |
| 278 if (reload_type == | 278 if (reload_type == |
| 279 NavigationController::ReloadType::RELOAD_ORIGINAL_REQUEST_URL && | 279 NavigationController::ReloadType::RELOAD_ORIGINAL_REQUEST_URL && |
| 280 entry.GetOriginalRequestURL().is_valid() && !entry.GetHasPostData()) { | 280 entry.GetOriginalRequestURL().is_valid() && !entry.GetHasPostData()) { |
| 281 // We may have been redirected when navigating to the current URL. | 281 // We may have been redirected when navigating to the current URL. |
| 282 // Use the URL the user originally intended to visit, if it's valid and if a | 282 // Use the URL the user originally intended to visit, if it's valid and if a |
| 283 // POST wasn't involved; the latter case avoids issues with sending data to | 283 // POST wasn't involved; the latter case avoids issues with sending data to |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 void NavigatorImpl::RequestTransferURL( | 721 void NavigatorImpl::RequestTransferURL( |
| 722 RenderFrameHostImpl* render_frame_host, | 722 RenderFrameHostImpl* render_frame_host, |
| 723 const GURL& url, | 723 const GURL& url, |
| 724 SiteInstance* source_site_instance, | 724 SiteInstance* source_site_instance, |
| 725 const std::vector<GURL>& redirect_chain, | 725 const std::vector<GURL>& redirect_chain, |
| 726 const Referrer& referrer, | 726 const Referrer& referrer, |
| 727 ui::PageTransition page_transition, | 727 ui::PageTransition page_transition, |
| 728 const GlobalRequestID& transferred_global_request_id, | 728 const GlobalRequestID& transferred_global_request_id, |
| 729 bool should_replace_current_entry, | 729 bool should_replace_current_entry, |
| 730 const std::string& method, | 730 const std::string& method, |
| 731 const scoped_refptr<ResourceRequestBody>& post_body) { | 731 const scoped_refptr<ResourceRequestBodyImpl>& post_body) { |
| 732 // |method != "POST"| should imply absence of |post_body|. | 732 // |method != "POST"| should imply absence of |post_body|. |
| 733 DCHECK(method == "POST" || !post_body); | 733 DCHECK(method == "POST" || !post_body); |
| 734 | 734 |
| 735 // This call only makes sense for subframes if OOPIFs are possible. | 735 // This call only makes sense for subframes if OOPIFs are possible. |
| 736 DCHECK(!render_frame_host->GetParent() || | 736 DCHECK(!render_frame_host->GetParent() || |
| 737 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 737 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
| 738 | 738 |
| 739 // Allow the delegate to cancel the transfer. | 739 // Allow the delegate to cancel the transfer. |
| 740 if (!delegate_->ShouldTransferNavigation()) | 740 if (!delegate_->ShouldTransferNavigation()) |
| 741 return; | 741 return; |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 if (pending_entry != controller_->GetVisibleEntry() || | 1168 if (pending_entry != controller_->GetVisibleEntry() || |
| 1169 !should_preserve_entry) { | 1169 !should_preserve_entry) { |
| 1170 controller_->DiscardPendingEntry(true); | 1170 controller_->DiscardPendingEntry(true); |
| 1171 | 1171 |
| 1172 // Also force the UI to refresh. | 1172 // Also force the UI to refresh. |
| 1173 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1173 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1174 } | 1174 } |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 } // namespace content | 1177 } // namespace content |
| OLD | NEW |