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/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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 700 } | 700 } |
| 701 | 701 |
| 702 void NavigatorImpl::RequestTransferURL( | 702 void NavigatorImpl::RequestTransferURL( |
| 703 RenderFrameHostImpl* render_frame_host, | 703 RenderFrameHostImpl* render_frame_host, |
| 704 const GURL& url, | 704 const GURL& url, |
| 705 SiteInstance* source_site_instance, | 705 SiteInstance* source_site_instance, |
| 706 const std::vector<GURL>& redirect_chain, | 706 const std::vector<GURL>& redirect_chain, |
| 707 const Referrer& referrer, | 707 const Referrer& referrer, |
| 708 ui::PageTransition page_transition, | 708 ui::PageTransition page_transition, |
| 709 const GlobalRequestID& transferred_global_request_id, | 709 const GlobalRequestID& transferred_global_request_id, |
| 710 bool should_replace_current_entry) { | 710 bool should_replace_current_entry, |
| 711 const scoped_refptr<ResourceRequestBody>& resource_request_body) { | |
| 711 // This call only makes sense for subframes if OOPIFs are possible. | 712 // This call only makes sense for subframes if OOPIFs are possible. |
| 712 DCHECK(!render_frame_host->GetParent() || | 713 DCHECK(!render_frame_host->GetParent() || |
| 713 SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 714 SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
| 714 | 715 |
| 715 // Allow the delegate to cancel the transfer. | 716 // Allow the delegate to cancel the transfer. |
| 716 if (!delegate_->ShouldTransferNavigation()) | 717 if (!delegate_->ShouldTransferNavigation()) |
| 717 return; | 718 return; |
| 718 | 719 |
| 719 GURL dest_url(url); | 720 GURL dest_url(url); |
| 720 Referrer referrer_to_use(referrer); | 721 Referrer referrer_to_use(referrer); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 // |entry| during NavigateToEntry. This will go away when we shortcut this | 806 // |entry| during NavigateToEntry. This will go away when we shortcut this |
| 806 // further in https://crbug.com/536906. | 807 // further in https://crbug.com/536906. |
| 807 scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node)); | 808 scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node)); |
| 808 if (!frame_entry) { | 809 if (!frame_entry) { |
| 809 // TODO(creis): Handle POST submissions here, as above. | 810 // TODO(creis): Handle POST submissions here, as above. |
| 810 frame_entry = new FrameNavigationEntry( | 811 frame_entry = new FrameNavigationEntry( |
| 811 node->unique_name(), -1, -1, nullptr, | 812 node->unique_name(), -1, -1, nullptr, |
| 812 static_cast<SiteInstanceImpl*>(source_site_instance), dest_url, | 813 static_cast<SiteInstanceImpl*>(source_site_instance), dest_url, |
| 813 referrer_to_use, "GET", -1); | 814 referrer_to_use, "GET", -1); |
| 814 } | 815 } |
| 816 | |
| 817 // TODO(lukasza): DO NOT SUBMIT: Plumb |resource_request_body| further. | |
| 818 // Option #1: Conjure a new page state and add the body into the page state? | |
| 819 // Option #2: Add the body to either FrameNav...Entry or NavigationEntryImpl. | |
|
Łukasz Anforowicz
2016/05/10 00:49:37
I haven't quite wrapped my head yet around option
| |
| 820 | |
| 815 NavigateToEntry(node, *frame_entry, *entry.get(), | 821 NavigateToEntry(node, *frame_entry, *entry.get(), |
| 816 NavigationController::NO_RELOAD, false, false); | 822 NavigationController::NO_RELOAD, false, false); |
| 817 } | 823 } |
| 818 | 824 |
| 819 // PlzNavigate | 825 // PlzNavigate |
| 820 void NavigatorImpl::OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, | 826 void NavigatorImpl::OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, |
| 821 bool proceed) { | 827 bool proceed) { |
| 822 CHECK(IsBrowserSideNavigationEnabled()); | 828 CHECK(IsBrowserSideNavigationEnabled()); |
| 823 DCHECK(frame_tree_node); | 829 DCHECK(frame_tree_node); |
| 824 | 830 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1147 if (pending_entry != controller_->GetVisibleEntry() || | 1153 if (pending_entry != controller_->GetVisibleEntry() || |
| 1148 !should_preserve_entry) { | 1154 !should_preserve_entry) { |
| 1149 controller_->DiscardPendingEntry(true); | 1155 controller_->DiscardPendingEntry(true); |
| 1150 | 1156 |
| 1151 // Also force the UI to refresh. | 1157 // Also force the UI to refresh. |
| 1152 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1158 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1153 } | 1159 } |
| 1154 } | 1160 } |
| 1155 | 1161 |
| 1156 } // namespace content | 1162 } // namespace content |
| OLD | NEW |