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

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

Issue 2368183004: Move redirect_chain from NavigationEntry to FrameNavigationEntry. (Closed)
Patch Set: Nit Created 4 years, 2 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/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/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 // with a subframe entry for our destination. 814 // with a subframe entry for our destination.
815 // TODO(creis): Ensure this case can't exist in https://crbug.com/524208. 815 // TODO(creis): Ensure this case can't exist in https://crbug.com/524208.
816 entry = NavigationEntryImpl::FromNavigationEntry( 816 entry = NavigationEntryImpl::FromNavigationEntry(
817 controller_->CreateNavigationEntry( 817 controller_->CreateNavigationEntry(
818 GURL(url::kAboutBlankURL), referrer_to_use, page_transition, 818 GURL(url::kAboutBlankURL), referrer_to_use, page_transition,
819 is_renderer_initiated, std::string(), 819 is_renderer_initiated, std::string(),
820 controller_->GetBrowserContext())); 820 controller_->GetBrowserContext()));
821 } 821 }
822 entry->AddOrUpdateFrameEntry( 822 entry->AddOrUpdateFrameEntry(
823 node, -1, -1, nullptr, 823 node, -1, -1, nullptr,
824 static_cast<SiteInstanceImpl*>(source_site_instance), dest_url, 824 static_cast<SiteInstanceImpl*>(source_site_instance),
825 referrer_to_use, PageState(), method, -1); 825 dest_url, referrer_to_use, redirect_chain, PageState(), method,
826 -1);
826 } else { 827 } else {
827 // Main frame case. 828 // Main frame case.
828 entry = NavigationEntryImpl::FromNavigationEntry( 829 entry = NavigationEntryImpl::FromNavigationEntry(
829 controller_->CreateNavigationEntry( 830 controller_->CreateNavigationEntry(
830 dest_url, referrer_to_use, page_transition, is_renderer_initiated, 831 dest_url, referrer_to_use, page_transition, is_renderer_initiated,
831 std::string(), controller_->GetBrowserContext())); 832 std::string(), controller_->GetBrowserContext()));
832 entry->root_node()->frame_entry->set_source_site_instance( 833 entry->root_node()->frame_entry->set_source_site_instance(
833 static_cast<SiteInstanceImpl*>(source_site_instance)); 834 static_cast<SiteInstanceImpl*>(source_site_instance));
835 entry->SetRedirectChain(redirect_chain);
834 } 836 }
835 837
836 entry->SetRedirectChain(redirect_chain);
837 // Don't allow an entry replacement if there is no entry to replace. 838 // Don't allow an entry replacement if there is no entry to replace.
838 // http://crbug.com/457149 839 // http://crbug.com/457149
839 if (should_replace_current_entry && controller_->GetEntryCount() > 0) 840 if (should_replace_current_entry && controller_->GetEntryCount() > 0)
840 entry->set_should_replace_entry(true); 841 entry->set_should_replace_entry(true);
841 if (controller_->GetLastCommittedEntry() && 842 if (controller_->GetLastCommittedEntry() &&
842 controller_->GetLastCommittedEntry()->GetIsOverridingUserAgent()) { 843 controller_->GetLastCommittedEntry()->GetIsOverridingUserAgent()) {
843 entry->SetIsOverridingUserAgent(true); 844 entry->SetIsOverridingUserAgent(true);
844 } 845 }
845 entry->set_transferred_global_request_id(transferred_global_request_id); 846 entry->set_transferred_global_request_id(transferred_global_request_id);
846 // TODO(creis): Set user gesture and intent received timestamp on Android. 847 // TODO(creis): Set user gesture and intent received timestamp on Android.
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 if (pending_entry != controller_->GetVisibleEntry() || 1203 if (pending_entry != controller_->GetVisibleEntry() ||
1203 !should_preserve_entry) { 1204 !should_preserve_entry) {
1204 controller_->DiscardPendingEntry(true); 1205 controller_->DiscardPendingEntry(true);
1205 1206
1206 // Also force the UI to refresh. 1207 // Also force the UI to refresh.
1207 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 1208 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
1208 } 1209 }
1209 } 1210 }
1210 1211
1211 } // namespace content 1212 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698