Kill page id.
BUG=368661
TEST=everything stays green
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2389943002
Cr-Commit-Position: refs/heads/master@{#425338}
diff --git a/android_webview/native/state_serializer.cc b/android_webview/native/state_serializer.cc
index 202e447..fd828ef 100644
--- a/android_webview/native/state_serializer.cc
+++ b/android_webview/native/state_serializer.cc
@@ -103,8 +103,6 @@
if (!internal::RestoreNavigationEntryFromPickle(state_version, iterator,
entries[i].get()))
return false;
-
- entries[i]->SetPageID(i);
}
// |web_contents| takes ownership of these entries after this call.
diff --git a/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc b/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc
index c8e4ad1b..4de94d8 100644
--- a/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc
+++ b/chrome/browser/chromeos/login/signin/merge_session_load_page_unittest.cc
@@ -69,11 +69,10 @@
}
void Navigate(const char* url,
- int page_id,
int nav_entry_id,
bool did_create_new_entry) {
WebContentsTester::For(web_contents())
- ->TestDidNavigate(web_contents()->GetMainFrame(), page_id, nav_entry_id,
+ ->TestDidNavigate(web_contents()->GetMainFrame(), nav_entry_id,
did_create_new_entry, GURL(url),
ui::PAGE_TRANSITION_TYPED);
}
@@ -125,7 +124,7 @@
TEST_F(MergeSessionLoadPageTest, MergeSessionPageNotShown) {
SetMergeSessionState(OAuth2LoginManager::SESSION_RESTORE_DONE);
// Start a load.
- Navigate(kURL1, 1, 0, true);
+ Navigate(kURL1, 0, true);
// Load next page.
controller().LoadURL(GURL(kURL2), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
@@ -143,7 +142,7 @@
base::TimeDelta::FromSeconds(kSessionMergeTimeout + 1));
// Start a load.
- Navigate(kURL1, 1, 0, true);
+ Navigate(kURL1, 0, true);
// Load next page.
controller().LoadURL(GURL(kURL2), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
@@ -158,7 +157,7 @@
SetMergeSessionState(OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS);
// Start a load.
- Navigate(kURL1, 1, 0, true);
+ Navigate(kURL1, 0, true);
// Load next page.
controller().LoadURL(GURL(kURL2), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
@@ -179,7 +178,7 @@
EXPECT_EQ(kURL2, web_contents()->GetVisibleURL().spec());
// Commit navigation and the interstitial page is gone.
- Navigate(kURL2, 2, pending_id, true);
+ Navigate(kURL2, pending_id, true);
EXPECT_FALSE(GetMergeSessionLoadPage());
}
diff --git a/chrome/browser/download/download_request_limiter_unittest.cc b/chrome/browser/download/download_request_limiter_unittest.cc
index ea5c512..59d1190 100644
--- a/chrome/browser/download/download_request_limiter_unittest.cc
+++ b/chrome/browser/download/download_request_limiter_unittest.cc
@@ -360,7 +360,7 @@
// Set up a renderer-initiated navigation to the same host.
content::RenderFrameHostTester* rfh_tester =
content::RenderFrameHostTester::For(web_contents()->GetMainFrame());
- rfh_tester->NavigateAndCommitRendererInitiated(1, true,
+ rfh_tester->NavigateAndCommitRendererInitiated(true,
GURL("http://foo.com/bar2"));
LoadCompleted();
@@ -369,7 +369,7 @@
download_request_limiter_->GetDownloadStatus(web_contents()));
// Renderer-initiated nav to a different host shouldn't reset the state.
- rfh_tester->NavigateAndCommitRendererInitiated(2, true,
+ rfh_tester->NavigateAndCommitRendererInitiated(true,
GURL("http://fooey.com/bar"));
LoadCompleted();
ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
@@ -397,12 +397,12 @@
// The state should not be reset on a renderer-initiated load to either the
// same host or a different host, in either the main frame or the subframe.
rfh_tester->NavigateAndCommitRendererInitiated(
- 3, true, GURL("http://fooeybar.com/bar"));
+ true, GURL("http://fooeybar.com/bar"));
LoadCompleted();
ASSERT_EQ(DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED,
download_request_limiter_->GetDownloadStatus(web_contents()));
- rfh_tester->NavigateAndCommitRendererInitiated(4, true,
+ rfh_tester->NavigateAndCommitRendererInitiated(true,
GURL("http://foo.com/bar"));
LoadCompleted();
ASSERT_EQ(DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED,
@@ -443,7 +443,7 @@
// the same host.
rfh_tester =
content::RenderFrameHostTester::For(web_contents()->GetMainFrame());
- rfh_tester->NavigateAndCommitRendererInitiated(5, true,
+ rfh_tester->NavigateAndCommitRendererInitiated(true,
GURL("http://foobar.com/bar"));
LoadCompleted();
ASSERT_EQ(DownloadRequestLimiter::ALLOW_ALL_DOWNLOADS,
@@ -464,7 +464,7 @@
// But a pending load to a different host in the main frame should reset the
// state.
- rfh_tester->NavigateAndCommitRendererInitiated(6, true,
+ rfh_tester->NavigateAndCommitRendererInitiated(true,
GURL("http://foo.com"));
LoadCompleted();
ASSERT_EQ(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD,
diff --git a/chrome/browser/engagement/site_engagement_helper_unittest.cc b/chrome/browser/engagement/site_engagement_helper_unittest.cc
index 5e83a972..87be05c 100644
--- a/chrome/browser/engagement/site_engagement_helper_unittest.cc
+++ b/chrome/browser/engagement/site_engagement_helper_unittest.cc
@@ -90,7 +90,7 @@
std::string());
int pending_id = controller().GetPendingEntry()->GetUniqueID();
content::WebContentsTester::For(web_contents())
- ->TestDidNavigate(web_contents()->GetMainFrame(), 1, pending_id, true,
+ ->TestDidNavigate(web_contents()->GetMainFrame(), pending_id, true,
url, ui::PAGE_TRANSITION_TYPED);
}
diff --git a/chrome/browser/engagement/site_engagement_service_unittest.cc b/chrome/browser/engagement/site_engagement_service_unittest.cc
index 59530338..96e3b9ab 100644
--- a/chrome/browser/engagement/site_engagement_service_unittest.cc
+++ b/chrome/browser/engagement/site_engagement_service_unittest.cc
@@ -162,7 +162,7 @@
controller().LoadURL(url, content::Referrer(), transition, std::string());
int pending_id = controller().GetPendingEntry()->GetUniqueID();
content::WebContentsTester::For(web_contents())
- ->TestDidNavigate(web_contents()->GetMainFrame(), 1, pending_id, true,
+ ->TestDidNavigate(web_contents()->GetMainFrame(), pending_id, true,
url, transition);
EXPECT_LT(prev_score, service->GetScore(url));
}
@@ -175,7 +175,7 @@
controller().LoadURL(url, content::Referrer(), transition, std::string());
int pending_id = controller().GetPendingEntry()->GetUniqueID();
content::WebContentsTester::For(web_contents())
- ->TestDidNavigate(web_contents()->GetMainFrame(), 1, pending_id, true,
+ ->TestDidNavigate(web_contents()->GetMainFrame(), pending_id, true,
url, transition);
EXPECT_EQ(prev_score, service->GetScore(url));
}
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
index 36bcd2b..81d8c6e 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -244,7 +244,7 @@
url, content::Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
content::NavigationEntry* entry = new_tab->GetController().GetPendingEntry();
content::RenderFrameHostTester::For(new_tab->GetMainFrame())
- ->SendNavigate(extra_tabs_.size() + 1, entry->GetUniqueID(), true, url);
+ ->SendNavigate(entry->GetUniqueID(), true, url);
// Set up required helpers, and make this be as "tabby" as the code requires.
#if defined(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/rlz/chrome_rlz_tracker_delegate_unittest.cc b/chrome/browser/rlz/chrome_rlz_tracker_delegate_unittest.cc
index d300626..2d76c92a 100644
--- a/chrome/browser/rlz/chrome_rlz_tracker_delegate_unittest.cc
+++ b/chrome/browser/rlz/chrome_rlz_tracker_delegate_unittest.cc
@@ -38,7 +38,6 @@
std::unique_ptr<content::NavigationEntry> entry(
content::NavigationEntry::Create());
details->entry = entry.get();
- details->entry->SetPageID(0);
details->entry->SetTransitionType(ui::PAGE_TRANSITION_LINK);
SendNotification(content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources(),
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
index 1d0b4bd2..d85adf0 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
@@ -136,7 +136,6 @@
int pending_id =
web_contents()->GetController().GetPendingEntry()->GetUniqueID();
- static int page_id = 0;
content::RenderFrameHost* rfh =
WebContentsTester::For(web_contents())->GetPendingMainFrame();
if (!rfh) {
@@ -144,7 +143,7 @@
}
WebContentsTester::For(web_contents())->ProceedWithCrossSiteNavigation();
WebContentsTester::For(web_contents())->TestDidNavigateWithReferrer(
- rfh, ++page_id, pending_id, true, url,
+ rfh, pending_id, true, url,
content::Referrer(referrer, blink::WebReferrerPolicyDefault), type);
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index 55f64fec..64ba51d 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -111,21 +111,18 @@
}
void Navigate(const char* url,
- int page_id,
int nav_entry_id,
bool did_create_new_entry) {
- NavigateInternal(url, page_id, nav_entry_id, did_create_new_entry, false);
+ NavigateInternal(url, nav_entry_id, did_create_new_entry, false);
}
void NavigateCrossSite(const char* url,
- int page_id,
int nav_entry_id,
bool did_create_new_entry) {
- NavigateInternal(url, page_id, nav_entry_id, did_create_new_entry, true);
+ NavigateInternal(url, nav_entry_id, did_create_new_entry, true);
}
void NavigateInternal(const char* url,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
bool is_cross_site) {
@@ -137,7 +134,7 @@
: web_contents()->GetMainFrame();
content::WebContentsTester::For(web_contents())
- ->TestDidNavigate(render_frame_host, page_id, nav_entry_id,
+ ->TestDidNavigate(render_frame_host, nav_entry_id,
did_create_new_entry, GURL(url),
ui::PAGE_TRANSITION_TYPED);
}
@@ -154,7 +151,6 @@
web_contents()->GetMainFrame();
WebContentsTester::For(web_contents())->TestDidNavigate(
rfh,
- entry->GetPageID(),
entry->GetUniqueID(),
false,
entry->GetURL(),
@@ -289,7 +285,7 @@
// The interstitial is shown until the navigation commits.
ASSERT_TRUE(InterstitialPage::GetInterstitialPage(web_contents()));
// Commit the navigation.
- Navigate(kBadURL, 1, pending_id, true);
+ Navigate(kBadURL, pending_id, true);
// The interstitial should be gone now.
ASSERT_FALSE(InterstitialPage::GetInterstitialPage(web_contents()));
@@ -308,10 +304,10 @@
prefs::kSafeBrowsingExtendedReportingEnabled, true);
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 0, true);
// Navigate somewhere else.
- Navigate(kGoodURL, 2, 0, true);
+ Navigate(kGoodURL, 0, true);
// Simulate that page loading a bad-resource triggering an interstitial.
ShowInterstitial(true, kBadURL);
@@ -344,7 +340,7 @@
prefs::kSafeBrowsingExtendedReportingEnabled, true);
// Navigate somewhere.
- Navigate(kGoodURL, 1, 0, true);
+ Navigate(kGoodURL, 0, true);
// Simulate that page loading a bad-resource triggering an interstitial.
ShowInterstitial(true, kBadURL);
@@ -378,10 +374,10 @@
prefs::kSafeBrowsingExtendedReportingEnabled, true);
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 0, true);
// Navigate somewhere else.
- Navigate(kGoodURL, 2, 0, true);
+ Navigate(kGoodURL, 0, true);
// Simulate that page loading a bad-resource triggering an interstitial.
ShowInterstitial(true, kBadURL);
@@ -420,10 +416,10 @@
prefs::kSafeBrowsingExtendedReportingEnabled, true);
// Navigate somewhere.
- Navigate(kGoogleURL, 1, 0, true);
+ Navigate(kGoogleURL, 0, true);
// Navigate somewhere else.
- Navigate(kGoodURL, 2, 0, true);
+ Navigate(kGoodURL, 0, true);
// Simulate that page loading a bad-resource triggering an interstitial.
ShowInterstitial(true, kBadURL);
@@ -477,7 +473,7 @@
prefs::kSafeBrowsingExtendedReportingEnabled, true);
// Navigate somewhere else.
- Navigate(kGoodURL, 1, 0, true);
+ Navigate(kGoodURL, 0, true);
// Simulate that page loading a bad-resource triggering an interstitial.
ShowInterstitial(true, kBadURL);
@@ -529,7 +525,7 @@
prefs::kSafeBrowsingExtendedReportingEnabled, true);
// Navigate somewhere.
- Navigate(kGoodURL, 1, 0, true);
+ Navigate(kGoodURL, 0, true);
// Now navigate to a bad page triggerring an interstitial.
controller().LoadURL(GURL(kBadURL), content::Referrer(),
@@ -541,7 +537,7 @@
// Proceed, then navigate back.
ProceedThroughInterstitial(sb_interstitial);
- NavigateCrossSite(kBadURL, 2, pending_id, true); // Commit the navigation.
+ NavigateCrossSite(kBadURL, pending_id, true); // Commit the navigation.
GoBack(true);
// We are back on the good page.
@@ -560,7 +556,7 @@
// Let's proceed and make sure everything is OK (bug 17627).
ProceedThroughInterstitial(sb_interstitial);
// Commit the navigation.
- NavigateCrossSite(kBadURL, 2, pending_id, false);
+ NavigateCrossSite(kBadURL, pending_id, false);
sb_interstitial = GetSafeBrowsingBlockingPage();
ASSERT_FALSE(sb_interstitial);
ASSERT_EQ(2, controller().GetEntryCount());
diff --git a/chrome/browser/safe_browsing/threat_details_unittest.cc b/chrome/browser/safe_browsing/threat_details_unittest.cc
index 17719c1..331ebda 100644
--- a/chrome/browser/safe_browsing/threat_details_unittest.cc
+++ b/chrome/browser/safe_browsing/threat_details_unittest.cc
@@ -348,7 +348,7 @@
// Commit a load.
content::WebContentsTester::For(web_contents())
->TestDidNavigateWithReferrer(
- web_contents()->GetMainFrame(), 1 /* page_id */, 0 /* nav_entry_id */,
+ web_contents()->GetMainFrame(), 0 /* nav_entry_id */,
true /* did_create_new_entry */, GURL(kLandingURL),
content::Referrer(GURL(kReferrerURL),
blink::WebReferrerPolicyDefault),
@@ -568,7 +568,7 @@
// navigation entry.
content::WebContentsTester::For(web_contents())
->TestDidNavigateWithReferrer(
- web_contents()->GetMainFrame(), 1 /* page_id */, 0 /* nav_entry_id */,
+ web_contents()->GetMainFrame(), 0 /* nav_entry_id */,
true /* did_create_new_entry */, GURL(kUnrelatedURL),
content::Referrer(GURL(kUnrelatedReferrerURL),
blink::WebReferrerPolicyDefault),
@@ -629,7 +629,7 @@
// Load and commit the landing URL with a referrer.
content::WebContentsTester::For(web_contents())
->TestDidNavigateWithReferrer(
- web_contents()->GetMainFrame(), 1 /* page_id */, 0 /* nav_entry_id */,
+ web_contents()->GetMainFrame(), 0 /* nav_entry_id */,
true /* did_create_new_entry */, GURL(kLandingURL),
content::Referrer(GURL(kReferrerURL),
blink::WebReferrerPolicyDefault),
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index e6fd617..5727271 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -3243,7 +3243,6 @@
content::NavigationController::CreateNavigationEntry(
url, content::Referrer(), ui::PAGE_TRANSITION_RELOAD, false,
std::string(), tab->GetBrowserContext());
- restored_entry->SetPageID(0);
restored_entry->SetPageState(entry->GetPageState());
WebContents::CreateParams params(tab->GetBrowserContext());
diff --git a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
index 1541186..307192b 100644
--- a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
+++ b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
@@ -994,7 +994,7 @@
int pending_id =
web_contents()->GetController().GetPendingEntry()->GetUniqueID();
content::RenderFrameHostTester::For(web_contents()->GetMainFrame())
- ->SendNavigateWithTransition(0, pending_id, false, url,
+ ->SendNavigateWithTransition(pending_id, false, url,
ui::PAGE_TRANSITION_TYPED);
// Test that we are really getting a same page navigation, the test would be
@@ -1048,12 +1048,12 @@
// Simulate a sub-frame auto-navigating.
subframe_tester->SendNavigateWithTransition(
- 0, 0, false, GURL("http://pub.com"), ui::PAGE_TRANSITION_AUTO_SUBFRAME);
+ 0, false, GURL("http://pub.com"), ui::PAGE_TRANSITION_AUTO_SUBFRAME);
EXPECT_FALSE(TranslateUiVisible());
// Simulate the user navigating in a sub-frame.
subframe_tester->SendNavigateWithTransition(
- 1, 0, true, GURL("http://pub.com"), ui::PAGE_TRANSITION_MANUAL_SUBFRAME);
+ 1, true, GURL("http://pub.com"), ui::PAGE_TRANSITION_MANUAL_SUBFRAME);
EXPECT_FALSE(TranslateUiVisible());
// This is deliberately different behavior for bubbles - same language
diff --git a/chrome/browser/ui/zoom/zoom_controller_unittest.cc b/chrome/browser/ui/zoom/zoom_controller_unittest.cc
index 9d41f69..18f76df 100644
--- a/chrome/browser/ui/zoom/zoom_controller_unittest.cc
+++ b/chrome/browser/ui/zoom/zoom_controller_unittest.cc
@@ -32,7 +32,7 @@
// This call is needed so that the RenderViewHost reports being alive. This
// is only important for tests that call ZoomController::SetZoomLevel().
content::RenderViewHostTester::For(rvh())->CreateTestRenderView(
- base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false);
+ base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, false);
}
void TearDown() override {
diff --git a/components/sessions/content/content_serialized_navigation_builder.cc b/components/sessions/content/content_serialized_navigation_builder.cc
index 1894bcb..7acfa8b 100644
--- a/components/sessions/content/content_serialized_navigation_builder.cc
+++ b/components/sessions/content/content_serialized_navigation_builder.cc
@@ -62,7 +62,6 @@
std::unique_ptr<content::NavigationEntry>
ContentSerializedNavigationBuilder::ToNavigationEntry(
const SerializedNavigationEntry* navigation,
- int page_id,
content::BrowserContext* browser_context) {
blink::WebReferrerPolicy policy =
static_cast<blink::WebReferrerPolicy>(navigation->referrer_policy_);
@@ -81,7 +80,6 @@
entry->SetTitle(navigation->title_);
entry->SetPageState(content::PageState::CreateFromEncodedData(
navigation->encoded_page_state_));
- entry->SetPageID(page_id);
entry->SetHasPostData(navigation->has_post_data_);
entry->SetPostID(navigation->post_id_);
entry->SetOriginalRequestURL(navigation->original_request_url_);
@@ -118,13 +116,10 @@
ContentSerializedNavigationBuilder::ToNavigationEntries(
const std::vector<SerializedNavigationEntry>& navigations,
content::BrowserContext* browser_context) {
- int page_id = 0;
std::vector<std::unique_ptr<content::NavigationEntry>> entries;
entries.reserve(navigations.size());
- for (const auto& navigation : navigations) {
- entries.push_back(ToNavigationEntry(&navigation, page_id, browser_context));
- ++page_id;
- }
+ for (const auto& navigation : navigations)
+ entries.push_back(ToNavigationEntry(&navigation, browser_context));
return entries;
}
diff --git a/components/sessions/content/content_serialized_navigation_builder.h b/components/sessions/content/content_serialized_navigation_builder.h
index 6e02b6b..b8cd76d 100644
--- a/components/sessions/content/content_serialized_navigation_builder.h
+++ b/components/sessions/content/content_serialized_navigation_builder.h
@@ -29,15 +29,14 @@
const content::NavigationEntry& entry);
// Convert the given SerializedNavigationEntry into a NavigationEntry with the
- // given page ID and context. The NavigationEntry will have a transition type
- // of PAGE_TRANSITION_RELOAD and a new unique ID.
+ // given context. The NavigationEntry will have a transition type of
+ // PAGE_TRANSITION_RELOAD and a new unique ID.
static std::unique_ptr<content::NavigationEntry> ToNavigationEntry(
const SerializedNavigationEntry* navigation,
- int page_id,
content::BrowserContext* browser_context);
// Converts a set of SerializedNavigationEntrys into a list of
- // NavigationEntrys with sequential page IDs and the given context.
+ // NavigationEntrys with the given context.
static std::vector<std::unique_ptr<content::NavigationEntry>>
ToNavigationEntries(const std::vector<SerializedNavigationEntry>& navigations,
content::BrowserContext* browser_context);
diff --git a/components/sessions/content/content_serialized_navigation_builder_unittest.cc b/components/sessions/content/content_serialized_navigation_builder_unittest.cc
index bdecc17..585c41d 100644
--- a/components/sessions/content/content_serialized_navigation_builder_unittest.cc
+++ b/components/sessions/content/content_serialized_navigation_builder_unittest.cc
@@ -176,7 +176,7 @@
const std::unique_ptr<content::NavigationEntry> new_navigation_entry(
ContentSerializedNavigationBuilder::ToNavigationEntry(
- &navigation, test_data::kPageID, NULL));
+ &navigation, NULL));
EXPECT_EQ(test_data::kReferrerURL, new_navigation_entry->GetReferrer().url);
EXPECT_EQ(test_data::kReferrerPolicy,
@@ -185,7 +185,6 @@
EXPECT_EQ(test_data::kTitle, new_navigation_entry->GetTitle());
EXPECT_EQ(test_data::kEncodedPageState,
new_navigation_entry->GetPageState().ToEncodedData());
- EXPECT_EQ(test_data::kPageID, new_navigation_entry->GetPageID());
EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs(
new_navigation_entry->GetTransitionType(), ui::PAGE_TRANSITION_RELOAD));
EXPECT_EQ(test_data::kHasPostData, new_navigation_entry->GetHasPostData());
diff --git a/components/sessions/core/serialized_navigation_entry_test_helper.cc b/components/sessions/core/serialized_navigation_entry_test_helper.cc
index f090d67..99311ef4 100644
--- a/components/sessions/core/serialized_navigation_entry_test_helper.cc
+++ b/components/sessions/core/serialized_navigation_entry_test_helper.cc
@@ -38,7 +38,6 @@
const GURL kRedirectURL0 = GURL("http://go/redirect0");
const GURL kRedirectURL1 = GURL("http://go/redirect1");
const GURL kOtherURL = GURL("http://other.com");
-const int kPageID = 10;
const SerializedNavigationEntry::PasswordState kPasswordState =
SerializedNavigationEntry::HAS_PASSWORD_FIELD;
const std::string kExtendedInfoKey1 = "key 1";
diff --git a/components/sessions/core/serialized_navigation_entry_test_helper.h b/components/sessions/core/serialized_navigation_entry_test_helper.h
index 880f07b..27798ef 100644
--- a/components/sessions/core/serialized_navigation_entry_test_helper.h
+++ b/components/sessions/core/serialized_navigation_entry_test_helper.h
@@ -46,7 +46,6 @@
extern const GURL kRedirectURL0;
extern const GURL kRedirectURL1;
extern const GURL kOtherURL;
-extern const int kPageID;
extern const SerializedNavigationEntry::PasswordState kPasswordState;
extern const std::string kExtendedInfoKey1;
extern const std::string kExtendedInfoKey2;
diff --git a/components/sessions/ios/ios_serialized_navigation_builder.h b/components/sessions/ios/ios_serialized_navigation_builder.h
index a52285b..7fb7abe 100644
--- a/components/sessions/ios/ios_serialized_navigation_builder.h
+++ b/components/sessions/ios/ios_serialized_navigation_builder.h
@@ -26,8 +26,8 @@
static SerializedNavigationEntry FromNavigationItem(
int index, const web::NavigationItem& item);
- // Convert the given SerializedNavigationEntry into a NavigationItem with the
- // given page ID. The NavigationItem will have a transition type of
+ // Convert the given SerializedNavigationEntry into a NavigationItem. The
+ // NavigationItem will have a transition type of
// PAGE_TRANSITION_RELOAD and a new unique ID.
static std::unique_ptr<web::NavigationItem> ToNavigationItem(
const SerializedNavigationEntry* navigation);
diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc
index ce7aa1f..bd97df3a 100644
--- a/components/visitedlink/test/visitedlink_unittest.cc
+++ b/components/visitedlink/test/visitedlink_unittest.cc
@@ -746,7 +746,7 @@
TEST_F(VisitedLinkEventsTest, Basics) {
RenderViewHostTester::For(rvh())->CreateTestRenderView(
- base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false);
+ base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, false);
// Waiting complete rebuild the table.
content::RunAllBlockingPoolTasksUntilIdle();
@@ -778,7 +778,7 @@
TEST_F(VisitedLinkEventsTest, TabVisibility) {
RenderViewHostTester::For(rvh())->CreateTestRenderView(
- base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false);
+ base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, false);
// Waiting complete rebuild the table.
content::RunAllBlockingPoolTasksUntilIdle();
diff --git a/content/browser/devtools/devtools_manager_unittest.cc b/content/browser/devtools/devtools_manager_unittest.cc
index ee35e6b..2c4d1fa 100644
--- a/content/browser/devtools/devtools_manager_unittest.cc
+++ b/content/browser/devtools/devtools_manager_unittest.cc
@@ -178,7 +178,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int pending_id = controller().GetPendingEntry()->GetUniqueID();
contents()->GetMainFrame()->PrepareForCommit();
- contents()->TestDidNavigate(contents()->GetMainFrame(), 1, pending_id, true,
+ contents()->TestDidNavigate(contents()->GetMainFrame(), pending_id, true,
url, ui::PAGE_TRANSITION_TYPED);
contents()->GetMainFrame()->SimulateNavigationStop();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
@@ -201,7 +201,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
pending_id = controller().GetPendingEntry()->GetUniqueID();
contents()->GetMainFrame()->PrepareForCommit();
- contents()->TestDidNavigate(contents()->GetMainFrame(), 1, pending_id, false,
+ contents()->TestDidNavigate(contents()->GetMainFrame(), pending_id, false,
url, ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(client_host.agent_host(),
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
index b338d4ed..d74fed54 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -590,11 +590,8 @@
RenderWidgetHostImpl::From(render_view_host_->GetWidget())->SetView(view);
render_view_host_->AllowBindings(BINDINGS_POLICY_DOM_AUTOMATION);
- int32_t max_page_id = web_contents()->GetMaxPageIDForSiteInstance(
- render_view_host_->GetSiteInstance());
render_view_host_->CreateRenderView(MSG_ROUTING_NONE,
MSG_ROUTING_NONE,
- max_page_id,
FrameReplicationState(),
false);
controller_->delegate()->RenderFrameForInterstitialPageCreated(
diff --git a/content/browser/frame_host/navigation_controller_delegate.h b/content/browser/frame_host/navigation_controller_delegate.h
index 2a28c22..777599e 100644
--- a/content/browser/frame_host/navigation_controller_delegate.h
+++ b/content/browser/frame_host/navigation_controller_delegate.h
@@ -40,8 +40,6 @@
virtual const std::string& GetContentsMimeType() const = 0;
virtual void NotifyNavigationStateChanged(InvalidateTypes changed_flags) = 0;
virtual void Stop() = 0;
- virtual int32_t GetMaxPageID() = 0;
- virtual int32_t GetMaxPageIDForSiteInstance(SiteInstance* site_instance) = 0;
virtual bool IsBeingDestroyed() const = 0;
virtual bool CanOverscrollContent() const = 0;
@@ -53,10 +51,6 @@
const LoadCommittedDetails& load_details) = 0;
virtual void SetHistoryOffsetAndLength(int history_offset,
int history_length) = 0;
- virtual void CopyMaxPageIDsFrom(WebContents* web_contents) = 0;
- virtual void UpdateMaxPageID(int32_t page_id) = 0;
- virtual void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance,
- int32_t page_id) = 0;
virtual void ActivateAndShowRepostFormWarningDialog() = 0;
virtual bool HasAccessedInitialDocument() = 0;
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 31385c7..5f01194 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -175,7 +175,6 @@
NavigationEntryImpl* entry = new NavigationEntryImpl(
NULL, // The site instance for tabs is sent on navigation
// (WebContents::GetSiteInstance).
- -1,
loaded_url,
referrer,
base::string16(),
@@ -219,7 +218,6 @@
pending_entry_index_(-1),
transient_entry_index_(-1),
delegate_(delegate),
- max_restored_page_id_(-1),
ssl_manager_(this),
needs_reload_(false),
is_initial_navigation_(true),
@@ -366,12 +364,11 @@
DiscardNonCommittedEntriesInternal();
// If we are reloading an entry that no longer belongs to the current
- // site instance (for example, refreshing a page for just installed app),
- // the reload must happen in a new process.
- // The new entry must have a new page_id and site instance, so it behaves
- // as new navigation (which happens to clear forward history).
- // Tabs that are discarded due to low memory conditions may not have a site
- // instance, and should not be treated as a cross-site reload.
+ // SiteInstance (for example, refreshing a page for just installed app), the
+ // reload must happen in a new process. The new entry behaves as new
+ // navigation (which happens to clear forward history). Tabs that are
+ // discarded due to low memory conditions may not have a SiteInstance, and
+ // should not be treated as a cross-site reload.
SiteInstanceImpl* site_instance = entry->site_instance();
// Permit reloading guests without further checks.
bool is_for_guests_only = site_instance && site_instance->HasProcess() &&
@@ -434,13 +431,6 @@
return IsInitialNavigation() && GetEntryCount() == 0;
}
-NavigationEntryImpl* NavigationControllerImpl::GetEntryWithPageID(
- SiteInstance* instance,
- int32_t page_id) const {
- int index = GetEntryIndexWithPageID(instance, page_id);
- return (index != -1) ? entries_[index].get() : nullptr;
-}
-
NavigationEntryImpl*
NavigationControllerImpl::GetEntryWithUniqueID(int nav_entry_id) const {
int index = GetEntryIndexWithUniqueID(nav_entry_id);
@@ -723,7 +713,6 @@
// new FrameNavigationEntry for the target subframe.
if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
entry = GetLastCommittedEntry()->Clone();
- entry->SetPageID(-1);
entry->AddOrUpdateFrameEntry(
node, -1, -1, nullptr,
static_cast<SiteInstanceImpl*>(params.source_site_instance.get()),
@@ -1155,7 +1144,6 @@
if (update_virtual_url)
UpdateVirtualURLToURL(new_entry.get(), params.url);
new_entry->SetReferrer(params.referrer);
- new_entry->SetPageID(params.page_id);
new_entry->SetTransitionType(params.transition);
new_entry->set_site_instance(
static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance()));
@@ -1351,7 +1339,6 @@
new_entry = GetLastCommittedEntry()->Clone();
}
- new_entry->SetPageID(params.page_id);
InsertOrReplaceEntry(std::move(new_entry), replace_entry);
}
@@ -1513,11 +1500,6 @@
FinishRestore(source.last_committed_entry_index_,
RestoreType::CURRENT_SESSION);
-
- // Copy the max page id map from the old tab to the new tab. This ensures
- // that new and existing navigations in the tab's current SiteInstances
- // are identified properly.
- delegate_->CopyMaxPageIDsFrom(source.delegate()->GetWebContents());
}
void NavigationControllerImpl::CopyStateFromAndPrune(
@@ -1560,17 +1542,6 @@
delegate_->SetHistoryOffsetAndLength(last_committed_entry_index_,
GetEntryCount());
-
- // Copy the max page id map from the old tab to the new tab. This ensures that
- // new and existing navigations in the tab's current SiteInstances are
- // identified properly.
- NavigationEntryImpl* last_committed = GetLastCommittedEntry();
- int32_t site_max_page_id =
- delegate_->GetMaxPageIDForSiteInstance(last_committed->site_instance());
- delegate_->CopyMaxPageIDsFrom(source->delegate()->GetWebContents());
- delegate_->UpdateMaxPageIDForSiteInstance(last_committed->site_instance(),
- site_max_page_id);
- max_restored_page_id_ = source->max_restored_page_id_;
}
bool NavigationControllerImpl::CanPruneAllButLastCommitted() {
@@ -1637,14 +1608,6 @@
CHECK(successful_insert) << "Cannot replace existing SessionStorageNamespace";
}
-void NavigationControllerImpl::SetMaxRestoredPageID(int32_t max_id) {
- max_restored_page_id_ = max_id;
-}
-
-int32_t NavigationControllerImpl::GetMaxRestoredPageID() const {
- return max_restored_page_id_;
-}
-
bool NavigationControllerImpl::IsUnmodifiedBlankTab() const {
return IsInitialNavigation() &&
!GetLastCommittedEntry() &&
@@ -1760,12 +1723,7 @@
// When replacing, don't prune the forward history.
if (replace && current_size > 0) {
- int32_t page_id = entry->GetPageID();
-
entries_[last_committed_entry_index_] = std::move(entry);
-
- // This is a new page ID, so we need everybody to know about it.
- delegate_->UpdateMaxPageID(page_id);
return;
}
@@ -1789,12 +1747,8 @@
PruneOldestEntryIfFull();
- int32_t page_id = entry->GetPageID();
entries_.push_back(std::move(entry));
last_committed_entry_index_ = static_cast<int>(entries_.size()) - 1;
-
- // This is a new page ID, so we need everybody to know about it.
- delegate_->UpdateMaxPageID(page_id);
}
void NavigationControllerImpl::PruneOldestEntryIfFull() {
@@ -2055,8 +2009,6 @@
DCHECK(selected_index >= 0 && selected_index < GetEntryCount());
ConfigureEntriesForRestore(&entries_, type);
- SetMaxRestoredPageID(static_cast<int32_t>(GetEntryCount()));
-
last_committed_entry_index_ = selected_index;
}
@@ -2093,16 +2045,6 @@
transient_entry_index_ = -1;
}
-int NavigationControllerImpl::GetEntryIndexWithPageID(SiteInstance* instance,
- int32_t page_id) const {
- for (int i = static_cast<int>(entries_.size()) - 1; i >= 0; --i) {
- if ((entries_[i]->site_instance() == instance) &&
- (entries_[i]->GetPageID() == page_id))
- return i;
- }
- return -1;
-}
-
int NavigationControllerImpl::GetEntryIndexWithUniqueID(
int nav_entry_id) const {
for (int i = static_cast<int>(entries_.size()) - 1; i >= 0; --i) {
diff --git a/content/browser/frame_host/navigation_controller_impl.h b/content/browser/frame_host/navigation_controller_impl.h
index 527fb8f..ee3b325 100644
--- a/content/browser/frame_host/navigation_controller_impl.h
+++ b/content/browser/frame_host/navigation_controller_impl.h
@@ -77,8 +77,6 @@
const SessionStorageNamespaceMap& GetSessionStorageNamespaceMap()
const override;
SessionStorageNamespace* GetDefaultSessionStorageNamespace() override;
- void SetMaxRestoredPageID(int32_t max_id) override;
- int32_t GetMaxRestoredPageID() const override;
bool NeedsReload() const override;
void SetNeedsReload() override;
void CancelPendingReload() override;
@@ -111,18 +109,9 @@
// in this NavigationController.
int GetIndexOfEntry(const NavigationEntryImpl* entry) const;
- // Return the index of the entry with the corresponding instance and page_id,
- // or -1 if not found.
- int GetEntryIndexWithPageID(SiteInstance* instance, int32_t page_id) const;
-
// Return the index of the entry with the given unique id, or -1 if not found.
int GetEntryIndexWithUniqueID(int nav_entry_id) const;
- // Return the entry with the corresponding instance and page_id, or null if
- // not found.
- NavigationEntryImpl* GetEntryWithPageID(SiteInstance* instance,
- int32_t page_id) const;
-
// Return the entry with the given unique id, or null if not found.
NavigationEntryImpl* GetEntryWithUniqueID(int nav_entry_id) const;
@@ -405,11 +394,6 @@
// setup.
NavigationControllerDelegate* delegate_;
- // The max restored page ID in this controller, if it was restored. We must
- // store this so that WebContentsImpl can tell any renderer in charge of one
- // of the restored entries to update its max page ID.
- int32_t max_restored_page_id_;
-
// Manages the SSL security UI.
SSLManager ssl_manager_;
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index 7259036a..aea50a5 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -570,48 +570,6 @@
// will have to suffice.
}
-// Check that we will not trigger a DCHECK in renderer for cross-process
-// replacement navigations.
-// See https://crbug.com/611679.
-IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
- PageIDUpdatedOnPageReplacement) {
- NavigationController& controller = shell()->web_contents()->GetController();
- const GURL page_url = embedded_test_server()->GetURL(
- "/navigation_controller/simple_page_1.html");
-
- // Use a chrome:// url first so that the next page will be loaded
- // in a separate site instance.
- GURL initial_url(std::string(kChromeUIScheme) +
- url::kStandardSchemeSeparator + kChromeUIGpuHost);
- EXPECT_TRUE(NavigateToURL(shell(), initial_url));
- EXPECT_EQ(1, controller.GetEntryCount());
- EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
- int initial_renderer_id =
- shell()->web_contents()->GetRenderProcessHost()->GetID();
-
- // Now navigate and replace the current entry.
- RendererLocationReplace(shell(), page_url);
-
- // Verify that process swap actually occured.
- EXPECT_NE(initial_renderer_id,
- shell()->web_contents()->GetRenderProcessHost()->GetID());
-
- // The navigation entry should have been replaced.
- EXPECT_EQ(1, controller.GetEntryCount());
-
- // Page ID should be updated.
- EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
-
- // Reload the page and verify that we don't hit
- // a DCHECK in |RenderFrameImpl::NavigateInternal|.
- controller.Reload(false);
- EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
-
- // DCHECK shouldn't be triggered and we should have a valid page ID.
- EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
- EXPECT_TRUE(shell()->web_contents()->GetMainFrame()->IsRenderFrameLive());
-}
-
namespace {
class NoNavigationsObserver : public WebContentsObserver {
@@ -3693,7 +3651,6 @@
NavigationControllerImpl::CreateNavigationEntry(
main_url_a, Referrer(), ui::PAGE_TRANSITION_RELOAD, false,
std::string(), controller.GetBrowserContext()));
- restored_entry->SetPageID(0);
EXPECT_EQ(0U, restored_entry->root_node()->children.size());
restored_entry->SetPageState(entry2->GetPageState());
@@ -3776,7 +3733,6 @@
NavigationControllerImpl::CreateNavigationEntry(
main_url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false,
std::string(), controller.GetBrowserContext()));
- restored_entry->SetPageID(0);
restored_entry->SetPageState(PageState::CreateFromURL(main_url));
EXPECT_EQ(0U, restored_entry->root_node()->children.size());
@@ -4352,7 +4308,6 @@
NavigationControllerImpl::CreateNavigationEntry(
main_url_a, Referrer(), ui::PAGE_TRANSITION_RELOAD, false,
std::string(), controller.GetBrowserContext()));
- restored_entry->SetPageID(0);
EXPECT_EQ(0U, restored_entry->root_node()->children.size());
restored_entry->SetPageState(entry2->GetPageState());
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index b115d4f..9086801 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -362,7 +362,7 @@
main_test_rfh()->SendRendererInitiatedNavigationRequest(urls[0], true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, 0, true, urls[0]);
+ main_test_rfh()->SendNavigate(0, true, urls[0]);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(urls[0], controller.GetVisibleEntry()->GetVirtualURL());
@@ -373,7 +373,7 @@
for (int i = 1; i <= 4; ++i) {
main_test_rfh()->SendRendererInitiatedNavigationRequest(urls[i], true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(i, 0, true, urls[i]);
+ main_test_rfh()->SendNavigate(0, true, urls[i]);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(urls[i], controller.GetVisibleEntry()->GetVirtualURL());
@@ -410,7 +410,7 @@
// Check that the GoToOffset will land on the expected page.
EXPECT_EQ(urls[url_index], controller.GetPendingEntry()->GetVirtualURL());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(url_index, entry_id, false, urls[url_index]);
+ main_test_rfh()->SendNavigate(entry_id, false, urls[url_index]);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
// Check that we can go to any valid offset into the history.
@@ -544,7 +544,6 @@
EXPECT_EQ(controller.GetPendingEntry(), controller.GetVisibleEntry());
EXPECT_FALSE(controller.CanGoBack());
EXPECT_FALSE(controller.CanGoForward());
- EXPECT_EQ(contents()->GetMaxPageID(), -1);
// Neither the timestamp nor the status code should have been set yet.
EXPECT_TRUE(controller.GetPendingEntry()->GetTimestamp().is_null());
@@ -554,7 +553,7 @@
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -567,7 +566,6 @@
ASSERT_TRUE(controller.GetVisibleEntry());
EXPECT_FALSE(controller.CanGoBack());
EXPECT_FALSE(controller.CanGoForward());
- EXPECT_EQ(contents()->GetMaxPageID(), 0);
EXPECT_EQ(0, controller.GetLastCommittedEntry()->bindings());
// The timestamp should have been set.
@@ -588,14 +586,13 @@
// TODO(darin): maybe this should really be true?
EXPECT_FALSE(controller.CanGoBack());
EXPECT_FALSE(controller.CanGoForward());
- EXPECT_EQ(contents()->GetMaxPageID(), 0);
EXPECT_TRUE(controller.GetPendingEntry()->GetTimestamp().is_null());
// Simulate the beforeunload ack for the cross-site transition, and then the
// commit.
main_test_rfh()->PrepareForCommit();
- contents()->GetPendingMainFrame()->SendNavigate(1, entry_id, true, url2);
+ contents()->GetPendingMainFrame()->SendNavigate(entry_id, true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -608,7 +605,6 @@
ASSERT_TRUE(controller.GetVisibleEntry());
EXPECT_TRUE(controller.CanGoBack());
EXPECT_FALSE(controller.CanGoForward());
- EXPECT_EQ(contents()->GetMaxPageID(), 1);
EXPECT_FALSE(controller.GetVisibleEntry()->GetTimestamp().is_null());
}
@@ -638,7 +634,7 @@
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -650,7 +646,7 @@
// Simulate the beforeunload ack for the cross-site transition, and then the
// commit.
main_test_rfh()->PrepareForCommit();
- contents()->GetPendingMainFrame()->SendNavigate(1, entry_id, true, url2);
+ contents()->GetPendingMainFrame()->SendNavigate(entry_id, true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -792,7 +788,7 @@
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommit();
main_test_rfh()->SendNavigateWithTransition(
- 0, entry_id, true, url1, ui::PAGE_TRANSITION_TYPED);
+ entry_id, true, url1, ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -807,7 +803,7 @@
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommit();
main_test_rfh()->SendNavigateWithTransition(
- 0, entry_id, false, url1, ui::PAGE_TRANSITION_TYPED);
+ entry_id, false, url1, ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -843,7 +839,6 @@
controller.LoadURL(
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = controller.GetPendingEntry()->GetUniqueID();
params.did_create_new_entry = true;
params.url = url1;
@@ -864,7 +859,7 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
main_test_rfh()->PrepareForCommit();
main_test_rfh()->SendNavigateWithTransition(
- 0, controller.GetPendingEntry()->GetUniqueID(),
+ controller.GetPendingEntry()->GetUniqueID(),
false, url1, ui::PAGE_TRANSITION_TYPED);
// We should not have produced a new session history entry.
@@ -889,7 +884,7 @@
int entry_id = controller.GetPendingEntry()->GetUniqueID();
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -929,13 +924,13 @@
kExistingURL1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, kExistingURL1);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
// Do a new navigation without making a pending one.
const GURL kNewURL("http://see");
- main_test_rfh()->NavigateAndCommitRendererInitiated(99, true, kNewURL);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, kNewURL);
// There should no longer be any pending entry, and the second navigation we
// just made should be committed.
@@ -961,7 +956,7 @@
kExistingURL1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, kExistingURL1);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -978,7 +973,7 @@
const GURL kNewURL("http://see");
main_test_rfh()->SendRendererInitiatedNavigationRequest(kNewURL, true);
main_test_rfh()->PrepareForCommit();
- contents()->GetMainFrame()->SendNavigate(3, 0, true, kNewURL);
+ contents()->GetMainFrame()->SendNavigate(0, true, kNewURL);
// There should no longer be any pending entry, and the third navigation we
// just made should be committed.
@@ -1003,7 +998,7 @@
kExistingURL1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, kExistingURL1);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1012,7 +1007,7 @@
kExistingURL2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, kExistingURL2);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1027,7 +1022,7 @@
const GURL kNewURL("http://foo/see");
main_test_rfh()->SendRendererInitiatedNavigationRequest(kNewURL, true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, 0, true, kNewURL);
+ main_test_rfh()->SendNavigate(0, true, kNewURL);
// There should no longer be any pending entry, and the new navigation we
// just made should be committed.
@@ -1054,7 +1049,7 @@
// Pretend it has bindings so we can tell if we incorrectly copy it.
main_test_rfh()->GetRenderViewHost()->AllowBindings(2);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, kExistingURL1);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1065,7 +1060,7 @@
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
TestRenderFrameHost* foo_rfh = contents()->GetPendingMainFrame();
- foo_rfh->SendNavigate(1, entry_id, true, kExistingURL2);
+ foo_rfh->SendNavigate(entry_id, true, kExistingURL2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1082,7 +1077,7 @@
const GURL kNewURL("http://foo/bee");
foo_rfh->SendRendererInitiatedNavigationRequest(kNewURL, true);
foo_rfh->PrepareForCommit();
- foo_rfh->SendNavigate(3, 0, true, kNewURL);
+ foo_rfh->SendNavigate(0, true, kNewURL);
// There should no longer be any pending entry, and the new navigation we
// just made should be committed.
@@ -1108,7 +1103,7 @@
kExistingURL1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, kExistingURL1);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1117,7 +1112,7 @@
kExistingURL2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, kExistingURL2);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1135,7 +1130,7 @@
// ...and the back navigation commits.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, false, kExistingURL1);
+ main_test_rfh()->SendNavigate(entry_id, false, kExistingURL1);
// There should no longer be any pending entry, and the back navigation should
// be committed.
@@ -1174,10 +1169,10 @@
EXPECT_EQ(1, delegate->navigation_state_change_count());
// Before that commits, a document.write and location.reload can cause the
- // renderer to send a FrameNavigate with page_id -1 and nav_entry_id 0.
+ // renderer to send a FrameNavigate with nav_entry_id 0.
// PlzNavigate: this will stop the old navigation and start a new one.
main_test_rfh()->SendRendererInitiatedNavigationRequest(kExistingURL, true);
- main_test_rfh()->SendNavigate(-1, 0, false, kExistingURL);
+ main_test_rfh()->SendNavigate(0, false, kExistingURL);
// This should clear the pending entry and notify of a navigation state
// change, so that we do not keep displaying kNewURL.
@@ -1256,7 +1251,7 @@
ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, kExistingURL);
+ main_test_rfh()->SendNavigate(entry_id, true, kExistingURL);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1325,7 +1320,7 @@
// Commit.
TestRenderFrameHost* orig_rfh = contents()->GetMainFrame();
orig_rfh->PrepareForCommit();
- orig_rfh->SendNavigate(0, entry1_id, true, url1);
+ orig_rfh->SendNavigate(entry1_id, true, url1);
EXPECT_EQ(controller.GetEntryCount(), 1);
EXPECT_EQ(0, controller.GetLastCommittedEntryIndex());
EXPECT_EQ(0, controller.GetLastCommittedEntry()->bindings());
@@ -1346,7 +1341,7 @@
orig_rfh->PrepareForCommit();
TestRenderFrameHost* new_rfh = contents()->GetPendingMainFrame();
new_rfh->GetRenderViewHost()->AllowBindings(1);
- new_rfh->SendNavigate(1, entry_id, true, url2);
+ new_rfh->SendNavigate(entry_id, true, url2);
// The second load should be committed, and bindings should be remembered.
EXPECT_EQ(controller.GetEntryCount(), 2);
@@ -1357,7 +1352,7 @@
// Going back, the first entry should still appear unprivileged.
controller.GoBack();
new_rfh->PrepareForCommit();
- contents()->GetPendingMainFrame()->SendNavigate(0, entry1_id, false, url1);
+ contents()->GetPendingMainFrame()->SendNavigate(entry1_id, false, url1);
EXPECT_EQ(0, controller.GetLastCommittedEntryIndex());
EXPECT_EQ(0, controller.GetLastCommittedEntry()->bindings());
}
@@ -1374,7 +1369,7 @@
int entry_id = controller.GetPendingEntry()->GetUniqueID();
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
ASSERT_TRUE(controller.GetVisibleEntry());
@@ -1401,7 +1396,7 @@
EXPECT_TRUE(controller.GetVisibleEntry()->GetTitle().empty());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, false, url1);
+ main_test_rfh()->SendNavigate(entry_id, false, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1432,7 +1427,7 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
entry_id = controller.GetLastCommittedEntry()->GetUniqueID();
@@ -1441,7 +1436,7 @@
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommitWithServerRedirect(url2);
- main_test_rfh()->SendNavigate(1, entry_id, true, url2);
+ main_test_rfh()->SendNavigate(entry_id, true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1466,7 +1461,7 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
ASSERT_TRUE(controller.GetVisibleEntry());
// Make the entry believe its RenderProcessHost is a guest.
@@ -1511,7 +1506,7 @@
EXPECT_EQ(0U, notifications.size());
main_test_rfh()->PrepareForCommitWithServerRedirect(final_url);
main_test_rfh()->SendNavigateWithModificationCallback(
- 0, entry_id, true, final_url, set_original_url_callback);
+ entry_id, true, final_url, set_original_url_callback);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
entry_id = controller.GetLastCommittedEntry()->GetUniqueID();
@@ -1544,7 +1539,7 @@
// Send that the navigation has proceeded; say it got redirected again.
main_test_rfh()->PrepareForCommitWithServerRedirect(final_url);
- main_test_rfh()->SendNavigate(0, entry_id, false, final_url);
+ main_test_rfh()->SendNavigate(entry_id, false, final_url);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1572,7 +1567,7 @@
url0, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url0);
+ main_test_rfh()->SendNavigate(entry_id, true, url0);
// Set up the pending entry.
const GURL url1("http://foo/1");
@@ -1601,7 +1596,7 @@
// Fake a commit response.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigateWithReplacement(1, entry_id, true, url1);
+ main_test_rfh()->SendNavigateWithReplacement(entry_id, true, url1);
// Certain values that are only used for pending entries get reset after
// commit.
@@ -1643,7 +1638,7 @@
// Normal navigation will preserve redirects in the committed entry.
main_test_rfh()->PrepareForCommitWithServerRedirect(url2);
- main_test_rfh()->SendNavigateWithModificationCallback(0, entry_id, true, url1,
+ main_test_rfh()->SendNavigateWithModificationCallback(entry_id, true, url1,
set_redirects_callback);
NavigationEntryImpl* committed_entry = controller.GetLastCommittedEntry();
ASSERT_EQ(1U, committed_entry->GetRedirectChain().size());
@@ -1657,12 +1652,12 @@
RegisterForAllNavNotifications(¬ifications, &controller);
const GURL url1("http://foo1");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
const GURL url2("http://foo2");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url2);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1688,7 +1683,7 @@
controller.GetEntryAtIndex(0)->GetTimestamp());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, false, url2);
+ main_test_rfh()->SendNavigate(entry_id, false, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1724,7 +1719,7 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry1_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry1_id, true, url1);
+ main_test_rfh()->SendNavigate(entry1_id, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
entry1_id = controller.GetLastCommittedEntry()->GetUniqueID();
@@ -1733,7 +1728,7 @@
url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, url2);
+ main_test_rfh()->SendNavigate(entry_id, true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1750,7 +1745,7 @@
EXPECT_TRUE(controller.CanGoForward());
main_test_rfh()->PrepareForCommitWithServerRedirect(url3);
- main_test_rfh()->SendNavigate(2, entry1_id, true, url3);
+ main_test_rfh()->SendNavigate(entry1_id, true, url3);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1776,12 +1771,12 @@
const GURL kUrl3("http://foo3");
// First navigate two places so we have some back history.
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, kUrl1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, kUrl1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
// controller.LoadURL(kUrl2, ui::PAGE_TRANSITION_TYPED);
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, kUrl2);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, kUrl2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1809,21 +1804,21 @@
main_test_rfh()->SendRendererInitiatedNavigationRequest(url1, true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, 0, true, url1);
+ main_test_rfh()->SendNavigate(0, true, url1);
NavigationEntry* entry1 = controller.GetLastCommittedEntry();
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
main_test_rfh()->SendRendererInitiatedNavigationRequest(url2, true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, 0, true, url2);
+ main_test_rfh()->SendNavigate(0, true, url2);
NavigationEntry* entry2 = controller.GetLastCommittedEntry();
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
controller.GoBack();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry1->GetUniqueID(), false, url1);
+ main_test_rfh()->SendNavigate(entry1->GetUniqueID(), false, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1848,7 +1843,7 @@
controller.GetEntryAtIndex(1)->GetTimestamp());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry2->GetUniqueID(), false, url2);
+ main_test_rfh()->SendNavigate(entry2->GetUniqueID(), false, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1882,20 +1877,20 @@
main_test_rfh()->SendRendererInitiatedNavigationRequest(url1, true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, 0, true, url1);
+ main_test_rfh()->SendNavigate(0, true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
NavigationEntry* entry1 = controller.GetLastCommittedEntry();
navigation_entry_committed_counter_ = 0;
main_test_rfh()->SendRendererInitiatedNavigationRequest(url2, true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, 0, true, url2);
+ main_test_rfh()->SendNavigate(0, true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
NavigationEntry* entry2 = controller.GetLastCommittedEntry();
navigation_entry_committed_counter_ = 0;
controller.GoBack();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry1->GetUniqueID(), false, url1);
+ main_test_rfh()->SendNavigate(entry1->GetUniqueID(), false, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -1912,7 +1907,7 @@
EXPECT_FALSE(controller.CanGoForward());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, entry2->GetUniqueID(), true, url3);
+ main_test_rfh()->SendNavigate(entry2->GetUniqueID(), true, url3);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_TRUE(notifications.Check1AndReset(NOTIFICATION_NAV_LIST_PRUNED));
@@ -1944,7 +1939,6 @@
EXPECT_EQ(0U, notifications.size());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = entry_id;
params.did_create_new_entry = true;
params.url = url2;
@@ -2012,7 +2006,6 @@
EXPECT_EQ(0U, notifications.size());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = entry_id;
params.did_create_new_entry = true;
params.url = url2;
@@ -2081,7 +2074,6 @@
EXPECT_EQ(url1, controller.GetVisibleEntry()->GetURL());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = entry_id;
params.did_create_new_entry = true;
params.url = url2;
@@ -2134,7 +2126,7 @@
const GURL url2("http://foo2");
// Start with a loaded page.
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(nullptr, controller_impl().GetPendingEntry());
// Start a load of the same page again.
@@ -2150,7 +2142,6 @@
// ... and now the renderer sends a commit for the first navigation.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = entry_id1;
params.intended_as_new_entry = true;
params.did_create_new_entry = false;
@@ -2173,7 +2164,7 @@
RegisterForAllNavNotifications(¬ifications, &controller);
const GURL url1("http://foo1");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -2188,7 +2179,6 @@
const GURL subframe_url("http://foo1/subframe");
{
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = false;
@@ -2215,7 +2205,6 @@
// Now do a new navigation in the frame.
const GURL url2("http://foo2");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 2;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = true;
@@ -2244,7 +2233,6 @@
// New entry should refer to the new page, but the old URL (entries only
// reflect the toplevel URL).
EXPECT_EQ(url1, entry->GetURL());
- EXPECT_EQ(params.page_id, entry->GetPageID());
// Verify subframe entries if they're enabled (e.g. in --site-per-process).
if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
@@ -2266,7 +2254,7 @@
RegisterForAllNavNotifications(¬ifications, &controller);
const GURL url1("http://foo/1");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -2281,7 +2269,6 @@
const GURL url2("http://foo/2");
{
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name0;
params.did_create_new_entry = false;
@@ -2309,7 +2296,6 @@
EXPECT_EQ(1, controller.GetEntryCount());
NavigationEntryImpl* entry = controller.GetLastCommittedEntry();
EXPECT_EQ(url1, entry->GetURL());
- EXPECT_EQ(1, entry->GetPageID());
FrameNavigationEntry* root_entry = entry->root_node()->frame_entry.get();
EXPECT_EQ(url1, root_entry->url());
@@ -2336,7 +2322,6 @@
const GURL url3("http://foo/3");
{
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name1;
params.did_create_new_entry = false;
@@ -2364,7 +2349,6 @@
EXPECT_EQ(1, controller.GetEntryCount());
EXPECT_EQ(entry, controller.GetLastCommittedEntry());
EXPECT_EQ(url1, entry->GetURL());
- EXPECT_EQ(1, entry->GetPageID());
EXPECT_EQ(root_entry, entry->root_node()->frame_entry.get());
EXPECT_EQ(url1, root_entry->url());
@@ -2396,7 +2380,6 @@
const GURL url4("http://foo/4");
{
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name2;
params.did_create_new_entry = false;
@@ -2424,7 +2407,6 @@
EXPECT_EQ(1, controller.GetEntryCount());
EXPECT_EQ(entry, controller.GetLastCommittedEntry());
EXPECT_EQ(url1, entry->GetURL());
- EXPECT_EQ(1, entry->GetPageID());
EXPECT_EQ(root_entry, entry->root_node()->frame_entry.get());
EXPECT_EQ(url1, root_entry->url());
@@ -2450,7 +2432,7 @@
// Main page.
const GURL url1("http://foo1");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
NavigationEntry* entry1 = controller.GetLastCommittedEntry();
navigation_entry_committed_counter_ = 0;
@@ -2471,7 +2453,6 @@
{
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = false;
@@ -2503,7 +2484,6 @@
int64_t item_sequence_number2 = GenerateSequenceNumber();
int64_t document_sequence_number2 = GenerateSequenceNumber();
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 2;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = true;
@@ -2541,7 +2521,6 @@
const GURL url3("http://foo3");
int64_t item_sequence_number3 = GenerateSequenceNumber();
int64_t document_sequence_number3 = GenerateSequenceNumber();
- params.page_id = 3;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = true;
@@ -2572,7 +2551,6 @@
// Go back one.
controller.GoBack();
- params.page_id = 2;
params.nav_entry_id = entry2->GetUniqueID();
params.frame_unique_name = unique_name;
params.did_create_new_entry = false;
@@ -2594,7 +2572,6 @@
// Go back one more.
controller.GoBack();
- params.page_id = 1;
params.nav_entry_id = entry1->GetUniqueID();
params.frame_unique_name = unique_name;
params.did_create_new_entry = false;
@@ -2623,11 +2600,11 @@
const GURL url1("http://foo1");
const GURL url2("http://foo2");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url2);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -2648,14 +2625,13 @@
// Main page.
const GURL url1("http://foo");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
// Ensure main page navigation to same url respects the was_within_same_page
// hint provided in the params.
FrameHostMsg_DidCommitProvisionalLoad_Params self_params;
- self_params.page_id = 0;
self_params.nav_entry_id = 0;
self_params.did_create_new_entry = false;
self_params.url = url1;
@@ -2677,10 +2653,9 @@
EXPECT_TRUE(observer.details().did_replace_entry);
EXPECT_EQ(1, controller.GetEntryCount());
- // Fragment navigation to a new page_id.
+ // Fragment navigation to a new page.
const GURL url2("http://foo#a");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = url2;
@@ -2706,7 +2681,6 @@
FrameHostMsg_DidCommitProvisionalLoad_Params back_params(params);
controller.GoBack();
back_params.url = url1;
- back_params.page_id = 0;
back_params.nav_entry_id = entry1->GetUniqueID();
back_params.did_create_new_entry = false;
main_test_rfh()->PrepareForCommit();
@@ -2722,7 +2696,6 @@
FrameHostMsg_DidCommitProvisionalLoad_Params forward_params(params);
controller.GoForward();
forward_params.url = url2;
- forward_params.page_id = 1;
forward_params.nav_entry_id = entry2->GetUniqueID();
forward_params.did_create_new_entry = false;
main_test_rfh()->PrepareForCommit();
@@ -2750,7 +2723,6 @@
// Finally, navigate to an unrelated URL to make sure in_page is not sticky.
const GURL url3("http://bar");
- params.page_id = 2;
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = url3;
@@ -2772,14 +2744,13 @@
// Main page.
const GURL url1("http://foo");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
// First navigation.
const GURL url2("http://foo#a");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0; // Same page_id
params.nav_entry_id = 0;
params.did_create_new_entry = false;
params.url = url2;
@@ -2816,7 +2787,7 @@
// Load an initial page.
{
const GURL url("http://foo/");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
}
@@ -2824,7 +2795,7 @@
// Navigate to a new page.
{
const GURL url("http://foo2/");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
}
@@ -2833,7 +2804,6 @@
{
const GURL url("http://foo2/#a");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1; // Same page_id
params.nav_entry_id = 0;
params.did_create_new_entry = false;
params.url = url;
@@ -2861,7 +2831,6 @@
{
const GURL url("http://foo3/");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 2; // New page_id
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = url;
@@ -2890,7 +2859,7 @@
controller.GoBack();
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, false, url);
+ main_test_rfh()->SendNavigate(entry_id, false, url);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL());
@@ -2902,7 +2871,6 @@
ASSERT_FALSE(controller_impl().GetLastCommittedEntry());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
GURL url("http://foo");
- params.page_id = 1;
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = url;
@@ -2961,7 +2929,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(url_index, entry_id, true, url);
+ main_test_rfh()->SendNavigate(entry_id, true, url);
}
EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount);
@@ -2975,7 +2943,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(url_index, entry_id, true, url);
+ main_test_rfh()->SendNavigate(entry_id, true, url);
url_index++;
// We should have got a pruned navigation.
@@ -2995,7 +2963,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(url_index, entry_id, true, url);
+ main_test_rfh()->SendNavigate(entry_id, true, url);
url_index++;
}
EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount);
@@ -3016,7 +2984,6 @@
NavigationControllerImpl::CreateNavigationEntry(
url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(),
browser_context());
- entry->SetPageID(0);
entry->SetTitle(base::ASCIIToUTF16("Title"));
entry->SetPageState(PageState::CreateFromEncodedData("state"));
const base::Time timestamp = base::Time::Now();
@@ -3040,14 +3007,12 @@
EXPECT_EQ(1, our_controller.GetEntryCount());
EXPECT_EQ(our_controller.GetEntryAtIndex(0),
our_controller.GetPendingEntry());
- EXPECT_EQ(0, our_controller.GetEntryAtIndex(0)->GetPageID());
// Timestamp should remain the same before the navigation finishes.
EXPECT_EQ(timestamp, our_controller.GetEntryAtIndex(0)->GetTimestamp());
// Say we navigated to that entry.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = our_controller.GetPendingEntry()->GetUniqueID();
params.did_create_new_entry = false;
params.url = url;
@@ -3087,7 +3052,6 @@
NavigationControllerImpl::CreateNavigationEntry(
url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(),
browser_context());
- new_entry->SetPageID(0);
new_entry->SetTitle(base::ASCIIToUTF16("Title"));
new_entry->SetPageState(PageState::CreateFromEncodedData("state"));
entries.push_back(std::move(new_entry));
@@ -3113,7 +3077,6 @@
EXPECT_EQ(1, our_controller.GetEntryCount());
EXPECT_EQ(our_controller.GetEntryAtIndex(0),
our_controller.GetPendingEntry());
- EXPECT_EQ(0, our_controller.GetEntryAtIndex(0)->GetPageID());
// This pending navigation may have caused a different navigation to fail,
// which causes the pending entry to be cleared.
@@ -3129,7 +3092,6 @@
// Now the pending restored entry commits.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = entry->GetUniqueID();
params.did_create_new_entry = false;
params.url = url;
@@ -3163,7 +3125,7 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
// Now navigate somewhere with an interstitial.
const GURL url2("http://bar");
@@ -3175,7 +3137,7 @@
// At this point the interstitial will be displayed and the load will still
// be pending. If the user continues, the load will commit.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, url2);
+ main_test_rfh()->SendNavigate(entry_id, true, url2);
// The page should be a normal page again.
EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetURL());
@@ -3197,27 +3159,27 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
controller.LoadURL(
url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, url2);
+ main_test_rfh()->SendNavigate(entry_id, true, url2);
controller.LoadURL(
url3, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, entry_id, true, url3);
+ main_test_rfh()->SendNavigate(entry_id, true, url3);
controller.LoadURL(
url4, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, entry_id, true, url4);
+ main_test_rfh()->SendNavigate(entry_id, true, url4);
controller.LoadURL(
url5, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(4, entry_id, true, url5);
+ main_test_rfh()->SendNavigate(entry_id, true, url5);
// Try to remove the last entry. Will fail because it is the current entry.
EXPECT_FALSE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
@@ -3233,7 +3195,7 @@
// Now commit and delete the last entry.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, entry_id, false, url4);
+ main_test_rfh()->SendNavigate(entry_id, false, url4);
EXPECT_TRUE(controller.RemoveEntryAtIndex(controller.GetEntryCount() - 1));
EXPECT_EQ(4, controller.GetEntryCount());
EXPECT_EQ(3, controller.GetLastCommittedEntryIndex());
@@ -3265,17 +3227,17 @@
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
controller.LoadURL(
url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, url2);
+ main_test_rfh()->SendNavigate(entry_id, true, url2);
controller.LoadURL(
url3, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, entry_id, true, url3);
+ main_test_rfh()->SendNavigate(entry_id, true, url3);
// Go back, but don't commit yet. Check that we can't delete the current
// and pending entries.
@@ -3295,7 +3257,7 @@
// Now commit and ensure we land on the right entry.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, false, url2);
+ main_test_rfh()->SendNavigate(entry_id, false, url2);
EXPECT_EQ(2, controller.GetEntryCount());
EXPECT_EQ(0, controller.GetLastCommittedEntryIndex());
EXPECT_FALSE(controller.GetPendingEntry());
@@ -3319,12 +3281,12 @@
url0, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url0);
+ main_test_rfh()->SendNavigate(entry_id, true, url0);
controller.LoadURL(
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
notifications.Reset();
@@ -3345,14 +3307,13 @@
EXPECT_FALSE(controller.GetPendingEntry());
EXPECT_TRUE(controller.CanGoBack());
EXPECT_FALSE(controller.CanGoForward());
- EXPECT_EQ(contents()->GetMaxPageID(), 1);
// Navigate.
controller.LoadURL(
url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, entry_id, true, url2);
+ main_test_rfh()->SendNavigate(entry_id, true, url2);
// We should have navigated, transient entry should be gone.
EXPECT_EQ(url2, controller.GetVisibleEntry()->GetURL());
@@ -3365,7 +3326,7 @@
EXPECT_EQ(transient_url, controller.GetVisibleEntry()->GetURL());
main_test_rfh()->SendRendererInitiatedNavigationRequest(url3, true);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, 0, true, url3);
+ main_test_rfh()->SendNavigate(0, true, url3);
// Transient entry should be gone.
EXPECT_EQ(url3, controller.GetVisibleEntry()->GetURL());
EXPECT_EQ(controller.GetEntryCount(), 4);
@@ -3379,7 +3340,7 @@
controller.SetTransientEntry(std::move(transient_entry));
EXPECT_EQ(transient_url, controller.GetVisibleEntry()->GetURL());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(4, entry_id, true, url4);
+ main_test_rfh()->SendNavigate(entry_id, true, url4);
EXPECT_EQ(url4, controller.GetVisibleEntry()->GetURL());
EXPECT_EQ(controller.GetEntryCount(), 5);
@@ -3399,7 +3360,7 @@
controller.GoToOffset(-1);
entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, entry_id, false, url3);
+ main_test_rfh()->SendNavigate(entry_id, false, url3);
// Add a transient and go to an entry before the current one.
transient_entry.reset(new NavigationEntryImpl);
@@ -3414,7 +3375,7 @@
// Visible entry does not update for history navigations until commit.
EXPECT_EQ(url3, controller.GetVisibleEntry()->GetURL());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, false, url1);
+ main_test_rfh()->SendNavigate(entry_id, false, url1);
EXPECT_EQ(url1, controller.GetVisibleEntry()->GetURL());
// Add a transient and go to an entry after the current one.
@@ -3430,7 +3391,7 @@
EXPECT_EQ(url2, controller.GetPendingEntry()->GetURL());
EXPECT_EQ(url1, controller.GetVisibleEntry()->GetURL());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, entry_id, false, url2);
+ main_test_rfh()->SendNavigate(entry_id, false, url2);
EXPECT_EQ(url2, controller.GetVisibleEntry()->GetURL());
// Add a transient and go forward.
@@ -3446,7 +3407,7 @@
EXPECT_EQ(url3, controller.GetPendingEntry()->GetURL());
EXPECT_EQ(url2, controller.GetVisibleEntry()->GetURL());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, entry_id, false, url3);
+ main_test_rfh()->SendNavigate(entry_id, false, url3);
EXPECT_EQ(url3, controller.GetVisibleEntry()->GetURL());
// Add a transient and do an in-page navigation, replacing the current entry.
@@ -3457,7 +3418,7 @@
main_test_rfh()->SendRendererInitiatedNavigationRequest(url3_ref, false);
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(3, 0, false, url3_ref);
+ main_test_rfh()->SendNavigate(0, false, url3_ref);
// Transient entry should be gone.
EXPECT_FALSE(controller.GetTransientEntry());
EXPECT_EQ(url3_ref, controller.GetVisibleEntry()->GetURL());
@@ -3483,7 +3444,7 @@
url0, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller.GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url0);
+ main_test_rfh()->SendNavigate(entry_id, true, url0);
controller.LoadURL(
url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
@@ -3507,7 +3468,7 @@
// Load of |transient_url| completes.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, transient_url);
+ main_test_rfh()->SendNavigate(entry_id, true, transient_url);
ASSERT_EQ(controller.GetEntryCount(), 2);
EXPECT_EQ(controller.GetEntryAtIndex(0)->GetURL(), url0);
EXPECT_EQ(controller.GetEntryAtIndex(1)->GetURL(), transient_url);
@@ -3550,7 +3511,7 @@
EXPECT_EQ(url2, controller.GetPendingEntry()->GetVirtualURL());
// Once it commits, the URL and virtual URL should reflect the actual page.
- main_test_rfh()->SendNavigate(0, 0, true, url2);
+ main_test_rfh()->SendNavigate(0, true, url2);
EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetURL());
EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetVirtualURL());
@@ -3573,7 +3534,7 @@
navigator->DidStartProvisionalLoad(main_test_rfh(), url2,
base::TimeTicks::Now());
EXPECT_TRUE(controller.GetPendingEntry()->should_replace_entry());
- main_test_rfh()->SendNavigateWithReplacement(0, 0, false, url2);
+ main_test_rfh()->SendNavigateWithReplacement(0, false, url2);
EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetURL());
}
@@ -3596,7 +3557,7 @@
EXPECT_EQ(url0, controller.GetPendingEntry()->GetURL());
EXPECT_EQ(url0, controller.GetVisibleEntry()->GetURL());
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url0);
+ main_test_rfh()->SendNavigate(entry_id, true, url0);
// For link clicks (renderer-initiated navigations), the pending entry should
// update before commit but the visible should not.
@@ -3611,7 +3572,7 @@
// After commit, both visible should be updated, there should be no pending
// entry, and we should no longer treat the entry as renderer-initiated.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(1, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
EXPECT_EQ(url1, controller.GetVisibleEntry()->GetURL());
EXPECT_FALSE(controller.GetPendingEntry());
EXPECT_FALSE(controller.GetLastCommittedEntry()->is_renderer_initiated());
@@ -3782,7 +3743,7 @@
// Simulate a commit and then starting a new pending navigation.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(0, entry_id, true, url1);
+ main_test_rfh()->SendNavigate(entry_id, true, url1);
NavigationController::LoadURLParams load_url2_params(url2);
load_url2_params.transition_type = ui::PAGE_TRANSITION_LINK;
load_url2_params.is_renderer_initiated = true;
@@ -3815,12 +3776,12 @@
// matches if the URL doesn't look same-origin.
const GURL blank_url(url::kAboutBlankURL);
const url::Origin blank_origin;
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, blank_url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, blank_url);
EXPECT_TRUE(controller.IsURLInPageNavigation(url, url::Origin(url), true,
main_test_rfh()));
// Navigate to URL with no refs.
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, false, url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(false, url);
// Reloading the page is not an in-page navigation.
EXPECT_FALSE(controller.IsURLInPageNavigation(url, url::Origin(url), false,
@@ -3833,7 +3794,7 @@
url_with_ref, url::Origin(url_with_ref), true, main_test_rfh()));
// Navigate to URL with refs.
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url_with_ref);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url_with_ref);
// Reloading the page is not an in-page navigation.
EXPECT_FALSE(controller.IsURLInPageNavigation(
@@ -3890,7 +3851,7 @@
// Allow in page navigation to be cross-origin if existing URL is file scheme.
const GURL file_url("file:///foo/index.html");
const url::Origin file_origin(file_url);
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, file_url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, file_url);
EXPECT_TRUE(file_origin.IsSameOriginWith(
main_test_rfh()->frame_tree_node()->current_origin()));
EXPECT_EQ(0, rph->bad_msg_count());
@@ -3901,7 +3862,6 @@
// Doing a replaceState to a cross-origin URL is thus allowed.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 1;
params.did_create_new_entry = false;
params.url = different_origin_url;
@@ -3928,7 +3888,7 @@
// Don't honor allow_universal_access_from_file_urls if actual URL is
// not file scheme.
const GURL url("http://www.google.com/home.html");
- main_test_rfh()->NavigateAndCommitRendererInitiated(2, true, url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url);
EXPECT_FALSE(controller.IsURLInPageNavigation(
different_origin_url, url::Origin(different_origin_url), true,
main_test_rfh()));
@@ -3943,7 +3903,7 @@
NavigationControllerImpl& controller = controller_impl();
// Navigate the main frame.
const GURL url("http://www.google.com/");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url);
// We should be at the first navigation entry.
EXPECT_EQ(controller.GetEntryCount(), 1);
@@ -3959,7 +3919,6 @@
contents()->GetFrameTree()->root()->child_at(0)->current_frame_host());
const GURL subframe_url("http://www.google.com/#");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = false;
@@ -4135,7 +4094,6 @@
contents()->GetFrameTree()->root()->child_at(0)->current_frame_host());
const GURL url1_sub("http://foo/subframe");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = controller.GetLastCommittedEntry()->GetPageID();
params.nav_entry_id = 0;
params.frame_unique_name = unique_name;
params.did_create_new_entry = false;
@@ -4181,16 +4139,7 @@
ASSERT_EQ(0, other_controller.GetCurrentEntryIndex());
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(0)->GetPageID());
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->GetURL());
- // This is a different site than url1, so the IDs start again at 0.
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(1)->GetPageID());
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(0)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
// Ensure the SessionStorageNamespaceMaps are the same size and have
// the same partitons loaded.
@@ -4227,9 +4176,6 @@
SiteInstance* instance1 = controller.GetEntryAtIndex(0)->site_instance();
SiteInstance* instance2 = controller.GetEntryAtIndex(1)->site_instance();
EXPECT_EQ(instance1, instance2);
- EXPECT_EQ(0, controller.GetEntryAtIndex(0)->GetPageID());
- EXPECT_EQ(1, controller.GetEntryAtIndex(1)->GetPageID());
- EXPECT_EQ(1, contents()->GetMaxPageIDForSiteInstance(instance1));
std::unique_ptr<TestWebContents> other_contents(
static_cast<TestWebContents*>(CreateTestWebContents()));
@@ -4247,9 +4193,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->GetURL());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(2)->GetURL());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(0)->GetPageID());
- EXPECT_EQ(1, other_controller.GetEntryAtIndex(1)->GetPageID());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(2)->GetPageID());
// A new SiteInstance in a different BrowsingInstance should be used for the
// new tab.
@@ -4257,11 +4200,6 @@
other_controller.GetEntryAtIndex(2)->site_instance();
EXPECT_NE(instance3, instance1);
EXPECT_FALSE(instance3->IsRelatedSiteInstance(instance1));
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- EXPECT_EQ(1, other_contents->GetMaxPageIDForSiteInstance(instance1));
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance3));
}
// Test CopyStateFromAndPrune with 2 urls, the first selected and 1 entry in
@@ -4291,13 +4229,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(1)->GetURL());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(1)->GetPageID());
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(1)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
}
// Test CopyStateFromAndPrune with 2 urls, the last selected and 2 entries in
@@ -4328,12 +4259,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->GetURL());
EXPECT_EQ(url4, other_controller.GetEntryAtIndex(2)->GetURL());
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(2)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
}
// Test CopyStateFromAndPrune with 2 urls, 2 entries in the target, with
@@ -4366,12 +4291,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->GetURL());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(2)->GetURL());
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(2)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
}
// Test CopyStateFromAndPrune with 2 urls, the first selected and 1 entry plus
@@ -4409,18 +4328,11 @@
// And there should be a pending entry for url4.
ASSERT_TRUE(other_controller.GetPendingEntry());
EXPECT_EQ(url4, other_controller.GetPendingEntry()->GetURL());
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(0)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
}
// Test CopyStateFromAndPrune with 1 url in the source, 1 entry and a pending
-// client redirect entry (with the same page ID) in the target. This used to
-// crash because the last committed entry would be pruned but max_page_id
-// remembered the page ID (http://crbug.com/234809).
+// client redirect entry in the target. This used to crash
+// (http://crbug.com/234809).
TEST_F(NavigationControllerTest, CopyStateFromAndPruneTargetPending2) {
NavigationControllerImpl& controller = controller_impl();
const GURL url1("http://foo1");
@@ -4436,8 +4348,6 @@
// Simulate a client redirect, which has the same page ID as entry 2a.
other_controller.LoadURL(
url2b, Referrer(), ui::PAGE_TRANSITION_LINK, std::string());
- NavigationEntry* entry = other_controller.GetPendingEntry();
- entry->SetPageID(other_controller.GetLastCommittedEntry()->GetPageID());
other_contents->ExpectSetHistoryOffsetAndLength(1, 2);
other_controller.CopyStateFromAndPrune(&controller, false);
@@ -4457,14 +4367,7 @@
// Let the pending entry commit.
other_contents->TestDidNavigate(other_contents->GetMainFrame(),
- entry->GetPageID(), 0, false, url2b,
- ui::PAGE_TRANSITION_LINK);
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(1)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
+ 0, false, url2b, ui::PAGE_TRANSITION_LINK);
}
// Test CopyStateFromAndPrune with 2 urls, a back navigation pending in the
@@ -4494,13 +4397,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->GetURL());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(2)->GetURL());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(2)->GetPageID());
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- SiteInstance* instance1 =
- other_controller.GetEntryAtIndex(2)->site_instance();
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance1));
}
// Tests CopyStateFromAndPrune with 3 urls in source, 1 in dest,
@@ -4545,9 +4441,6 @@
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(1)->GetURL());
EXPECT_EQ(url4, other_controller.GetEntryAtIndex(2)->GetURL());
- EXPECT_EQ(1, other_controller.GetEntryAtIndex(0)->GetPageID());
- EXPECT_EQ(2, other_controller.GetEntryAtIndex(1)->GetPageID());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(2)->GetPageID());
NavigationControllerImpl::set_max_entry_count_for_testing(original_count);
}
@@ -4567,9 +4460,6 @@
SiteInstance* instance1 = controller.GetEntryAtIndex(0)->site_instance();
SiteInstance* instance2 = controller.GetEntryAtIndex(1)->site_instance();
EXPECT_EQ(instance1, instance2);
- EXPECT_EQ(0, controller.GetEntryAtIndex(0)->GetPageID());
- EXPECT_EQ(1, controller.GetEntryAtIndex(1)->GetPageID());
- EXPECT_EQ(1, contents()->GetMaxPageIDForSiteInstance(instance1));
std::unique_ptr<TestWebContents> other_contents(
static_cast<TestWebContents*>(CreateTestWebContents()));
@@ -4586,8 +4476,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(1)->GetURL());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(0)->GetPageID());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(1)->GetPageID());
// A new SiteInstance in a different BrowsingInstance should be used for the
// new tab.
@@ -4595,11 +4483,6 @@
other_controller.GetEntryAtIndex(1)->site_instance();
EXPECT_NE(instance3, instance1);
EXPECT_FALSE(instance3->IsRelatedSiteInstance(instance1));
-
- // The max page ID map should be copied over and updated with the max page ID
- // from the current tab.
- EXPECT_EQ(1, other_contents->GetMaxPageIDForSiteInstance(instance1));
- EXPECT_EQ(0, other_contents->GetMaxPageIDForSiteInstance(instance3));
}
// Tests CopyStateFromAndPrune with 3 urls in source, 1 in dest, when the max
@@ -4642,9 +4525,6 @@
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->GetURL());
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->GetURL());
EXPECT_EQ(url4, other_controller.GetEntryAtIndex(2)->GetURL());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(0)->GetPageID());
- EXPECT_EQ(1, other_controller.GetEntryAtIndex(1)->GetPageID());
- EXPECT_EQ(0, other_controller.GetEntryAtIndex(2)->GetPageID());
NavigationControllerImpl::set_max_entry_count_for_testing(original_count);
}
@@ -4664,7 +4544,6 @@
NavigationControllerImpl::CreateNavigationEntry(
kRestoredUrls[i], Referrer(), ui::PAGE_TRANSITION_RELOAD, false,
std::string(), browser_context());
- entry->SetPageID(static_cast<int>(i));
entries.push_back(std::move(entry));
}
@@ -4835,7 +4714,7 @@
// Try to commit the pending entry.
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, entry_id, true, url3);
+ main_test_rfh()->SendNavigate(entry_id, true, url3);
EXPECT_EQ(-1, controller.GetPendingEntryIndex());
EXPECT_FALSE(controller.GetPendingEntry());
EXPECT_EQ(2, controller.GetEntryCount());
@@ -4878,7 +4757,7 @@
// After commit, it stays false.
const GURL url1("http://foo1");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_FALSE(controller.IsInitialNavigation());
@@ -4910,8 +4789,7 @@
TestNotificationTracker notifications;
RegisterForAllNavNotifications(¬ifications, &controller);
- main_test_rfh()->NavigateAndCommitRendererInitiated(
- 0, true, kPageWithFavicon);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, kPageWithFavicon);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -4930,7 +4808,6 @@
false);
main_test_rfh()->PrepareForCommit();
main_test_rfh()->SendNavigateWithTransition(
- 0, // same page ID.
0, // nav_entry_id
false, // no new entry
kPageWithoutFavicon, ui::PAGE_TRANSITION_CLIENT_REDIRECT);
@@ -4955,7 +4832,7 @@
TestNotificationTracker notifications;
RegisterForAllNavNotifications(¬ifications, &controller);
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, kUrl1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, kUrl1);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -4969,13 +4846,13 @@
favicon_status.valid = true;
// Navigate to another page and go back to the original page.
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, kUrl2);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, kUrl2);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
main_test_rfh()->SendRendererInitiatedNavigationRequest(kUrl1, false);
main_test_rfh()->PrepareForCommit();
main_test_rfh()->SendNavigateWithTransition(
- 0, controller.GetEntryAtIndex(0)->GetUniqueID(), false, kUrl1,
+ controller.GetEntryAtIndex(0)->GetUniqueID(), false, kUrl1,
ui::PAGE_TRANSITION_FORWARD_BACK);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
@@ -5076,8 +4953,7 @@
TEST_F(NavigationControllerTest, PushStateUpdatesTitleAndFavicon) {
// Navigate.
- main_test_rfh()->NavigateAndCommitRendererInitiated(
- 1, true, GURL("http://foo"));
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, GURL("http://foo"));
// Set title and favicon.
base::string16 title(base::ASCIIToUTF16("Title"));
@@ -5091,7 +4967,6 @@
// history.pushState() is called.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
GURL kUrl2("http://foo#foo");
- params.page_id = 2;
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = kUrl2;
@@ -5170,7 +5045,6 @@
// Submit a form.
GURL url("http://foo");
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = url;
@@ -5186,7 +5060,6 @@
// history.replaceState() is called.
GURL replace_url("http://foo#foo");
- params.page_id = 1;
params.nav_entry_id = 0;
params.did_create_new_entry = false;
params.url = replace_url;
@@ -5211,7 +5084,6 @@
controller().LoadURL(url, Referrer(), ui::PAGE_TRANSITION_TYPED,
std::string());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = url;
@@ -5286,7 +5158,7 @@
// Start on page A.
const GURL url_a("http://foo.com/a");
- main_test_rfh()->NavigateAndCommitRendererInitiated(0, true, url_a);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url_a);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(1, controller.GetEntryCount());
@@ -5294,13 +5166,12 @@
// Go to page B.
const GURL url_b("http://foo.com/b");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url_b);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url_b);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(2, controller.GetEntryCount());
EXPECT_EQ(1, controller.GetCurrentEntryIndex());
int b_entry_id = controller.GetLastCommittedEntry()->GetUniqueID();
- int b_page_id = controller.GetLastCommittedEntry()->GetPageID();
// Back to page A.
controller.GoBack();
@@ -5315,7 +5186,7 @@
// But the renderer unilaterally navigates to page C, pruning B.
const GURL url_c("http://foo.com/c");
- main_test_rfh()->NavigateAndCommitRendererInitiated(2, true, url_c);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url_c);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
EXPECT_EQ(2, controller.GetEntryCount());
@@ -5324,7 +5195,7 @@
EXPECT_NE(c_entry_id, b_entry_id);
// And then the navigation to B gets committed.
- main_test_rfh()->SendNavigate(b_page_id, b_entry_id, false, url_b);
+ main_test_rfh()->SendNavigate(b_entry_id, false, url_b);
EXPECT_EQ(1U, navigation_entry_committed_counter_);
navigation_entry_committed_counter_ = 0;
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 28f9b2ee..a82f157e 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -224,13 +224,12 @@
}
NavigationEntryImpl::NavigationEntryImpl()
- : NavigationEntryImpl(nullptr, -1, GURL(), Referrer(), base::string16(),
+ : NavigationEntryImpl(nullptr, GURL(), Referrer(), base::string16(),
ui::PAGE_TRANSITION_LINK, false) {
}
NavigationEntryImpl::NavigationEntryImpl(
scoped_refptr<SiteInstanceImpl> instance,
- int page_id,
const GURL& url,
const Referrer& referrer,
const base::string16& title,
@@ -251,7 +250,6 @@
page_type_(PAGE_TYPE_NORMAL),
update_virtual_url_with_url_(false),
title_(title),
- page_id_(page_id),
transition_type_(transition_type),
restore_type_(RestoreType::NONE),
is_overriding_user_agent_(false),
@@ -389,14 +387,6 @@
return PageState::CreateFromEncodedData(encoded_data);
}
-void NavigationEntryImpl::SetPageID(int page_id) {
- page_id_ = page_id;
-}
-
-int32_t NavigationEntryImpl::GetPageID() const {
- return page_id_;
-}
-
void NavigationEntryImpl::set_site_instance(
scoped_refptr<SiteInstanceImpl> site_instance) {
// TODO(creis): Update all callers and remove this method.
@@ -627,7 +617,6 @@
copy->update_virtual_url_with_url_ = update_virtual_url_with_url_;
copy->title_ = title_;
copy->favicon_ = favicon_;
- copy->page_id_ = page_id_;
copy->ssl_ = ssl_;
copy->transition_type_ = transition_type_;
copy->user_typed_url_ = user_typed_url_;
@@ -734,7 +723,7 @@
#endif
RequestNavigationParams request_params(
GetIsOverridingUserAgent(), redirects, GetCanLoadLocalResources(),
- base::Time::Now(), frame_entry.page_state(), GetPageID(), GetUniqueID(),
+ base::Time::Now(), frame_entry.page_state(), GetUniqueID(),
is_same_document_history_load, is_history_navigation_in_new_child,
subframe_unique_names, has_committed_real_load, intended_as_new_entry,
pending_offset_to_send, current_offset_to_send, current_length_to_send,
@@ -793,14 +782,6 @@
const PageState& page_state,
const std::string& method,
int64_t post_id) {
- // We should only have an empty PageState if the navigation is new, and thus
- // page ID is -1.
- if (!page_state.IsValid() && GetPageID() != -1) {
- // Temporarily generate a minidump to diagnose https://crbug.com/568703.
- base::debug::DumpWithoutCrashing();
- NOTREACHED() << "Shouldn't set an empty PageState.";
- }
-
// If this is called for the main frame, the FrameNavigationEntry is
// guaranteed to exist, so just update it directly and return.
if (frame_tree_node->IsMainFrame()) {
diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h
index 0e5a52c..ec238de7 100644
--- a/content/browser/frame_host/navigation_entry_impl.h
+++ b/content/browser/frame_host/navigation_entry_impl.h
@@ -85,7 +85,6 @@
NavigationEntryImpl();
NavigationEntryImpl(scoped_refptr<SiteInstanceImpl> instance,
- int page_id,
const GURL& url,
const Referrer& referrer,
const base::string16& title,
@@ -114,8 +113,6 @@
const base::string16& GetTitle() const override;
void SetPageState(const PageState& state) override;
PageState GetPageState() const override;
- void SetPageID(int page_id) override;
- int32_t GetPageID() const override;
const base::string16& GetTitleForDisplay() const override;
bool IsViewSourceMode() const override;
void SetTransitionType(ui::PageTransition transition_type) override;
@@ -435,7 +432,6 @@
bool update_virtual_url_with_url_;
base::string16 title_;
FaviconStatus favicon_;
- int32_t page_id_;
SSLStatus ssl_;
ui::PageTransition transition_type_;
GURL user_typed_url_;
diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc
index 2aca5e1e..e47fab03 100644
--- a/content/browser/frame_host/navigation_entry_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc
@@ -26,7 +26,7 @@
instance_ = SiteInstanceImpl::Create(NULL);
entry2_.reset(new NavigationEntryImpl(
- instance_, 3,
+ instance_,
GURL("test:url"),
Referrer(GURL("from"), blink::WebReferrerPolicyDefault),
ASCIIToUTF16("title"),
@@ -180,12 +180,6 @@
entry2_->SetPageState(PageState::CreateFromEncodedData("state"));
EXPECT_EQ("state", entry2_->GetPageState().ToEncodedData());
- // Page ID
- EXPECT_EQ(-1, entry1_->GetPageID());
- EXPECT_EQ(3, entry2_->GetPageID());
- entry2_->SetPageID(2);
- EXPECT_EQ(2, entry2_->GetPageID());
-
// Transition type
EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs(
entry1_->GetTransitionType(), ui::PAGE_TRANSITION_LINK));
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index b0cb428..26bcc63 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -349,7 +349,6 @@
void NavigationHandleImpl::CallDidCommitNavigationForTesting(const GURL& url) {
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 1;
params.nav_entry_id = 1;
params.url = url;
params.referrer = content::Referrer();
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index f6da2a7..c13a7e7 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -185,7 +185,6 @@
false, // can_load_local_resources
base::Time::Now(), // request_time
PageState(), // page_state
- -1, // page_id
0, // nav_entry_id
false, // is_same_document_history_load
false, // is_history_navigation_in_new_child
diff --git a/content/browser/frame_host/navigator.h b/content/browser/frame_host/navigator.h
index 82ea741..3424428f 100644
--- a/content/browser/frame_host/navigator.h
+++ b/content/browser/frame_host/navigator.h
@@ -82,9 +82,6 @@
// back with RendererDidNavigate on success or DiscardPendingEntry on failure.
// The callbacks can be inside of this function, or at some future time.
//
- // The entry has a PageID of -1 if newly created (corresponding to navigation
- // to a new URL).
- //
// If this method returns false, then the navigation is discarded (equivalent
// to calling DiscardPendingEntry on the NavigationController).
//
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 531e06b0..6753663 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -843,7 +843,6 @@
if (controller_->GetLastCommittedEntry()) {
entry = controller_->GetLastCommittedEntry()->Clone();
entry->set_extra_headers(extra_headers);
- entry->SetPageID(-1);
} else {
// If there's no last committed entry, create an entry for about:blank
// with a subframe entry for our destination.
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc
index 473277c..5cbcfc1 100644
--- a/content/browser/frame_host/navigator_impl_unittest.cc
+++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -145,7 +145,7 @@
EXPECT_FALSE(node->navigation_request());
// Commit the navigation.
- main_test_rfh()->SendNavigate(0, entry_id, true, kUrl);
+ main_test_rfh()->SendNavigate(entry_id, true, kUrl);
EXPECT_TRUE(main_test_rfh()->is_active());
EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl),
main_test_rfh()->GetSiteInstance()->GetSiteURL());
@@ -198,7 +198,7 @@
EXPECT_FALSE(node->navigation_request());
// Commit the navigation.
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2);
+ main_test_rfh()->SendNavigate(0, true, kUrl2);
EXPECT_TRUE(main_test_rfh()->is_active());
EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl2),
main_test_rfh()->GetSiteInstance()->GetSiteURL());
@@ -252,7 +252,7 @@
EXPECT_FALSE(node->navigation_request());
// Commit the navigation.
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2);
+ main_test_rfh()->SendNavigate(0, true, kUrl2);
EXPECT_TRUE(main_test_rfh()->is_active());
EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL());
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
@@ -459,7 +459,7 @@
EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_rfh));
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh()));
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl2);
+ speculative_rfh->SendNavigate(entry_id, true, kUrl2);
RenderFrameHostImpl* final_rfh = main_test_rfh();
EXPECT_EQ(speculative_rfh, final_rfh);
@@ -504,7 +504,7 @@
EXPECT_TRUE(DidRenderFrameHostRequestCommit(final_speculative_rfh));
// Commit the navigation.
- final_speculative_rfh->SendNavigate(0, entry_id, true, kUrl2);
+ final_speculative_rfh->SendNavigate(entry_id, true, kUrl2);
RenderFrameHostImpl* final_rfh = main_test_rfh();
ASSERT_TRUE(final_rfh);
EXPECT_NE(rfh, final_rfh);
@@ -573,7 +573,7 @@
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh()));
// Commit the navigation.
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl2);
+ speculative_rfh->SendNavigate(entry_id, true, kUrl2);
// Confirm that the commit corresponds to the new request.
ASSERT_TRUE(main_test_rfh());
@@ -644,7 +644,7 @@
}
// Commit the navigation.
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2);
+ main_test_rfh()->SendNavigate(0, true, kUrl2);
// Confirm that the commit corresponds to the new request.
ASSERT_TRUE(main_test_rfh());
@@ -705,7 +705,7 @@
}
// Commit the navigation.
- main_test_rfh()->SendNavigate(1, 0, true, kUrl1);
+ main_test_rfh()->SendNavigate(0, true, kUrl1);
EXPECT_EQ(kUrl1, contents()->GetLastCommittedURL());
}
@@ -753,7 +753,7 @@
EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh()));
// Commit the navigation.
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl1);
+ speculative_rfh->SendNavigate(entry_id, true, kUrl1);
EXPECT_EQ(kUrl1, contents()->GetLastCommittedURL());
}
@@ -814,7 +814,7 @@
}
// Commit the navigation.
- main_test_rfh()->SendNavigate(1, 0, true, kUrl2);
+ main_test_rfh()->SendNavigate(0, true, kUrl2);
EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL());
// The SiteInstance did not change.
@@ -846,7 +846,7 @@
main_test_rfh()->PrepareForCommit();
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
- main_test_rfh()->SendNavigate(0, entry_id, false, kUrl);
+ main_test_rfh()->SendNavigate(entry_id, false, kUrl);
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
// Now do a shift+reload.
@@ -896,7 +896,7 @@
EXPECT_FALSE(node->render_manager()->pending_frame_host());
// Invoke OnDidCommitProvisionalLoad.
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl);
+ speculative_rfh->SendNavigate(entry_id, true, kUrl);
EXPECT_EQ(site_instance_id, main_test_rfh()->GetSiteInstance()->GetId());
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
EXPECT_FALSE(node->render_manager()->pending_frame_host());
@@ -967,7 +967,7 @@
EXPECT_NE(site_instance_id, redirect_site_instance_id);
// Invoke OnDidCommitProvisionalLoad.
- speculative_rfh->SendNavigate(0, entry_id, true, kUrlRedirect);
+ speculative_rfh->SendNavigate(entry_id, true, kUrlRedirect);
// Check that the speculative RenderFrameHost was swapped in.
EXPECT_EQ(redirect_site_instance_id,
@@ -995,7 +995,7 @@
EXPECT_TRUE(speculative_rfh->is_loading());
EXPECT_FALSE(node->navigation_request());
EXPECT_NE(main_test_rfh(), speculative_rfh);
- speculative_rfh->SendNavigate(0, entry_id, true, kUrl2);
+ speculative_rfh->SendNavigate(entry_id, true, kUrl2);
EXPECT_EQ(main_test_rfh(), speculative_rfh);
// Go back to the initial site.
@@ -1168,7 +1168,7 @@
// Claim that the navigation was within same page.
int bad_msg_count = process()->bad_msg_count();
GetSpeculativeRenderFrameHost(node)->SendNavigateWithModificationCallback(
- 0, entry_id, true, kUrl2, base::Bind(SetWithinPage, kUrl1));
+ entry_id, true, kUrl2, base::Bind(SetWithinPage, kUrl1));
EXPECT_EQ(process()->bad_msg_count(), bad_msg_count + 1);
}
@@ -1199,7 +1199,7 @@
// The first navigation commits. This should clear up the speculative RFH and
// the ongoing NavigationRequest.
- main_test_rfh()->SendNavigate(1, entry_id, true, kUrl2);
+ main_test_rfh()->SendNavigate(entry_id, true, kUrl2);
EXPECT_FALSE(node->navigation_request());
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
}
@@ -1236,7 +1236,7 @@
// The first navigation commits. This should clear up the speculative RFH and
// the ongoing NavigationRequest.
- speculative_rfh->SendNavigate(1, entry_id, true, kUrl2);
+ speculative_rfh->SendNavigate(entry_id, true, kUrl2);
EXPECT_FALSE(node->navigation_request());
EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
EXPECT_EQ(speculative_rfh, main_test_rfh());
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index dbde6de0..4c858241 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1119,12 +1119,6 @@
// Called when the renderer navigates. For every frame loaded, we'll get this
// notification containing parameters identifying the navigation.
-//
-// Subframes are identified by the page transition type. For subframes loaded
-// as part of a wider page load, the page_id will be the same as for the top
-// level frame. If the user explicitly requests a subframe navigation, we will
-// get a new page_id because we need to create a new navigation entry for that
-// action.
void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
ScopedCommitStateResetter commit_state_resetter(this);
RenderProcessHost* process = GetProcess();
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 48c3ad5d..ecdfe854 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1221,8 +1221,8 @@
ConvertToSiteInstance(new_instance_descriptor, candidate_instance);
// If |force_swap| is true, we must use a different SiteInstance than the
// current one. If we didn't, we would have two RenderFrameHosts in the same
- // SiteInstance and the same frame, resulting in page_id conflicts for their
- // NavigationEntries.
+ // SiteInstance and the same frame, breaking lookup of RenderFrameHosts by
+ // SiteInstance.
if (force_swap)
CHECK_NE(new_instance, current_instance);
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc
index d68f4ea..e17db95 100644
--- a/content/browser/frame_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -342,15 +342,11 @@
: old_rfh;
EXPECT_TRUE(old_rfh->is_active());
- // Commit the navigation with a new page ID.
- int32_t max_page_id =
- contents()->GetMaxPageIDForSiteInstance(active_rfh->GetSiteInstance());
-
// Use an observer to avoid accessing a deleted renderer later on when the
// state is being checked.
RenderFrameDeletedObserver rfh_observer(old_rfh);
RenderViewHostDeletedObserver rvh_observer(old_rfh->GetRenderViewHost());
- active_rfh->SendNavigate(max_page_id + 1, entry_id, true, url);
+ active_rfh->SendNavigate(entry_id, true, url);
// Make sure that we start to run the unload handler at the time of commit.
if (old_rfh != active_rfh && !rfh_observer.deleted()) {
@@ -415,7 +411,7 @@
// BeforeUnload finishes.
ntp_rfh->SendBeforeUnloadACK(true);
- dest_rfh->SendNavigate(101, entry_id, true, kDestUrl);
+ dest_rfh->SendNavigate(entry_id, true, kDestUrl);
ntp_rfh->OnSwappedOut();
}
@@ -525,7 +521,7 @@
contents2->GetMainFrame()->PrepareForCommit();
TestRenderFrameHost* ntp_rfh2 = contents2->GetMainFrame();
EXPECT_FALSE(contents2->CrossProcessNavigationPending());
- ntp_rfh2->SendNavigate(100, entry_id, true, kChromeUrl);
+ ntp_rfh2->SendNavigate(entry_id, true, kChromeUrl);
// The second one is the opposite, creating a cross-site transition and
// requiring a beforeunload ack.
@@ -537,7 +533,7 @@
TestRenderFrameHost* dest_rfh2 = contents2->GetPendingMainFrame();
ASSERT_TRUE(dest_rfh2);
- dest_rfh2->SendNavigate(101, entry_id, true, kDestUrl);
+ dest_rfh2->SendNavigate(entry_id, true, kDestUrl);
// The two RFH's should be different in every way.
EXPECT_NE(contents()->GetMainFrame()->GetProcess(), dest_rfh2->GetProcess());
@@ -555,8 +551,7 @@
kChromeUrl, Referrer(), ui::PAGE_TRANSITION_LINK, std::string());
entry_id = contents2->GetController().GetPendingEntry()->GetUniqueID();
contents2->GetMainFrame()->PrepareForCommit();
- contents2->GetPendingMainFrame()->SendNavigate(102, entry_id, true,
- kChromeUrl);
+ contents2->GetPendingMainFrame()->SendNavigate(entry_id, true, kChromeUrl);
EXPECT_NE(contents()->GetMainFrame()->GetSiteInstance(),
contents2->GetMainFrame()->GetSiteInstance());
@@ -650,7 +645,7 @@
int entry_id = controller().GetPendingEntry()->GetUniqueID();
contents()->GetMainFrame()->PrepareForCommit();
TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame();
- contents()->TestDidNavigate(rfh2, 1, entry_id, true, kDestUrl,
+ contents()->TestDidNavigate(rfh2, entry_id, true, kDestUrl,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(rfh1->is_active());
EXPECT_TRUE(rfh2->is_active());
@@ -848,9 +843,7 @@
ASSERT_TRUE(contents()->GetPendingMainFrame())
<< "Expected new pending RenderFrameHost to be created.";
RenderFrameHost* last_rfh = contents()->GetPendingMainFrame();
- int32_t new_id =
- contents()->GetMaxPageIDForSiteInstance(last_rfh->GetSiteInstance()) + 1;
- contents()->GetPendingMainFrame()->SendNavigate(new_id, entry_id, true, kUrl);
+ contents()->GetPendingMainFrame()->SendNavigate(entry_id, true, kUrl);
EXPECT_EQ(1, controller().GetLastCommittedEntryIndex());
NavigationEntry* last_committed = controller().GetLastCommittedEntry();
@@ -877,7 +870,7 @@
// The renderer sends a commit.
contents()->GetMainFrame()->SendNavigateWithTransition(
- new_id, entry_id, false, kUrl, ui::PAGE_TRANSITION_TYPED);
+ entry_id, false, kUrl, ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(1, controller().GetLastCommittedEntryIndex());
EXPECT_FALSE(controller().GetPendingEntry());
@@ -922,7 +915,7 @@
// 1) The first navigation. --------------------------
const GURL kUrl1("http://www.google.com/");
NavigationEntryImpl entry1(
- NULL /* instance */, -1 /* page_id */, kUrl1, Referrer(),
+ NULL /* instance */, kUrl1, Referrer(),
base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
host = NavigateToEntry(manager, entry1);
@@ -942,7 +935,7 @@
// 2) Navigate to next site. -------------------------
const GURL kUrl2("http://www.google.com/foo");
NavigationEntryImpl entry2(
- NULL /* instance */, -1 /* page_id */, kUrl2,
+ NULL /* instance */, kUrl2,
Referrer(kUrl1, blink::WebReferrerPolicyDefault),
base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
true /* is_renderer_init */);
@@ -961,7 +954,7 @@
// 3) Cross-site navigate to next site. --------------
const GURL kUrl3("http://webkit.org/");
NavigationEntryImpl entry3(
- NULL /* instance */, -1 /* page_id */, kUrl3,
+ NULL /* instance */, kUrl3,
Referrer(kUrl2, blink::WebReferrerPolicyDefault),
base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */);
@@ -1001,7 +994,7 @@
EXPECT_TRUE(initial_rfh);
const GURL kUrl("chrome://foo");
- NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl,
+ NavigationEntryImpl entry(NULL /* instance */, kUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -1057,14 +1050,14 @@
RenderFrameHostManager* manager1 =
web_contents1->GetRenderManagerForTesting();
// Test the case that new RVH is considered live.
- manager1->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE, -1,
+ manager1->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE,
FrameReplicationState(), false);
EXPECT_TRUE(manager1->current_host()->IsRenderViewLive());
EXPECT_TRUE(manager1->current_frame_host()->IsRenderFrameLive());
// Navigate to a WebUI page.
const GURL kUrl1("chrome://foo");
- NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1,
+ NavigationEntryImpl entry1(NULL /* instance */, kUrl1,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -1091,12 +1084,12 @@
web_contents2->GetRenderManagerForTesting();
// Make sure the new RVH is considered live. This is usually done in
// RenderWidgetHost::Init when opening a new tab from a link.
- manager2->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE, -1,
+ manager2->current_host()->CreateRenderView(-1, MSG_ROUTING_NONE,
FrameReplicationState(), false);
EXPECT_TRUE(manager2->current_host()->IsRenderViewLive());
const GURL kUrl2("chrome://foo/bar");
- NavigationEntryImpl entry2(NULL /* instance */, -1 /* page_id */, kUrl2,
+ NavigationEntryImpl entry2(NULL /* instance */, kUrl2,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
true /* is_renderer_init */);
@@ -1188,7 +1181,6 @@
// Before that RFH has committed, the evil page reloads itself.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = 0;
params.did_create_new_entry = false;
params.url = kUrl2;
@@ -1273,7 +1265,7 @@
// The back navigation commits.
const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- entry1->GetPageID(), entry1->GetUniqueID(), false, entry1->GetURL());
+ entry1->GetUniqueID(), false, entry1->GetURL());
EXPECT_TRUE(rfh2->IsWaitingForUnloadACK());
EXPECT_FALSE(rfh2->is_active());
@@ -1282,7 +1274,7 @@
contents()->GetMainFrame()->PrepareForCommit();
const NavigationEntry* entry2 = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- entry2->GetPageID(), entry2->GetUniqueID(), false, entry2->GetURL());
+ entry2->GetUniqueID(), false, entry2->GetURL());
EXPECT_TRUE(main_test_rfh()->is_active());
}
@@ -1448,7 +1440,7 @@
// The back navigation commits.
const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- entry1->GetPageID(), entry1->GetUniqueID(), false, entry1->GetURL());
+ entry1->GetUniqueID(), false, entry1->GetURL());
// Ensure the opener is still cleared.
EXPECT_FALSE(contents()->HasOpener());
@@ -1482,7 +1474,7 @@
contents()->GetMainFrame()->PrepareForCommit();
const NavigationEntry* entry1 = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- entry1->GetPageID(), entry1->GetUniqueID(), false, entry1->GetURL());
+ entry1->GetUniqueID(), false, entry1->GetURL());
// Disown the opener from rfh2.
rfh2->DidChangeOpener(MSG_ROUTING_NONE);
@@ -1508,7 +1500,7 @@
// Make sure the new opener RVH is considered live.
opener1_manager->current_host()->CreateRenderView(
- -1, MSG_ROUTING_NONE, -1, FrameReplicationState(), false);
+ -1, MSG_ROUTING_NONE, FrameReplicationState(), false);
EXPECT_TRUE(opener1_manager->current_host()->IsRenderViewLive());
EXPECT_TRUE(opener1_manager->current_frame_host()->IsRenderFrameLive());
@@ -1608,7 +1600,7 @@
// 1) The first navigation. --------------------------
const GURL kUrl1("http://www.google.com/");
NavigationEntryImpl entry1(
- NULL /* instance */, -1 /* page_id */, kUrl1, Referrer(),
+ NULL /* instance */, kUrl1, Referrer(),
base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
host = NavigateToEntry(manager, entry1);
@@ -1629,7 +1621,7 @@
// Guests stay in the same process on navigation.
const GURL kUrl2("http://www.chromium.org");
NavigationEntryImpl entry2(
- NULL /* instance */, -1 /* page_id */, kUrl2,
+ NULL /* instance */, kUrl2,
Referrer(kUrl1, blink::WebReferrerPolicyDefault),
base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
true /* is_renderer_init */);
@@ -1664,7 +1656,7 @@
// 1) The first navigation. --------------------------
const GURL kUrl1("http://www.google.com/");
- NavigationEntryImpl entry1(NULL /* instance */, -1 /* page_id */, kUrl1,
+ NavigationEntryImpl entry1(NULL /* instance */, kUrl1,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -1688,7 +1680,7 @@
// 2) Cross-site navigate to next site. -------------------------
const GURL kUrl2("http://www.example.com");
NavigationEntryImpl entry2(
- NULL /* instance */, -1 /* page_id */, kUrl2, Referrer(),
+ NULL /* instance */, kUrl2, Referrer(),
base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
RenderFrameHostImpl* host2 = NavigateToEntry(manager, entry2);
@@ -1770,7 +1762,7 @@
EXPECT_TRUE(rfh1->is_active());
// The new page commits.
- contents()->TestDidNavigate(rfh2, 1, entry_id, true, kUrl2,
+ contents()->TestDidNavigate(rfh2, entry_id, true, kUrl2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(rfh2, contents()->GetMainFrame());
@@ -1812,7 +1804,7 @@
TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame();
// The new page commits.
- contents()->TestDidNavigate(rfh2, 1, entry_id, true, kUrl2,
+ contents()->TestDidNavigate(rfh2, entry_id, true, kUrl2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(rfh2, contents()->GetMainFrame());
@@ -1856,7 +1848,7 @@
TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame();
// The new page commits.
- contents()->TestDidNavigate(rfh2, 1, entry_id, true, kUrl2,
+ contents()->TestDidNavigate(rfh2, entry_id, true, kUrl2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(rfh2, contents()->GetMainFrame());
@@ -1961,7 +1953,7 @@
contents()->GetFrameTree()->root()->child_at(1)->render_manager();
// 1) The first navigation.
- NavigationEntryImpl entryA(NULL /* instance */, -1 /* page_id */, kUrlA,
+ NavigationEntryImpl entryA(NULL /* instance */, kUrlA,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -1979,7 +1971,7 @@
EXPECT_TRUE(host1->GetSiteInstance()->HasSite());
// 2) Cross-site navigate both frames to next site.
- NavigationEntryImpl entryB(NULL /* instance */, -1 /* page_id */, kUrlB,
+ NavigationEntryImpl entryB(NULL /* instance */, kUrlB,
Referrer(kUrlA, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -2090,7 +2082,7 @@
blink::WebSandboxFlags::None, FrameOwnerProperties());
RenderFrameHostManager* iframe =
contents()->GetFrameTree()->root()->child_at(0)->render_manager();
- NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl2,
+ NavigationEntryImpl entry(NULL /* instance */, kUrl2,
Referrer(kUrl1, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -2144,7 +2136,7 @@
// pending RVH has bindings.
const GURL kWebUIUrl("chrome://foo");
NavigationEntryImpl webui_entry(
- nullptr /* instance */, -1 /* page_id */, kWebUIUrl, Referrer(),
+ nullptr /* instance */, kWebUIUrl, Referrer(),
base::string16() /* title */, ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
RenderFrameHostManager* main_rfhm = contents()->GetRenderManagerForTesting();
@@ -2157,7 +2149,7 @@
// should not grant WebUI bindings to the subframe's RVH.
const GURL kSubframeUrl("http://bar.com");
NavigationEntryImpl subframe_entry(
- nullptr /* instance */, -1 /* page_id */, kSubframeUrl, Referrer(),
+ nullptr /* instance */, kSubframeUrl, Referrer(),
base::string16() /* title */, ui::PAGE_TRANSITION_LINK,
false /* is_renderer_init */);
RenderFrameHostImpl* bar_rfh = NavigateToEntry(subframe_rfhm, subframe_entry);
@@ -2392,7 +2384,7 @@
RenderFrameHostManager* child3 = root->child_at(2)->render_manager();
// Navigate first two subframes to B.
- NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB,
+ NavigationEntryImpl entryB(nullptr /* instance */, kUrlB,
Referrer(kUrlA, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -2405,7 +2397,7 @@
child2->DidNavigateFrame(host2, true);
// Navigate the third subframe to C.
- NavigationEntryImpl entryC(nullptr /* instance */, -1 /* page_id */, kUrlC,
+ NavigationEntryImpl entryC(nullptr /* instance */, kUrlC,
Referrer(kUrlA, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -2480,7 +2472,7 @@
RenderFrameHostManager* child = root->child_at(0)->render_manager();
// Navigate subframe to B.
- NavigationEntryImpl entryB(nullptr /* instance */, -1 /* page_id */, kUrlB,
+ NavigationEntryImpl entryB(nullptr /* instance */, kUrlB,
Referrer(kUrlA, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -2494,7 +2486,7 @@
EXPECT_TRUE(main_test_rfh()->GetView()->HasFocus());
// Navigate the subframe to C.
- NavigationEntryImpl entryC(nullptr /* instance */, -1 /* page_id */, kUrlC,
+ NavigationEntryImpl entryC(nullptr /* instance */, kUrlC,
Referrer(kUrlA, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -2533,7 +2525,6 @@
NavigationControllerImpl::CreateNavigationEntry(
kInitUrl, Referrer(), ui::PAGE_TRANSITION_TYPED, false, std::string(),
browser_context());
- new_entry->SetPageID(0);
entries.push_back(std::move(new_entry));
controller.Restore(0, RestoreType::LAST_SESSION_EXITED_CLEANLY, &entries);
ASSERT_EQ(0u, entries.size());
@@ -2545,7 +2536,7 @@
EXPECT_FALSE(initial_host->web_ui());
// Navigation request to an entry from a previous browsing session.
- NavigationEntryImpl entry(nullptr /* instance */, 0 /* page_id */, kInitUrl,
+ NavigationEntryImpl entry(nullptr /* instance */, kInitUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_RELOAD,
false /* is_renderer_init */);
@@ -2600,7 +2591,7 @@
// Navigation request to a non-WebUI page.
const GURL kUrl("http://google.com");
- NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl,
+ NavigationEntryImpl entry(NULL /* instance */, kUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -2692,7 +2683,7 @@
// Navigation another WebUI page, with a different type.
set_webui_type(2);
const GURL kUrl("chrome://bar/");
- NavigationEntryImpl entry(NULL /* instance */, -1 /* page_id */, kUrl,
+ NavigationEntryImpl entry(NULL /* instance */, kUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -2767,7 +2758,6 @@
main_test_rfh()->PrepareForCommit();
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = 0;
params.did_create_new_entry = false;
params.transition = ui::PAGE_TRANSITION_LINK;
@@ -2840,7 +2830,7 @@
// Navigation request.
const GURL kUrl("chrome://foo");
- NavigationEntryImpl entry(nullptr /* instance */, -1 /* page_id */, kUrl,
+ NavigationEntryImpl entry(nullptr /* instance */, kUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -2901,7 +2891,7 @@
// Navigation request. No change in the returned WebUI type.
const GURL kUrl("chrome://foo/bar");
- NavigationEntryImpl entry(nullptr /* instance */, -1 /* page_id */, kUrl,
+ NavigationEntryImpl entry(nullptr /* instance */, kUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -2959,7 +2949,7 @@
// Navigation request.
const GURL kUrl("chrome://bar");
- NavigationEntryImpl entry(nullptr /* instance */, -1 /* page_id */, kUrl,
+ NavigationEntryImpl entry(nullptr /* instance */, kUrl,
Referrer(), base::string16() /* title */,
ui::PAGE_TRANSITION_TYPED,
false /* is_renderer_init */);
@@ -3026,7 +3016,7 @@
RenderFrameHostManager* child = root->child_at(0)->render_manager();
// Navigate subframe to kUrl2.
- NavigationEntryImpl entry1(nullptr /* instance */, -1 /* page_id */, kUrl2,
+ NavigationEntryImpl entry1(nullptr /* instance */, kUrl2,
Referrer(kUrl1, blink::WebReferrerPolicyDefault),
base::string16() /* title */,
ui::PAGE_TRANSITION_LINK,
@@ -3077,7 +3067,6 @@
// when the child navigates.
main_test_rfh()->GetProcess()->sink().ClearMessages();
FrameHostMsg_DidCommitProvisionalLoad_Params commit_params;
- commit_params.page_id = 0;
commit_params.nav_entry_id = 0;
commit_params.did_create_new_entry = false;
commit_params.url = kUrl3;
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index b4697dd..fe05483 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -306,7 +306,6 @@
bool RenderViewHostImpl::CreateRenderView(
int opener_frame_route_id,
int proxy_route_id,
- int32_t max_page_id,
const FrameReplicationState& replicated_frame_state,
bool window_was_created_with_opener) {
TRACE_EVENT0("renderer_host,navigation",
@@ -334,12 +333,6 @@
GetWidget()->set_renderer_initialized(true);
- // Ensure the RenderView starts with a next_page_id larger than any existing
- // page ID it might be asked to render.
- int32_t next_page_id = 1;
- if (max_page_id > -1)
- next_page_id = max_page_id + 1;
-
mojom::CreateViewParamsPtr params = mojom::CreateViewParams::New();
params->renderer_preferences =
delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
@@ -366,7 +359,6 @@
params->hidden = GetWidget()->is_hidden();
params->never_visible = delegate_->IsNeverVisible();
params->window_was_created_with_opener = window_was_created_with_opener;
- params->next_page_id = next_page_id;
params->enable_auto_resize = GetWidget()->auto_resize_enabled();
params->min_size = GetWidget()->min_size_for_auto_resize();
params->max_size = GetWidget()->max_size_for_auto_resize();
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index 01871e8e..4aa7383 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -174,17 +174,16 @@
// Set up the RenderView child process. Virtual because it is overridden by
// TestRenderViewHost.
// The |opener_route_id| parameter indicates which RenderView created this
- // (MSG_ROUTING_NONE if none). If |max_page_id| is larger than -1, the
- // RenderView is told to start issuing page IDs at |max_page_id| + 1.
+ // (MSG_ROUTING_NONE if none).
// |window_was_created_with_opener| is true if this top-level frame was
// created with an opener. (The opener may have been closed since.)
// The |proxy_route_id| is only used when creating a RenderView in swapped out
- // state. |replicated_frame_state| contains replicated data for the
- // top-level frame, such as its name and sandbox flags.
+ // state.
+ // |replicated_frame_state| contains replicated data for the top-level frame,
+ // such as its name and sandbox flags.
virtual bool CreateRenderView(
int opener_frame_route_id,
int proxy_route_id,
- int32_t max_page_id,
const FrameReplicationState& replicated_frame_state,
bool window_was_created_with_opener);
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc
index 2a8eeb9..3504cbe 100644
--- a/content/browser/renderer_host/render_view_host_unittest.cc
+++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -70,7 +70,7 @@
// See RenderViewHost::OnNavigate for a discussion.
TEST_F(RenderViewHostTest, FilterAbout) {
main_test_rfh()->NavigateAndCommitRendererInitiated(
- 1, true, GURL("about:cache"));
+ true, GURL("about:cache"));
ASSERT_TRUE(controller().GetVisibleEntry());
EXPECT_EQ(GURL(url::kAboutBlankURL),
controller().GetVisibleEntry()->GetURL());
@@ -224,7 +224,7 @@
main_test_rfh()->SendRendererInitiatedNavigationRequest(url, false);
main_test_rfh()->PrepareForCommit();
contents()->GetMainFrame()->SendNavigateWithModificationCallback(
- 1, 1, true, url, set_bad_file_path_callback);
+ 1, true, url, set_bad_file_path_callback);
EXPECT_EQ(1, process()->bad_msg_count());
ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
@@ -232,7 +232,7 @@
main_test_rfh()->SendRendererInitiatedNavigationRequest(url, false);
main_test_rfh()->PrepareForCommit();
contents()->GetMainFrame()->SendNavigateWithModificationCallback(
- 2, 2, true, url, set_bad_file_path_callback);
+ 2, true, url, set_bad_file_path_callback);
EXPECT_EQ(1, process()->bad_msg_count());
}
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc
index d1489980..6a167b9c 100644
--- a/content/browser/security_exploit_browsertest.cc
+++ b/content/browser/security_exploit_browsertest.cc
@@ -530,7 +530,6 @@
// Create commit params with different origins in params.url and
// params.origin.
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = 0;
params.nav_entry_id = 0;
params.did_create_new_entry = false;
params.url = url;
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc
index 895d9f7..400c3f9 100644
--- a/content/browser/site_instance_impl_unittest.cc
+++ b/content/browser/site_instance_impl_unittest.cc
@@ -165,7 +165,7 @@
EXPECT_EQ(0, browser_client()->GetAndClearSiteInstanceDeleteCount());
NavigationEntryImpl* e1 = new NavigationEntryImpl(
- instance, 0, url, Referrer(), base::string16(), ui::PAGE_TRANSITION_LINK,
+ instance, url, Referrer(), base::string16(), ui::PAGE_TRANSITION_LINK,
false);
// Redundantly setting e1's SiteInstance shouldn't affect the ref count.
@@ -175,7 +175,7 @@
// Add a second reference
NavigationEntryImpl* e2 = new NavigationEntryImpl(
- instance, 0, url, Referrer(), base::string16(), ui::PAGE_TRANSITION_LINK,
+ instance, url, Referrer(), base::string16(), ui::PAGE_TRANSITION_LINK,
false);
instance = nullptr;
@@ -220,7 +220,7 @@
std::unique_ptr<NavigationEntryImpl> e1 =
base::WrapUnique(new NavigationEntryImpl(
- SiteInstanceImpl::Create(nullptr), 0, url, Referrer(),
+ SiteInstanceImpl::Create(nullptr), url, Referrer(),
base::string16(), ui::PAGE_TRANSITION_LINK, false));
// Clone the entry.
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
index 29fee88c..bf9af22e4 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc
@@ -296,7 +296,7 @@
EXPECT_TRUE(contents()->CrossProcessNavigationPending());
NavigationEntry* pending = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL());
+ pending->GetUniqueID(), false, pending->GetURL());
EXPECT_EQ(contents()->GetURL(), third());
}
@@ -312,7 +312,7 @@
NavigationEntry* pending = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL());
+ pending->GetUniqueID(), false, pending->GetURL());
ReceivePaintUpdate();
// Navigation was committed and the paint update was received - we should no
@@ -335,7 +335,7 @@
EXPECT_FALSE(GetOverlay()->web_contents());
NavigationEntry* pending = contents()->GetController().GetPendingEntry();
contents()->GetPendingMainFrame()->SendNavigate(
- pending->GetPageID(), pending->GetUniqueID(), false, pending->GetURL());
+ pending->GetUniqueID(), false, pending->GetURL());
EXPECT_EQ(contents()->GetURL(), third());
}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b6f8ed73..2d93f2d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1145,34 +1145,6 @@
return page_title_when_no_navigation_entry_;
}
-int32_t WebContentsImpl::GetMaxPageID() {
- return GetMaxPageIDForSiteInstance(GetSiteInstance());
-}
-
-int32_t WebContentsImpl::GetMaxPageIDForSiteInstance(
- SiteInstance* site_instance) {
- if (max_page_ids_.find(site_instance->GetId()) == max_page_ids_.end())
- max_page_ids_[site_instance->GetId()] = -1;
-
- return max_page_ids_[site_instance->GetId()];
-}
-
-void WebContentsImpl::UpdateMaxPageID(int32_t page_id) {
- UpdateMaxPageIDForSiteInstance(GetSiteInstance(), page_id);
-}
-
-void WebContentsImpl::UpdateMaxPageIDForSiteInstance(
- SiteInstance* site_instance,
- int32_t page_id) {
- if (GetMaxPageIDForSiteInstance(site_instance) < page_id)
- max_page_ids_[site_instance->GetId()] = page_id;
-}
-
-void WebContentsImpl::CopyMaxPageIDsFrom(WebContents* web_contents) {
- WebContentsImpl* contents = static_cast<WebContentsImpl*>(web_contents);
- max_page_ids_ = contents->max_page_ids_;
-}
-
SiteInstanceImpl* WebContentsImpl::GetSiteInstance() const {
return GetRenderManager()->current_host()->GetSiteInstance();
}
@@ -3893,20 +3865,6 @@
return has_accessed_initial_document_;
}
-void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) {
- // If we are creating a RVH for a restored controller, then we need to make
- // sure the RenderView starts with a next_page_id_ larger than the number
- // of restored entries. This must be called before the RenderView starts
- // navigating (to avoid a race between the browser updating max_page_id and
- // the renderer updating next_page_id_). Because of this, we only call this
- // from CreateRenderView and allow that to notify the RenderView for us.
- int max_restored_page_id = controller_.GetMaxRestoredPageID();
- if (max_restored_page_id >
- GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()))
- UpdateMaxPageIDForSiteInstance(rvh->GetSiteInstance(),
- max_restored_page_id);
-}
-
void WebContentsImpl::UpdateTitleForEntry(NavigationEntry* entry,
const base::string16& title) {
// For file URLs without a title, use the pathname instead. In the case of a
@@ -4883,14 +4841,10 @@
if (proxy_routing_id == MSG_ROUTING_NONE)
CreateRenderWidgetHostViewForRenderManager(render_view_host);
- // Make sure we use the correct starting page_id in the new RenderView.
- UpdateMaxPageIDIfNecessary(render_view_host);
- int32_t max_page_id =
- GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
-
if (!static_cast<RenderViewHostImpl*>(render_view_host)
- ->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
- max_page_id, replicated_frame_state,
+ ->CreateRenderView(opener_frame_routing_id,
+ proxy_routing_id,
+ replicated_frame_state,
created_with_opener_)) {
return false;
}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index d26d541..26a2026 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -303,8 +303,6 @@
const base::string16& GetTitle() const override;
void UpdateTitleForEntry(NavigationEntry* entry,
const base::string16& title) override;
- int32_t GetMaxPageID() override;
- int32_t GetMaxPageIDForSiteInstance(SiteInstance* site_instance) override;
SiteInstanceImpl* GetSiteInstance() const override;
SiteInstanceImpl* GetPendingSiteInstance() const override;
bool IsLoading() const override;
@@ -732,20 +730,6 @@
// first commit.
bool HasAccessedInitialDocument() override;
- // Updates the max page ID for the current SiteInstance in this
- // WebContentsImpl to be at least |page_id|.
- void UpdateMaxPageID(int32_t page_id) override;
-
- // Updates the max page ID for the given SiteInstance in this WebContentsImpl
- // to be at least |page_id|.
- void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance,
- int32_t page_id) override;
-
- // Copy the current map of SiteInstance ID to max page ID from another tab.
- // This is necessary when this tab adopts the NavigationEntries from
- // |web_contents|.
- void CopyMaxPageIDsFrom(WebContents* web_contents) override;
-
// Sets the history for this WebContentsImpl to |history_length| entries, with
// an offset of |history_offset|. This notifies all renderers involved in
// rendering the current page about the new offset and length.
@@ -1039,12 +1023,6 @@
// not provided since it may be invalid/changed after being committed. The
// current navigation entry is in the NavigationController at this point.
- // If our controller was restored, update the max page ID associated with the
- // given RenderViewHost to be larger than the number of restored entries.
- // This is called in CreateRenderView before any navigations in the RenderView
- // have begun, to prevent any races in updating RenderView::next_page_id.
- void UpdateMaxPageIDIfNecessary(RenderViewHost* rvh);
-
// Helper for CreateNewWidget/CreateNewFullscreenWidget.
void CreateNewWidget(int32_t render_process_id,
int32_t route_id,
@@ -1204,11 +1182,6 @@
// "waiting" or "loading."
bool waiting_for_response_;
- // Map of SiteInstance ID to max page ID for this tab. A page ID is specific
- // to a given tab and SiteInstance, and must be valid for the lifetime of the
- // WebContentsImpl.
- std::map<int32_t, int32_t> max_page_ids_;
-
// The current load state and the URL associated with it.
net::LoadStateWithParam load_state_;
base::string16 load_state_host_;
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 9d43c05..cebebc9 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -144,12 +144,11 @@
CommandReceived();
}
- void TestDidNavigate(int page_id,
- int nav_entry_id,
+ void TestDidNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) {
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- InitNavigateParams(¶ms, page_id, nav_entry_id, did_create_new_entry,
+ InitNavigateParams(¶ms, nav_entry_id, did_create_new_entry,
url, ui::PAGE_TRANSITION_TYPED);
DidNavigate(GetMainFrame()->GetRenderViewHost(), params);
}
@@ -362,7 +361,7 @@
std::string());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- InitNavigateParams(¶ms, 0, 0, true, GURL(url::kAboutBlankURL),
+ InitNavigateParams(¶ms, 0, true, GURL(url::kAboutBlankURL),
ui::PAGE_TRANSITION_TYPED);
main_test_rfh()->SendNavigateWithParams(¶ms);
@@ -430,7 +429,7 @@
FrameMsg_EnableViewSourceMode::ID));
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- InitNavigateParams(¶ms, 0, entry_id, true, kRewrittenURL,
+ InitNavigateParams(¶ms, entry_id, true, kRewrittenURL,
ui::PAGE_TRANSITION_TYPED);
main_test_rfh()->PrepareForCommit();
main_test_rfh()->OnMessageReceived(
@@ -447,29 +446,6 @@
contents()->GetController().GetLastCommittedEntry()->GetURL());
}
-// Test to ensure UpdateMaxPageID is working properly.
-TEST_F(WebContentsImplTest, UpdateMaxPageID) {
- SiteInstance* instance1 = contents()->GetSiteInstance();
- scoped_refptr<SiteInstance> instance2(SiteInstance::Create(nullptr));
-
- // Starts at -1.
- EXPECT_EQ(-1, contents()->GetMaxPageID());
- EXPECT_EQ(-1, contents()->GetMaxPageIDForSiteInstance(instance1));
- EXPECT_EQ(-1, contents()->GetMaxPageIDForSiteInstance(instance2.get()));
-
- // Make sure max_page_id_ is monotonically increasing per SiteInstance.
- contents()->UpdateMaxPageID(3);
- contents()->UpdateMaxPageID(1);
- EXPECT_EQ(3, contents()->GetMaxPageID());
- EXPECT_EQ(3, contents()->GetMaxPageIDForSiteInstance(instance1));
- EXPECT_EQ(-1, contents()->GetMaxPageIDForSiteInstance(instance2.get()));
-
- contents()->UpdateMaxPageIDForSiteInstance(instance2.get(), 7);
- EXPECT_EQ(3, contents()->GetMaxPageID());
- EXPECT_EQ(3, contents()->GetMaxPageIDForSiteInstance(instance1));
- EXPECT_EQ(7, contents()->GetMaxPageIDForSiteInstance(instance2.get()));
-}
-
// Test simple same-SiteInstance navigation.
TEST_F(WebContentsImplTest, SimpleNavigation) {
TestRenderFrameHost* orig_rfh = main_test_rfh();
@@ -492,7 +468,7 @@
site_instance());
// DidNavigate from the page
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -544,7 +520,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
// Keep the number of active frames in orig_rfh's SiteInstance non-zero so
@@ -580,7 +556,7 @@
}
// DidNavigate from the pending page
- contents()->TestDidNavigate(pending_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(pending_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance2 = contents()->GetSiteInstance();
@@ -618,7 +594,7 @@
}
// DidNavigate from the back action
- contents()->TestDidNavigate(goback_rfh, 1, entry_id, false, url2,
+ contents()->TestDidNavigate(goback_rfh, entry_id, false, url2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(goback_rfh, main_test_rfh());
@@ -650,7 +626,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
@@ -674,7 +650,7 @@
EXPECT_EQ(orig_rvh_delete_count, 1);
// DidNavigate from the new page
- contents()->TestDidNavigate(new_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(new_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance2 = contents()->GetSiteInstance();
@@ -701,7 +677,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
// Open a new contents with the same SiteInstance, navigated to the same site.
@@ -714,7 +690,7 @@
contents2->GetMainFrame()->PrepareForCommit();
// Need this page id to be 2 since the site instance is the same (which is the
// scope of page IDs) and we want to consider this a new page.
- contents2->TestDidNavigate(contents2->GetMainFrame(), 2, entry_id, true, url,
+ contents2->TestDidNavigate(contents2->GetMainFrame(), entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
// Navigate first contents to a new site.
@@ -724,7 +700,7 @@
entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
TestRenderFrameHost* pending_rfh_a = contents()->GetPendingMainFrame();
- contents()->TestDidNavigate(pending_rfh_a, 1, entry_id, true, url2a,
+ contents()->TestDidNavigate(pending_rfh_a, entry_id, true, url2a,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance2a = contents()->GetSiteInstance();
EXPECT_NE(instance1, instance2a);
@@ -744,7 +720,7 @@
// NOTE(creis): We used to be in danger of showing a crash page here if the
// second contents hadn't navigated somewhere first (bug 1145430). That case
// is now covered by the CrossSiteBoundariesAfterCrash test.
- contents2->TestDidNavigate(pending_rfh_b, 2, entry_id, true, url2b,
+ contents2->TestDidNavigate(pending_rfh_b, entry_id, true, url2b,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance2b = contents2->GetSiteInstance();
EXPECT_NE(instance1, instance2b);
@@ -773,7 +749,7 @@
native_url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, native_url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, native_url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
@@ -795,7 +771,7 @@
EXPECT_EQ(native_url, contents()->GetLastCommittedURL());
EXPECT_EQ(url, contents()->GetVisibleURL());
EXPECT_FALSE(contents()->GetPendingMainFrame());
- contents()->TestDidNavigate(orig_rfh, 2, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
// Keep the number of active frames in orig_rfh's SiteInstance
@@ -831,7 +807,7 @@
}
// DidNavigate from the pending page.
- contents()->TestDidNavigate(pending_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(pending_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* new_instance = contents()->GetSiteInstance();
@@ -871,7 +847,6 @@
NavigationControllerImpl::CreateNavigationEntry(
native_url, Referrer(), ui::PAGE_TRANSITION_LINK, false,
std::string(), browser_context());
- new_entry->SetPageID(0);
entries.push_back(std::move(new_entry));
controller().Restore(0, RestoreType::LAST_SESSION_EXITED_CLEANLY, &entries);
ASSERT_EQ(0u, entries.size());
@@ -880,7 +855,7 @@
controller().GoToIndex(0);
NavigationEntry* entry = controller().GetPendingEntry();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 0, entry->GetUniqueID(), false,
+ contents()->TestDidNavigate(orig_rfh, entry->GetUniqueID(), false,
native_url, ui::PAGE_TRANSITION_RELOAD);
EXPECT_EQ(orig_instance, contents()->GetSiteInstance());
EXPECT_EQ(GURL(), contents()->GetSiteInstance()->GetSiteURL());
@@ -893,7 +868,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry = controller().GetPendingEntry();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 2, entry->GetUniqueID(), true, url,
+ contents()->TestDidNavigate(orig_rfh, entry->GetUniqueID(), true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(orig_instance, contents()->GetSiteInstance());
@@ -918,7 +893,6 @@
NavigationControllerImpl::CreateNavigationEntry(
regular_url, Referrer(), ui::PAGE_TRANSITION_LINK, false,
std::string(), browser_context());
- new_entry->SetPageID(0);
entries.push_back(std::move(new_entry));
controller().Restore(0, RestoreType::LAST_SESSION_EXITED_CLEANLY, &entries);
ASSERT_EQ(0u, entries.size());
@@ -927,7 +901,7 @@
controller().GoToIndex(0);
NavigationEntry* entry = controller().GetPendingEntry();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 0, entry->GetUniqueID(), false,
+ contents()->TestDidNavigate(orig_rfh, entry->GetUniqueID(), false,
regular_url, ui::PAGE_TRANSITION_RELOAD);
EXPECT_EQ(orig_instance, contents()->GetSiteInstance());
EXPECT_TRUE(orig_instance->HasSite());
@@ -938,7 +912,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
entry = controller().GetPendingEntry();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(contents()->GetPendingMainFrame(), 2,
+ contents()->TestDidNavigate(contents()->GetPendingMainFrame(),
entry->GetUniqueID(), true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_NE(orig_instance, contents()->GetSiteInstance());
@@ -958,7 +932,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
// Start to navigate first tab to a new site, so that it has a pending RVH.
@@ -989,7 +963,7 @@
// Ensure that committing the navigation removes the proxy.
entry_id = controller().GetPendingEntry()->GetUniqueID();
- contents()->TestDidNavigate(pending_rfh, 2, entry_id, true, url2,
+ contents()->TestDidNavigate(pending_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(
contents()->GetRenderManager()->GetRenderFrameProxyHost(instance));
@@ -1007,7 +981,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
// Open a related contents to a second site.
@@ -1024,7 +998,7 @@
// pending.
TestRenderFrameHost* rfh2 = contents2->GetMainFrame();
EXPECT_FALSE(contents2->CrossProcessNavigationPending());
- contents2->TestDidNavigate(rfh2, 2, entry_id, true, url2,
+ contents2->TestDidNavigate(rfh2, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance2 = contents2->GetSiteInstance();
EXPECT_NE(instance1, instance2);
@@ -1034,7 +1008,7 @@
// SiteInstances, because we don't intercept Blink navigations.
orig_rfh->SendRendererInitiatedNavigationRequest(url2, true);
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 2, 0, true, url2,
+ contents()->TestDidNavigate(orig_rfh, 0, true, url2,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance3 = contents()->GetSiteInstance();
EXPECT_EQ(instance1, instance3);
@@ -1048,7 +1022,7 @@
entry_id = controller().GetPendingEntry()->GetUniqueID();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 3, entry_id, true, url3,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url3,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance4 = contents()->GetSiteInstance();
EXPECT_EQ(instance1, instance4);
@@ -1066,7 +1040,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -1097,7 +1071,7 @@
// We won't hear DidNavigate until the onunload handler has finished running.
// DidNavigate from the pending page.
- contents()->TestDidNavigate(pending_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(pending_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
SiteInstance* instance2 = contents()->GetSiteInstance();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
@@ -1119,7 +1093,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -1133,7 +1107,7 @@
EXPECT_TRUE(contents()->CrossProcessNavigationPending());
// Suppose the original renderer navigates before the new one is ready.
- orig_rfh->SendNavigate(2, 0, true, GURL("http://www.google.com/foo"));
+ orig_rfh->SendNavigate(0, true, GURL("http://www.google.com/foo"));
// Verify that the pending navigation is cancelled.
EXPECT_FALSE(orig_rfh->is_waiting_for_beforeunload_ack());
@@ -1157,7 +1131,7 @@
int entry_id = controller().GetPendingEntry()->GetUniqueID();
TestRenderFrameHost* webui_rfh = main_test_rfh();
webui_rfh->PrepareForCommit();
- contents()->TestDidNavigate(webui_rfh, 1, entry_id, true, url1,
+ contents()->TestDidNavigate(webui_rfh, entry_id, true, url1,
ui::PAGE_TRANSITION_TYPED);
NavigationEntry* entry1 = controller().GetLastCommittedEntry();
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -1183,7 +1157,7 @@
webui_rfh->PrepareForCommit();
// DidNavigate from the pending page.
- contents()->TestDidNavigate(google_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(google_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
NavigationEntry* entry2 = controller().GetLastCommittedEntry();
SiteInstance* instance2 = contents()->GetSiteInstance();
@@ -1205,7 +1179,7 @@
entry_id = controller().GetPendingEntry()->GetUniqueID();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(google_rfh, 2, entry_id, true, url3,
+ contents()->TestDidNavigate(google_rfh, entry_id, true, url3,
ui::PAGE_TRANSITION_TYPED);
NavigationEntry* entry3 = controller().GetLastCommittedEntry();
SiteInstance* instance3 = contents()->GetSiteInstance();
@@ -1238,7 +1212,7 @@
FrameHostMsg_BeforeUnload_ACK(0, true, now, now));
// DidNavigate from the first back. This aborts the second back's pending RFH.
- contents()->TestDidNavigate(google_rfh, 1, goback_entry->GetUniqueID(), false,
+ contents()->TestDidNavigate(google_rfh, goback_entry->GetUniqueID(), false,
url2, ui::PAGE_TRANSITION_TYPED);
// We should commit this page and forget about the second back.
@@ -1268,7 +1242,7 @@
int entry_id = controller().GetPendingEntry()->GetUniqueID();
TestRenderFrameHost* webui_rfh = main_test_rfh();
webui_rfh->PrepareForCommit();
- contents()->TestDidNavigate(webui_rfh, 1, entry_id, true, url1,
+ contents()->TestDidNavigate(webui_rfh, entry_id, true, url1,
ui::PAGE_TRANSITION_TYPED);
NavigationEntry* entry1 = controller().GetLastCommittedEntry();
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -1294,7 +1268,7 @@
webui_rfh->PrepareForCommit();
// DidNavigate from the pending page.
- contents()->TestDidNavigate(google_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(google_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
NavigationEntry* entry2 = controller().GetLastCommittedEntry();
SiteInstance* instance2 = contents()->GetSiteInstance();
@@ -1316,7 +1290,7 @@
entry_id = controller().GetPendingEntry()->GetUniqueID();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(google_rfh, 2, entry_id, true, url3,
+ contents()->TestDidNavigate(google_rfh, entry_id, true, url3,
ui::PAGE_TRANSITION_TYPED);
NavigationEntry* entry3 = controller().GetLastCommittedEntry();
SiteInstance* instance3 = contents()->GetSiteInstance();
@@ -1342,14 +1316,14 @@
webui_rfh = contents()->GetPendingMainFrame();
// DidNavigate from the second back.
- contents()->TestDidNavigate(webui_rfh, 1, entry1->GetUniqueID(), false, url1,
+ contents()->TestDidNavigate(webui_rfh, entry1->GetUniqueID(), false, url1,
ui::PAGE_TRANSITION_TYPED);
// That should have landed us on the first entry.
EXPECT_EQ(entry1, controller().GetLastCommittedEntry());
// When the second back commits, it should be ignored.
- contents()->TestDidNavigate(google_rfh, 1, entry2->GetUniqueID(), false, url2,
+ contents()->TestDidNavigate(google_rfh, entry2->GetUniqueID(), false, url2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(entry1, controller().GetLastCommittedEntry());
}
@@ -1365,7 +1339,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -1378,7 +1352,7 @@
// Simulate a sub-frame navigation arriving and ensure the RVH is still
// waiting for a before unload response.
TestRenderFrameHost* child_rfh = orig_rfh->AppendChild("subframe");
- child_rfh->SendNavigateWithTransition(1, 0, false,
+ child_rfh->SendNavigateWithTransition(0, false,
GURL("http://google.com/frame"),
ui::PAGE_TRANSITION_AUTO_SUBFRAME);
EXPECT_TRUE(orig_rfh->is_waiting_for_beforeunload_ack());
@@ -1424,7 +1398,7 @@
// FrameMsg_Stop in flight. This should not cancel the pending navigation,
// but it should act as if the beforeunload ack arrived.
orig_rfh->SendNavigateWithModificationCallback(
- 1, entry1_id, true, url, base::Bind(SetAsNonUserGesture));
+ entry1_id, true, url, base::Bind(SetAsNonUserGesture));
EXPECT_TRUE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
EXPECT_FALSE(orig_rfh->is_waiting_for_beforeunload_ack());
@@ -1433,7 +1407,7 @@
EXPECT_EQ(url, controller().GetLastCommittedEntry()->GetURL());
// The pending navigation should be able to commit successfully.
- contents()->TestDidNavigate(pending_rfh, 1, entry2_id, true, url2,
+ contents()->TestDidNavigate(pending_rfh, entry2_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(pending_rfh, main_test_rfh());
@@ -1455,7 +1429,7 @@
// Committed entry should have page state after DidNavigate.
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
entry = controller().GetLastCommittedEntry();
EXPECT_TRUE(entry->GetPageState().IsValid());
@@ -1470,7 +1444,7 @@
// Committed entry should have page state after DidNavigate.
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 2, entry_id, true, url2,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
entry = controller().GetLastCommittedEntry();
EXPECT_TRUE(entry->GetPageState().IsValid());
@@ -1479,7 +1453,7 @@
controller().GoBack();
entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, false, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, false, url,
ui::PAGE_TRANSITION_TYPED);
entry = controller().GetLastCommittedEntry();
EXPECT_TRUE(entry->GetPageState().IsValid());
@@ -1494,7 +1468,7 @@
// Navigate to about:blank.
const GURL url(url::kAboutBlankURL);
orig_rfh->SendRendererInitiatedNavigationRequest(url, false);
- contents()->TestDidNavigate(orig_rfh, 1, 0, true, url,
+ contents()->TestDidNavigate(orig_rfh, 0, true, url,
ui::PAGE_TRANSITION_TYPED);
// Should have a page state here.
@@ -1515,7 +1489,7 @@
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 2, entry->GetUniqueID(), true, new_url,
+ contents()->TestDidNavigate(orig_rfh, entry->GetUniqueID(), true, new_url,
ui::PAGE_TRANSITION_TYPED);
NavigationEntryImpl* entry_impl2 = NavigationEntryImpl::FromNavigationEntry(
controller().GetLastCommittedEntry());
@@ -1536,7 +1510,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -1555,7 +1529,7 @@
entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
TestRenderFrameHost* const pending_rfh = contents()->GetPendingMainFrame();
- contents()->TestDidNavigate(pending_rfh, 1, entry_id, true, url2,
+ contents()->TestDidNavigate(pending_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
// Confirm fullscreen has exited.
@@ -1578,7 +1552,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -1589,7 +1563,7 @@
entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
- contents()->TestDidNavigate(orig_rfh, 2, entry_id, true, url2,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, url2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -1613,7 +1587,7 @@
orig_rfh->PrepareForCommit();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
- contents()->TestDidNavigate(orig_rfh, i + 1, entry_id, false, url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, false, url,
ui::PAGE_TRANSITION_FORWARD_BACK);
orig_rfh->SimulateNavigationStop();
@@ -1653,7 +1627,7 @@
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(main_test_rfh(), 1, entry_id, true,
+ contents()->TestDidNavigate(main_test_rfh(), entry_id, true,
url, ui::PAGE_TRANSITION_TYPED);
// Toggle fullscreen mode on (as if initiated via IPC from renderer).
@@ -1685,7 +1659,7 @@
ShowInterstitialFromBrowserWithNewNavigationDontProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Initiate a browser navigation that will trigger the interstitial.
@@ -1708,7 +1682,7 @@
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_TRUE(contents()->ShowingInterstitialPage());
EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
@@ -1737,7 +1711,7 @@
ShowInterstitialFromRendererWithNewNavigationDontProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial (no pending entry, the interstitial would have been
@@ -1756,7 +1730,7 @@
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_TRUE(contents()->ShowingInterstitialPage());
EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
@@ -1784,7 +1758,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialNoNewNavigationDontProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial.
@@ -1801,7 +1775,7 @@
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
- interstitial->TestDidNavigate(1, 0, true, url2);
+ interstitial->TestDidNavigate(0, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_TRUE(contents()->ShowingInterstitialPage());
EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
@@ -1831,7 +1805,7 @@
ShowInterstitialFromBrowserNewNavigationProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Initiate a browser navigation that will trigger the interstitial
@@ -1853,7 +1827,7 @@
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_TRUE(contents()->ShowingInterstitialPage());
EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
@@ -1874,7 +1848,7 @@
// hidden.
GURL url3("http://www.thepage.com");
main_test_rfh()->PrepareForCommit();
- main_test_rfh()->SendNavigate(2, 0, true, url3);
+ main_test_rfh()->SendNavigate(0, true, url3);
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
@@ -1895,7 +1869,7 @@
ShowInterstitialFromRendererNewNavigationProceed) {
// Navigate to a page.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial.
@@ -1913,7 +1887,7 @@
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_TRUE(contents()->ShowingInterstitialPage());
EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
@@ -1933,7 +1907,7 @@
// Simulate the navigation to the page, that's when the interstitial gets
// hidden.
GURL url3("http://www.thepage.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(2, true, url3);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url3);
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
@@ -1953,7 +1927,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialNoNewNavigationProceed) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial.
@@ -1970,7 +1944,7 @@
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
// Let's commit the interstitial navigation.
- interstitial->TestDidNavigate(1, 0, true, url2);
+ interstitial->TestDidNavigate(0, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_TRUE(contents()->ShowingInterstitialPage());
EXPECT_TRUE(contents()->GetInterstitialPage() == interstitial);
@@ -2008,11 +1982,11 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url);
// While interstitial showing, navigate to a new URL.
const GURL url2("http://www.yahoo.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url2);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url2);
EXPECT_EQ(TestInterstitialPage::CANCELED, state);
@@ -2024,7 +1998,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialThenGoBack) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show interstitial.
@@ -2038,7 +2012,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(2, interstitial_entry_id, true,
+ interstitial->TestDidNavigate(interstitial_entry_id, true,
interstitial_url);
EXPECT_EQ(2, controller().GetEntryCount());
@@ -2064,7 +2038,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialCrashRendererThenGoBack) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
NavigationEntry* entry = controller().GetLastCommittedEntry();
@@ -2079,7 +2053,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(2, interstitial_entry_id, true,
+ interstitial->TestDidNavigate(interstitial_entry_id, true,
interstitial_url);
// Crash the renderer
@@ -2106,7 +2080,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialCrashRendererThenNavigate) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show interstitial.
@@ -2124,7 +2098,7 @@
// Crash the renderer
main_test_rfh()->GetProcess()->SimulateCrash();
- interstitial->TestDidNavigate(2, interstitial_entry_id, true,
+ interstitial->TestDidNavigate(interstitial_entry_id, true,
interstitial_url);
}
@@ -2141,7 +2115,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url);
// Now close the contents.
DeleteContents();
@@ -2164,7 +2138,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url);
TestRenderFrameHost* rfh =
static_cast<TestRenderFrameHost*>(interstitial->GetMainFrame());
@@ -2186,7 +2160,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialProceedMultipleCommands) {
// Navigate to a page so we have a navigation entry in the controller.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial.
@@ -2199,7 +2173,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url2);
// Run a command.
EXPECT_EQ(0, interstitial->command_received_count());
@@ -2222,7 +2196,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialOnInterstitial) {
// Navigate to a page so we have a navigation entry in the controller.
GURL start_url("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, start_url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, start_url);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial.
@@ -2235,7 +2209,7 @@
TestInterstitialPageStateGuard state_guard1(interstitial1);
interstitial1->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial1->TestDidNavigate(1, interstitial_entry_id, true, url1);
+ interstitial1->TestDidNavigate(interstitial_entry_id, true, url1);
// Now show another interstitial.
TestInterstitialPage::InterstitialState state2 =
@@ -2247,7 +2221,7 @@
TestInterstitialPageStateGuard state_guard2(interstitial2);
interstitial2->Show();
interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial2->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial2->TestDidNavigate(interstitial_entry_id, true, url2);
// Showing interstitial2 should have caused interstitial1 to go away.
EXPECT_EQ(TestInterstitialPage::CANCELED, state1);
@@ -2260,7 +2234,7 @@
// Let's make sure interstitial2 is working as intended.
interstitial2->Proceed();
GURL landing_url("http://www.thepage.com");
- main_test_rfh()->SendNavigate(2, 0, true, landing_url);
+ main_test_rfh()->SendNavigate(0, true, landing_url);
EXPECT_FALSE(contents()->ShowingInterstitialPage());
EXPECT_EQ(nullptr, contents()->GetInterstitialPage());
@@ -2277,7 +2251,7 @@
TEST_F(WebContentsImplTest, ShowInterstitialProceedShowInterstitial) {
// Navigate to a page so we have a navigation entry in the controller.
GURL start_url("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, start_url);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, start_url);
EXPECT_EQ(1, controller().GetEntryCount());
// Show an interstitial.
@@ -2290,7 +2264,7 @@
TestInterstitialPageStateGuard state_guard1(interstitial1);
interstitial1->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial1->TestDidNavigate(1, interstitial_entry_id, true, url1);
+ interstitial1->TestDidNavigate(interstitial_entry_id, true, url1);
// Take action. The interstitial won't be hidden until the navigation is
// committed.
@@ -2308,7 +2282,7 @@
TestInterstitialPageStateGuard state_guard2(interstitial2);
interstitial2->Show();
interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial2->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial2->TestDidNavigate(interstitial_entry_id, true, url2);
// Showing interstitial2 should have caused interstitial1 to go away.
EXPECT_EQ(TestInterstitialPage::UNDECIDED, state2);
@@ -2319,7 +2293,7 @@
// Let's make sure interstitial2 is working as intended.
interstitial2->Proceed();
GURL landing_url("http://www.thepage.com");
- main_test_rfh()->SendNavigate(2, 0, true, landing_url);
+ main_test_rfh()->SendNavigate(0, true, landing_url);
RunAllPendingInMessageLoop();
EXPECT_TRUE(deleted2);
@@ -2356,7 +2330,7 @@
ASSERT_FALSE(deleted);
// Now let's make the interstitial navigation commit.
- interstitial->TestDidNavigate(1, interstitial_entry_id, true,
+ interstitial->TestDidNavigate(interstitial_entry_id, true,
interstitial_url);
// After it loaded the interstitial should be gone.
@@ -2403,7 +2377,7 @@
ASSERT_FALSE(deleted2);
// Make the interstitial navigation commit it should be showing.
- interstitial2->TestDidNavigate(1, interstitial_entry_id, true,
+ interstitial2->TestDidNavigate(interstitial_entry_id, true,
interstitial_url);
EXPECT_EQ(interstitial2, contents()->GetInterstitialPage());
}
@@ -2432,7 +2406,7 @@
new TestInterstitialPage(contents(), true, url, &state, &deleted);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url);
// Simulate a renderer crash.
interstitial->TestRenderViewTerminated(
base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
@@ -2462,7 +2436,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, kGURL);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, kGURL);
// Initiate a new navigation from the browser that also triggers an
// interstitial.
@@ -2476,7 +2450,7 @@
TestInterstitialPageStateGuard state_guard2(interstitial2);
interstitial2->Show();
interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial2->TestDidNavigate(1, interstitial_entry_id, true, kGURL);
+ interstitial2->TestDidNavigate(interstitial_entry_id, true, kGURL);
// Make sure we still have an entry.
NavigationEntry* entry = contents()->GetController().GetPendingEntry();
@@ -2503,7 +2477,7 @@
int entry_id = controller().GetPendingEntry()->GetUniqueID();
main_test_rfh()->PrepareForCommit();
// DidNavigate from the page
- contents()->TestDidNavigate(main_test_rfh(), 1, entry_id, true,
+ contents()->TestDidNavigate(main_test_rfh(), entry_id, true,
kGURL, ui::PAGE_TRANSITION_TYPED);
// Simulate showing an interstitial while the page is showing.
@@ -2515,7 +2489,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, kGURL);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, kGURL);
// While the interstitial is showing, let's simulate the hidden page
// attempting to show a JS message.
@@ -2532,7 +2506,7 @@
TEST_F(WebContentsImplTest, CopyStateFromAndPruneSourceInterstitial) {
// Navigate to a page.
GURL url1("http://www.google.com");
- main_test_rfh()->NavigateAndCommitRendererInitiated(1, true, url1);
+ main_test_rfh()->NavigateAndCommitRendererInitiated(true, url1);
EXPECT_EQ(1, controller().GetEntryCount());
// Initiate a browser navigation that will trigger the interstitial
@@ -2549,7 +2523,7 @@
TestInterstitialPageStateGuard state_guard(interstitial);
interstitial->Show();
int interstitial_entry_id = controller().GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url2);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url2);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_EQ(2, controller().GetEntryCount());
@@ -2600,7 +2574,7 @@
interstitial->Show();
int interstitial_entry_id =
other_controller.GetTransientEntry()->GetUniqueID();
- interstitial->TestDidNavigate(1, interstitial_entry_id, true, url3);
+ interstitial->TestDidNavigate(interstitial_entry_id, true, url3);
EXPECT_TRUE(interstitial->is_showing());
EXPECT_EQ(2, other_controller.GetEntryCount());
@@ -2936,7 +2910,7 @@
contents->GetMainFrame()->PrepareForCommit();
EXPECT_TRUE(contents->CrossProcessNavigationPending());
EXPECT_EQ(1u, instance->GetRelatedActiveContentsCount());
- contents->GetPendingMainFrame()->SendNavigate(1, entry_id, true, kUrl);
+ contents->GetPendingMainFrame()->SendNavigate(entry_id, true, kUrl);
EXPECT_EQ(1u, instance->GetRelatedActiveContentsCount());
contents.reset();
@@ -2981,7 +2955,7 @@
EXPECT_EQ(0u, instance_webui->GetRelatedActiveContentsCount());
// Commit and contents counts for the new one.
- contents->GetPendingMainFrame()->SendNavigate(1, entry_id, true, kWebUIUrl);
+ contents->GetPendingMainFrame()->SendNavigate(entry_id, true, kWebUIUrl);
EXPECT_EQ(0u, instance->GetRelatedActiveContentsCount());
EXPECT_EQ(1u, instance_webui->GetRelatedActiveContentsCount());
@@ -3052,7 +3026,7 @@
FrameHostMsg_DidStartLoading(orig_rfh->GetRoutingID(), false));
}
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, main_url,
+ contents()->TestDidNavigate(orig_rfh, entry_id, true, main_url,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(orig_rfh, main_test_rfh());
@@ -3069,7 +3043,7 @@
subframe->OnMessageReceived(
FrameHostMsg_DidStartLoading(subframe->GetRoutingID(), true));
}
- subframe->SendNavigateWithTransition(1, 0, false, initial_url,
+ subframe->SendNavigateWithTransition(0, false, initial_url,
ui::PAGE_TRANSITION_AUTO_SUBFRAME);
subframe->OnMessageReceived(
FrameHostMsg_DidStopLoading(subframe->GetRoutingID()));
@@ -3084,7 +3058,7 @@
subframe->OnMessageReceived(
FrameHostMsg_DidStartLoading(subframe->GetRoutingID(), true));
}
- subframe->SendNavigateWithTransition(1, 0, false, foo_url,
+ subframe->SendNavigateWithTransition(10, false, foo_url,
ui::PAGE_TRANSITION_AUTO_SUBFRAME);
subframe->OnMessageReceived(
FrameHostMsg_DidStopLoading(subframe->GetRoutingID()));
@@ -3120,7 +3094,7 @@
// Commit the navigation in the child frame and send the DidStopLoading
// message.
subframe->PrepareForCommit();
- contents()->TestDidNavigate(subframe, 3, entry_id, true, bar_url,
+ contents()->TestDidNavigate(subframe, entry_id, true, bar_url,
ui::PAGE_TRANSITION_MANUAL_SUBFRAME);
subframe->OnMessageReceived(
FrameHostMsg_DidStopLoading(subframe->GetRoutingID()));
@@ -3182,7 +3156,7 @@
// navigation in the current RenderFrameHost. There should still be a pending
// RenderFrameHost and the WebContents should still be loading.
current_rfh->SendNavigateWithModificationCallback(
- 1, 0, true, kUrl3, base::Bind(SetAsNonUserGesture));
+ 0, true, kUrl3, base::Bind(SetAsNonUserGesture));
current_rfh->OnMessageReceived(
FrameHostMsg_DidStopLoading(current_rfh->GetRoutingID()));
EXPECT_EQ(contents()->GetPendingMainFrame(), pending_rfh);
@@ -3193,7 +3167,7 @@
// Commit the navigation. The formerly pending RenderFrameHost should now be
// the current RenderFrameHost and the WebContents should still be loading.
- contents()->TestDidNavigate(pending_rfh, 1, entry_id, true, kUrl2,
+ contents()->TestDidNavigate(pending_rfh, entry_id, true, kUrl2,
ui::PAGE_TRANSITION_TYPED);
EXPECT_FALSE(contents()->GetPendingMainFrame());
TestRenderFrameHost* new_current_rfh = main_test_rfh();
@@ -3443,14 +3417,14 @@
contents()->SetJavaScriptDialogManagerForTesting(&dialog_manager);
// A user-initiated navigation.
- contents()->TestDidNavigate(main_test_rfh(), 1, 0, true,
+ contents()->TestDidNavigate(main_test_rfh(), 0, true,
GURL("about:whatever"),
ui::PAGE_TRANSITION_TYPED);
EXPECT_EQ(1u, dialog_manager.reset_count());
// An automatic navigation.
main_test_rfh()->SendNavigateWithModificationCallback(
- 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture));
+ 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture));
EXPECT_EQ(1u, dialog_manager.reset_count());
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 6c198ea..3e6ee6a5 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -201,7 +201,6 @@
IPC_STRUCT_END()
IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams)
- IPC_STRUCT_TRAITS_MEMBER(page_id)
IPC_STRUCT_TRAITS_MEMBER(nav_entry_id)
IPC_STRUCT_TRAITS_MEMBER(frame_unique_name)
IPC_STRUCT_TRAITS_MEMBER(item_sequence_number)
@@ -371,7 +370,6 @@
IPC_STRUCT_TRAITS_MEMBER(can_load_local_resources)
IPC_STRUCT_TRAITS_MEMBER(request_time)
IPC_STRUCT_TRAITS_MEMBER(page_state)
- IPC_STRUCT_TRAITS_MEMBER(page_id)
IPC_STRUCT_TRAITS_MEMBER(nav_entry_id)
IPC_STRUCT_TRAITS_MEMBER(is_same_document_history_load)
IPC_STRUCT_TRAITS_MEMBER(is_history_navigation_in_new_child)
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index 594bff8..ceea4aa 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -125,7 +125,6 @@
: is_overriding_user_agent(false),
can_load_local_resources(false),
request_time(base::Time::Now()),
- page_id(-1),
nav_entry_id(0),
is_same_document_history_load(false),
is_history_navigation_in_new_child(false),
@@ -146,7 +145,6 @@
bool can_load_local_resources,
base::Time request_time,
const PageState& page_state,
- int32_t page_id,
int nav_entry_id,
bool is_same_document_history_load,
bool is_history_navigation_in_new_child,
@@ -164,7 +162,6 @@
can_load_local_resources(can_load_local_resources),
request_time(request_time),
page_state(page_state),
- page_id(page_id),
nav_entry_id(nav_entry_id),
is_same_document_history_load(is_same_document_history_load),
is_history_navigation_in_new_child(is_history_navigation_in_new_child),
diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h
index 765d3cb..507082b8 100644
--- a/content/common/navigation_params.h
+++ b/content/common/navigation_params.h
@@ -219,7 +219,6 @@
bool can_load_local_resources,
base::Time request_time,
const PageState& page_state,
- int32_t page_id,
int nav_entry_id,
bool is_same_document_history_load,
bool is_history_navigation_in_new_child,
@@ -257,12 +256,6 @@
// Opaque history state (received by ViewHostMsg_UpdateState).
PageState page_state;
- // The page_id for this navigation, or -1 if it is a new navigation. Back,
- // Forward, and Reload navigations should have a valid page_id. If the load
- // succeeds, then this page_id will be reflected in the resultant
- // FrameHostMsg_DidCommitProvisionalLoad message.
- int32_t page_id;
-
// For browser-initiated navigations, this is the unique id of the
// NavigationEntry being navigated to. (For renderer-initiated navigations it
// is 0.) If the load succeeds, then this nav_entry_id will be reflected in
diff --git a/content/common/renderer.mojom b/content/common/renderer.mojom
index 80b1f2f..fcefa5a 100644
--- a/content/common/renderer.mojom
+++ b/content/common/renderer.mojom
@@ -54,11 +54,6 @@
// Whether the window associated with this view was created with an opener.
bool window_was_created_with_opener;
- // The initial page ID to use for this view, which must be larger than any
- // existing navigation that might be loaded in the view. Page IDs are unique
- // to a view and are only updated by the renderer after this initial value.
- int32 next_page_id;
-
// The initial renderer size.
ResizeParams initial_size;
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h
index 05758e4..c6f3cc1 100644
--- a/content/public/browser/navigation_controller.h
+++ b/content/public/browser/navigation_controller.h
@@ -391,14 +391,6 @@
// are migrated.
virtual SessionStorageNamespace* GetDefaultSessionStorageNamespace() = 0;
- // Sets the max restored page ID this NavigationController has seen, if it
- // was restored from a previous session.
- virtual void SetMaxRestoredPageID(int32_t max_id) = 0;
-
- // Returns the largest restored page ID seen in this navigation controller,
- // if it was restored from a previous session. (-1 otherwise)
- virtual int32_t GetMaxRestoredPageID() const = 0;
-
// Returns true if a reload happens when activated (SetActive(true) is
// invoked). This is true for session/tab restore, cloned tabs and tabs that
// requested a reload (using SetNeedsReload()) after their renderer was
diff --git a/content/public/browser/navigation_entry.h b/content/public/browser/navigation_entry.h
index 39e97d00..1d760c4d 100644
--- a/content/public/browser/navigation_entry.h
+++ b/content/public/browser/navigation_entry.h
@@ -105,12 +105,6 @@
virtual void SetPageState(const PageState& state) = 0;
virtual PageState GetPageState() const = 0;
- // Describes the current page that the tab represents. This is the ID that the
- // renderer generated for the page and is how we can tell new versus
- // renavigations.
- virtual void SetPageID(int page_id) = 0;
- virtual int32_t GetPageID() const = 0;
-
// Page-related helpers ------------------------------------------------------
// Returns the title to be displayed on the tab. This could be the title of
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index cab6bc96..3040b9b 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -331,16 +331,6 @@
virtual void UpdateTitleForEntry(NavigationEntry* entry,
const base::string16& title) = 0;
- // The max page ID for any page that the current SiteInstance has loaded in
- // this WebContents. Page IDs are specific to a given SiteInstance and
- // WebContents, corresponding to a specific RenderView in the renderer.
- // Page IDs increase with each new page that is loaded by a tab.
- virtual int32_t GetMaxPageID() = 0;
-
- // The max page ID for any page that the given SiteInstance has loaded in
- // this WebContents.
- virtual int32_t GetMaxPageIDForSiteInstance(SiteInstance* site_instance) = 0;
-
// Returns the SiteInstance associated with the current page.
virtual SiteInstance* GetSiteInstance() const = 0;
diff --git a/content/public/common/frame_navigate_params.cc b/content/public/common/frame_navigate_params.cc
index d15f4c1..c36c36c 100644
--- a/content/public/common/frame_navigate_params.cc
+++ b/content/public/common/frame_navigate_params.cc
@@ -7,8 +7,7 @@
namespace content {
FrameNavigateParams::FrameNavigateParams()
- : page_id(0),
- nav_entry_id(0),
+ : nav_entry_id(0),
item_sequence_number(-1),
document_sequence_number(-1),
transition(ui::PAGE_TRANSITION_LINK),
diff --git a/content/public/common/frame_navigate_params.h b/content/public/common/frame_navigate_params.h
index 49c039f3..620fc133 100644
--- a/content/public/common/frame_navigate_params.h
+++ b/content/public/common/frame_navigate_params.h
@@ -28,12 +28,6 @@
FrameNavigateParams(const FrameNavigateParams& other);
~FrameNavigateParams();
- // Page ID of this navigation. The renderer creates a new unique page ID
- // anytime a new session history entry is created. This means you'll get new
- // page IDs for user actions, and the old page IDs will be reloaded when
- // iframes are loaded automatically.
- int32_t page_id;
-
// The unique ID of the NavigationEntry for browser-initiated navigations.
// This value was given to the render process in the HistoryNavigationParams
// and is being returned by the renderer without it having any idea what it
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index 0a30fbe..40fcb26 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -302,7 +302,6 @@
view_params.proxy_routing_id = MSG_ROUTING_NONE;
view_params.hidden = false;
view_params.never_visible = false;
- view_params.next_page_id = 1;
view_params.initial_size = *InitialSizeParams();
view_params.enable_auto_resize = false;
view_params.min_size = gfx::Size();
@@ -650,7 +649,6 @@
LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr);
RequestNavigationParams request_params;
request_params.page_state = state;
- request_params.page_id = impl->page_id_ + offset;
request_params.nav_entry_id = pending_offset + 1;
request_params.pending_history_list_offset = pending_offset;
request_params.current_history_list_offset = impl->history_list_offset_;
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc
index 00490a1..01f729a 100644
--- a/content/public/test/test_renderer_host.cc
+++ b/content/public/test/test_renderer_host.cc
@@ -85,21 +85,14 @@
RenderFrameHost* test_rfh = pending_rfh ? pending_rfh : old_rfh;
RenderFrameHostTester* test_rfh_tester = For(test_rfh);
- // For new navigations, we need to send a larger page ID. For renavigations,
- // we need to send the preexisting page ID. We can tell these apart because
- // renavigations will have a pending_entry_index while new ones won't (they'll
- // just have a standalong pending_entry that isn't in the list already).
if (controller->GetPendingEntryIndex() >= 0) {
test_rfh_tester->SendNavigateWithTransition(
- controller->GetPendingEntry()->GetPageID(),
controller->GetPendingEntry()->GetUniqueID(),
false,
controller->GetPendingEntry()->GetURL(),
controller->GetPendingEntry()->GetTransitionType());
} else {
test_rfh_tester->SendNavigateWithTransition(
- controller->GetWebContents()->GetMaxPageIDForSiteInstance(
- test_rfh->GetSiteInstance()) + 1,
controller->GetPendingEntry()->GetUniqueID(),
true,
controller->GetPendingEntry()->GetURL(),
@@ -219,7 +212,7 @@
DCHECK(entry);
controller().Reload(false);
RenderFrameHostTester::For(main_rfh())
- ->SendNavigateWithTransition(entry->GetPageID(), entry->GetUniqueID(),
+ ->SendNavigateWithTransition(entry->GetUniqueID(),
false, entry->GetURL(),
ui::PAGE_TRANSITION_RELOAD);
}
@@ -229,8 +222,7 @@
DCHECK(entry);
controller().Reload(false);
RenderFrameHostTester::For(main_rfh())
- ->SendFailedNavigate(entry->GetPageID(), entry->GetUniqueID(), false,
- entry->GetURL());
+ ->SendFailedNavigate(entry->GetUniqueID(), false, entry->GetURL());
}
void RenderViewHostTestHarness::SetUp() {
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h
index 78266905..1529249 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -103,16 +103,13 @@
// - did_create_new_entry should be true if simulating a navigation that
// created a new navigation entry; false for history navigations, reloads,
// and other navigations that don't affect the history list.
- virtual void SendNavigate(int page_id,
- int nav_entry_id,
+ virtual void SendNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) = 0;
- virtual void SendFailedNavigate(int page_id,
- int nav_entry_id,
+ virtual void SendFailedNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) = 0;
- virtual void SendNavigateWithTransition(int page_id,
- int nav_entry_id,
+ virtual void SendNavigateWithTransition(int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) = 0;
@@ -129,8 +126,7 @@
virtual void SimulateSwapOutACK() = 0;
// Simulate a renderer-initiated navigation up until commit.
- virtual void NavigateAndCommitRendererInitiated(int page_id,
- bool did_create_new_entry,
+ virtual void NavigateAndCommitRendererInitiated(bool did_create_new_entry,
const GURL& url) = 0;
};
@@ -157,7 +153,6 @@
virtual bool CreateTestRenderView(const base::string16& frame_name,
int opener_frame_route_id,
int proxy_routing_id,
- int32_t max_page_id,
bool created_with_opener) = 0;
// Makes the WasHidden/WasShown calls to the RenderWidget that
diff --git a/content/public/test/web_contents_tester.h b/content/public/test/web_contents_tester.h
index 2e414ab..d5dd68f 100644
--- a/content/public/test/web_contents_tester.h
+++ b/content/public/test/web_contents_tester.h
@@ -106,13 +106,11 @@
// created a new navigation entry; false for history navigations, reloads,
// and other navigations that don't affect the history list.
virtual void TestDidNavigate(RenderFrameHost* render_frame_host,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) = 0;
virtual void TestDidNavigateWithReferrer(RenderFrameHost* render_frame_host,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 172f05c..88a5cd0d 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3577,18 +3577,7 @@
const RequestNavigationParams& request_params =
navigation_state->request_params();
bool is_new_navigation = commit_type == blink::WebStandardCommit;
-
- // Ensure that we allocate a page ID if this is the first navigation for the
- // page in this process. This can happen even when is_new_navigation
- // is false, such as after a cross-process location.replace navigation.
- bool should_init_page_id = render_view_->page_id_ == -1 &&
- request_params.page_id == -1 &&
- request_params.nav_entry_id != 0 &&
- !navigation_state->IsContentInitiated();
- if (is_new_navigation || should_init_page_id) {
- // We bump our Page ID to correspond with the new session history entry.
- render_view_->page_id_ = render_view_->next_page_id_++;
-
+ if (is_new_navigation) {
DCHECK(!navigation_state->common_params().should_replace_current_entry ||
render_view_->history_list_length_ > 0);
if (!navigation_state->common_params().should_replace_current_entry) {
@@ -3604,8 +3593,6 @@
if (request_params.nav_entry_id != 0 &&
!request_params.intended_as_new_entry) {
// This is a successful session history navigation!
- render_view_->page_id_ = request_params.page_id;
-
render_view_->history_list_offset_ =
request_params.pending_history_list_offset;
}
@@ -4732,7 +4719,6 @@
params.did_create_new_entry = commit_type == blink::WebStandardCommit;
params.should_replace_current_entry = ds->replacesCurrentHistoryItem();
params.post_id = -1;
- params.page_id = render_view_->page_id_;
params.nav_entry_id = navigation_state->request_params().nav_entry_id;
// We need to track the RenderViewHost routing_id because of downstream
// dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
@@ -5716,8 +5702,6 @@
}
should_load_request = true;
} else if (is_history_navigation) {
- // We must know the page ID of the page we are navigating back to.
- DCHECK_NE(request_params.page_id, -1);
// We must know the nav entry ID of the page we are navigating back to,
// which should be the case because history navigations are routed via the
// browser.
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index ccde429..119f8581 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -227,10 +227,6 @@
return static_cast<RenderViewImpl*>(view_);
}
- int view_page_id() {
- return view()->page_id_;
- }
-
TestRenderFrame* frame() {
return static_cast<TestRenderFrame*>(view()->GetMainRenderFrame());
}
@@ -244,7 +240,6 @@
int pending_offset = offset + view()->history_list_offset_;
request_params.page_state = state;
- request_params.page_id = view()->page_id_ + offset;
request_params.nav_entry_id = pending_offset + 1;
request_params.pending_history_list_offset = pending_offset;
request_params.current_history_list_offset = view()->history_list_offset_;
@@ -609,7 +604,6 @@
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
common_params.transition = ui::PAGE_TRANSITION_TYPED;
common_params.method = "POST";
- request_params.page_id = -1;
// Set up post data.
const char raw_data[] = "post \0\ndata";
@@ -1012,7 +1006,6 @@
request_params_C.current_history_list_length = 4;
request_params_C.current_history_list_offset = 3;
request_params_C.pending_history_list_offset = 2;
- request_params_C.page_id = 3;
request_params_C.page_state = state_C;
frame()->Navigate(common_params_C, StartNavigationParams(), request_params_C);
ProcessPendingMessages();
@@ -1022,7 +1015,7 @@
// This leads to two changes to the back/forward list but only one change to
// the RenderView's page ID.
- // Back to page B (page_id 2), without committing.
+ // Back to page B without committing.
CommonNavigationParams common_params_B;
RequestNavigationParams request_params_B;
common_params_B.navigation_type = FrameMsg_Navigate_Type::NORMAL;
@@ -1030,11 +1023,10 @@
request_params_B.current_history_list_length = 4;
request_params_B.current_history_list_offset = 2;
request_params_B.pending_history_list_offset = 1;
- request_params_B.page_id = 2;
request_params_B.page_state = state_B;
frame()->Navigate(common_params_B, StartNavigationParams(), request_params_B);
- // Back to page A (page_id 1) and commit.
+ // Back to page A and commit.
CommonNavigationParams common_params;
RequestNavigationParams request_params;
common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
@@ -1042,13 +1034,12 @@
request_params.current_history_list_length = 4;
request_params.current_history_list_offset = 2;
request_params.pending_history_list_offset = 0;
- request_params.page_id = 1;
request_params.page_state = state_A;
frame()->Navigate(common_params, StartNavigationParams(), request_params);
ProcessPendingMessages();
// Now ensure that the UpdateState message we receive is consistent
- // and represents page C in both page_id and state.
+ // and represents page C in state.
const IPC::Message* msg = render_thread_->sink().GetUniqueMessageMatching(
ViewHostMsg_UpdateState::ID);
ASSERT_TRUE(msg);
@@ -1733,7 +1724,6 @@
request_params.current_history_list_length = 1;
request_params.current_history_list_offset = 0;
request_params.pending_history_list_offset = 1;
- request_params.page_id = -1;
TestRenderFrame* subframe =
static_cast<TestRenderFrame*>(RenderFrameImpl::FromWebFrame(
@@ -2195,7 +2185,6 @@
RequestNavigationParams request_params;
request_params.page_state =
PageState::CreateForTesting(common_params.url, false, nullptr, nullptr);
- request_params.page_id = 1;
request_params.nav_entry_id = 42;
request_params.pending_history_list_offset = 1;
request_params.current_history_list_offset = 0;
@@ -2233,7 +2222,6 @@
request_params.current_history_list_length = 2;
request_params.current_history_list_offset = 1;
request_params.pending_history_list_offset = 2;
- request_params.page_id = -1;
frame()->Navigate(CommonNavigationParams(), StartNavigationParams(),
request_params);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 19562aa..42fc1eb 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -673,8 +673,6 @@
send_preferred_size_changes_(false),
navigation_gesture_(NavigationGestureUnknown),
opened_by_user_gesture_(true),
- page_id_(-1),
- next_page_id_(params.next_page_id),
history_list_offset_(-1),
history_list_length_(0),
frames_in_progress_(0),
@@ -712,9 +710,6 @@
display_mode_ = params.initial_size.display_mode;
- // Ensure we start with a valid next_page_id_ from the browser.
- DCHECK_GE(next_page_id_, 0);
-
webview_ =
WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden
: blink::WebPageVisibilityStateVisible);
@@ -1592,7 +1587,6 @@
view_params.replicated_frame_state = FrameReplicationState();
view_params.hidden = is_background_tab;
view_params.never_visible = never_visible;
- view_params.next_page_id = 1;
view_params.initial_size = initial_size;
view_params.enable_auto_resize = false;
view_params.min_size = gfx::Size();
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 4944cab9..ee2e21e3 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -747,13 +747,7 @@
// messages to send when the next |nav_state_sync_timer_| fires.
std::set<int> frames_with_pending_state_;
- // Page IDs ------------------------------------------------------------------
- // See documentation in RenderView.
- int32_t page_id_;
-
- // The next available page ID to use for this RenderView. These IDs are
- // specific to a given RenderView and the frames within it.
- int32_t next_page_id_;
+ // History list --------------------------------------------------------------
// The offset of the current item in the history list.
int history_list_offset_;
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index d94dce0..2aced69 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -82,7 +82,7 @@
if (!render_view_host()->IsRenderViewLive()) {
render_view_host()->GetProcess()->Init();
RenderViewHostTester::For(render_view_host())->CreateTestRenderView(
- base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false);
+ base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, false);
}
}
@@ -134,7 +134,6 @@
GetParent() && !frame_tree_node()->has_committed_real_load();
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = ComputeNextPageID();
params.nav_entry_id = 0;
params.url = url;
params.origin = url::Origin(url);
@@ -195,7 +194,6 @@
GURL error_url = GURL(kUnreachableWebDataURL);
OnDidStartProvisionalLoad(error_url, base::TimeTicks::Now());
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = ComputeNextPageID();
params.nav_entry_id = 0;
params.did_create_new_entry = true;
params.url = navigation_handle()->GetURL();
@@ -232,7 +230,6 @@
}
void TestRenderFrameHost::NavigateAndCommitRendererInitiated(
- int page_id,
bool did_create_new_entry,
const GURL& url) {
SendRendererInitiatedNavigationRequest(url, false);
@@ -244,58 +241,52 @@
bool browser_side_navigation = IsBrowserSideNavigationEnabled();
CHECK(!browser_side_navigation || is_loading());
CHECK(!browser_side_navigation || !frame_tree_node()->navigation_request());
- SendNavigate(page_id, 0, did_create_new_entry, url);
+ SendNavigate(0, did_create_new_entry, url);
}
-void TestRenderFrameHost::SendNavigate(int page_id,
- int nav_entry_id,
+void TestRenderFrameHost::SendNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) {
- SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, false,
+ SendNavigateWithParameters(nav_entry_id, did_create_new_entry, false,
url, ui::PAGE_TRANSITION_LINK, 200,
ModificationCallback());
}
-void TestRenderFrameHost::SendFailedNavigate(int page_id,
- int nav_entry_id,
+void TestRenderFrameHost::SendFailedNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) {
- SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, false,
+ SendNavigateWithParameters(nav_entry_id, did_create_new_entry, false,
url, ui::PAGE_TRANSITION_RELOAD, 500,
ModificationCallback());
}
void TestRenderFrameHost::SendNavigateWithTransition(
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) {
- SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, false,
+ SendNavigateWithParameters(nav_entry_id, did_create_new_entry, false,
url, transition, 200, ModificationCallback());
}
-void TestRenderFrameHost::SendNavigateWithReplacement(int page_id,
- int nav_entry_id,
+void TestRenderFrameHost::SendNavigateWithReplacement(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) {
- SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, true,
+ SendNavigateWithParameters(nav_entry_id, did_create_new_entry, true,
url, ui::PAGE_TRANSITION_LINK, 200,
ModificationCallback());
}
void TestRenderFrameHost::SendNavigateWithModificationCallback(
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
const ModificationCallback& callback) {
- SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, false,
+ SendNavigateWithParameters(nav_entry_id, did_create_new_entry, false,
url, ui::PAGE_TRANSITION_LINK, 200, callback);
}
void TestRenderFrameHost::SendNavigateWithParameters(
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
bool should_replace_entry,
@@ -313,7 +304,6 @@
SimulateWillStartRequest(transition);
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = page_id;
params.nav_entry_id = nav_entry_id;
params.url = url_copy;
params.transition = transition;
@@ -470,21 +460,6 @@
return service;
}
-int32_t TestRenderFrameHost::ComputeNextPageID() {
- const NavigationEntryImpl* entry = static_cast<NavigationEntryImpl*>(
- frame_tree_node()->navigator()->GetController()->GetPendingEntry());
- DCHECK(!(entry && entry->site_instance()) ||
- entry->site_instance() == GetSiteInstance());
- // Entry can be null when committing an error page (the pending entry was
- // cleared during DidFailProvisionalLoad).
- int page_id = entry ? entry->GetPageID() : -1;
- if (page_id == -1) {
- WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate());
- page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1;
- }
- return page_id;
-}
-
void TestRenderFrameHost::SimulateWillStartRequest(
ui::PageTransition transition) {
// PlzNavigate: NavigationHandle::WillStartRequest has already been called at
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h
index ed831ae..993282b 100644
--- a/content/test/test_render_frame_host.h
+++ b/content/test/test_render_frame_host.h
@@ -63,28 +63,23 @@
void SimulateNavigationError(const GURL& url, int error_code) override;
void SimulateNavigationErrorPageCommit() override;
void SimulateNavigationStop() override;
- void SendNavigate(int page_id,
- int nav_entry_id,
+ void SendNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) override;
- void SendFailedNavigate(int page_id,
- int nav_entry_id,
+ void SendFailedNavigate(int nav_entry_id,
bool did_create_new_entry,
const GURL& url) override;
- void SendNavigateWithTransition(int page_id,
- int nav_entry_id,
+ void SendNavigateWithTransition(int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) override;
void SetContentsMimeType(const std::string& mime_type) override;
void SendBeforeUnloadACK(bool proceed) override;
void SimulateSwapOutACK() override;
- void NavigateAndCommitRendererInitiated(int page_id,
- bool did_create_new_entry,
+ void NavigateAndCommitRendererInitiated(bool did_create_new_entry,
const GURL& url) override;
- void SendNavigateWithReplacement(int page_id,
- int nav_entry_id,
+ void SendNavigateWithReplacement(int nav_entry_id,
bool did_create_new_entry,
const GURL& url);
@@ -92,7 +87,6 @@
base::Callback<void(FrameHostMsg_DidCommitProvisionalLoad_Params*)>;
void SendNavigateWithModificationCallback(
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
@@ -145,8 +139,7 @@
WebBluetoothServiceImpl* CreateWebBluetoothServiceForTesting();
private:
- void SendNavigateWithParameters(int page_id,
- int nav_entry_id,
+ void SendNavigateWithParameters(int nav_entry_id,
bool did_create_new_entry,
bool should_replace_entry,
const GURL& url,
diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc
index 56ffa6a..30c55965 100644
--- a/content/test/test_render_view_host.cc
+++ b/content/test/test_render_view_host.cc
@@ -40,12 +40,10 @@
namespace content {
void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) {
- params->page_id = page_id;
params->nav_entry_id = nav_entry_id;
params->url = url;
params->referrer = Referrer();
@@ -257,18 +255,16 @@
const base::string16& frame_name,
int opener_frame_route_id,
int proxy_route_id,
- int32_t max_page_id,
bool window_was_created_with_opener) {
FrameReplicationState replicated_state;
replicated_state.name = base::UTF16ToUTF8(frame_name);
- return CreateRenderView(opener_frame_route_id, proxy_route_id, max_page_id,
+ return CreateRenderView(opener_frame_route_id, proxy_route_id,
replicated_state, window_was_created_with_opener);
}
bool TestRenderViewHost::CreateRenderView(
int opener_frame_route_id,
int proxy_route_id,
- int32_t max_page_id,
const FrameReplicationState& replicated_frame_state,
bool window_was_created_with_opener) {
DCHECK(!IsRenderViewLive());
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h
index 8b215f61..5a0835f 100644
--- a/content/test/test_render_view_host.h
+++ b/content/test/test_render_view_host.h
@@ -48,7 +48,6 @@
// Utility function to initialize FrameHostMsg_DidCommitProvisionalLoad_Params
// with given parameters.
void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
@@ -215,22 +214,19 @@
bool CreateTestRenderView(const base::string16& frame_name,
int opener_frame_route_id,
int proxy_route_id,
- int32_t max_page_id,
bool window_was_created_with_opener) override;
// RenderViewHost overrides --------------------------------------------------
bool CreateRenderView(int opener_frame_route_id,
int proxy_route_id,
- int32_t max_page_id,
const FrameReplicationState& replicated_frame_state,
bool window_was_created_with_opener) override;
private:
FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate);
- void SendNavigateWithTransitionAndResponseCode(int page_id,
- const GURL& url,
+ void SendNavigateWithTransitionAndResponseCode(const GURL& url,
ui::PageTransition transition,
int response_code);
@@ -238,7 +234,6 @@
// Sets the rest of the parameters in the message to the "typical" values.
// This is a helper function for simulating the most common types of loads.
void SendNavigateWithParameters(
- int page_id,
const GURL& url,
ui::PageTransition transition,
const GURL& original_request_url,
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 5d496f4..2fc9900 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -97,13 +97,11 @@
}
void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) {
TestDidNavigateWithReferrer(render_frame_host,
- page_id,
nav_entry_id,
did_create_new_entry,
url,
@@ -113,7 +111,6 @@
void TestWebContents::TestDidNavigateWithReferrer(
RenderFrameHost* render_frame_host,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
@@ -128,7 +125,6 @@
FrameHostMsg_DidCommitProvisionalLoad_Params params;
- params.page_id = page_id;
params.nav_entry_id = nav_entry_id;
params.url = url;
params.referrer = referrer;
@@ -163,10 +159,9 @@
int opener_frame_routing_id,
int proxy_routing_id,
const FrameReplicationState& replicated_frame_state) {
- UpdateMaxPageIDIfNecessary(render_view_host);
// This will go to a TestRenderViewHost.
static_cast<RenderViewHostImpl*>(render_view_host)
- ->CreateRenderView(opener_frame_routing_id, proxy_routing_id, -1,
+ ->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
replicated_frame_state, false);
return true;
}
@@ -243,13 +238,7 @@
CHECK(!browser_side_navigation ||
!rfh->frame_tree_node()->navigation_request());
- int page_id = entry->GetPageID();
- if (page_id == -1) {
- // It's a new navigation, assign a never-seen page id to it.
- page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1;
- }
-
- rfh->SendNavigateWithTransition(page_id, entry->GetUniqueID(),
+ rfh->SendNavigateWithTransition(entry->GetUniqueID(),
GetController().GetPendingEntryIndex() == -1,
entry->GetURL(), entry->GetTransitionType());
// Simulate the SwapOut_ACK. This is needed when cross-site navigation
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h
index 92baea0..05ca1b9 100644
--- a/content/test/test_web_contents.h
+++ b/content/test/test_web_contents.h
@@ -54,13 +54,11 @@
void TestSetIsLoading(bool value) override;
void ProceedWithCrossSiteNavigation() override;
void TestDidNavigate(RenderFrameHost* render_frame_host,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,
ui::PageTransition transition) override;
void TestDidNavigateWithReferrer(RenderFrameHost* render_frame_host,
- int page_id,
int nav_entry_id,
bool did_create_new_entry,
const GURL& url,