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

Unified Diff: chrome/browser/history/history_tab_helper.cc

Issue 823273003: Switch the history backend from using page ids to navigation entry unique ids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/history_tab_helper.cc
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 8a40bf4eeb3b5ddc3464d5ee9b7d9b1ce52b410f..6eeb49ed710b4f7bca4bdf755be675c4b58f4391 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -56,9 +56,10 @@ HistoryTabHelper::CreateHistoryAddPageArgs(
const GURL& virtual_url,
base::Time timestamp,
bool did_replace_entry,
+ int nav_entry_id,
const content::FrameNavigateParams& params) {
history::HistoryAddPageArgs add_page_args(
- params.url, timestamp, web_contents(), params.page_id,
+ params.url, timestamp, web_contents(), nav_entry_id,
params.referrer.url, params.redirects, params.transition,
history::SOURCE_BROWSED, did_replace_entry);
if (ui::PageTransitionIsMainFrame(params.transition) &&
@@ -96,10 +97,12 @@ void HistoryTabHelper::DidNavigateAnyFrame(
// URLs, we use a data: URL as the real value. We actually want to save the
// about: URL to the history db and keep the data: URL hidden. This is what
// the WebContents' URL getter does.
+ NavigationEntry* last_committed =
+ web_contents()->GetController().GetLastCommittedEntry();
const history::HistoryAddPageArgs& add_page_args =
CreateHistoryAddPageArgs(
web_contents()->GetURL(), details.entry->GetTimestamp(),
- details.did_replace_entry, params);
+ details.did_replace_entry, last_committed->GetUniqueID(), params);
prerender::PrerenderManager* prerender_manager =
prerender::PrerenderManagerFactory::GetForProfile(
@@ -155,7 +158,7 @@ void HistoryTabHelper::WebContentsDestroyed() {
if (hs) {
NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
if (entry) {
- hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(),
+ hs->UpdateWithPageEndTime(tab, entry->GetUniqueID(), tab->GetURL(),
base::Time::Now());
}
hs->ClearCachedDataForContextID(tab);
« no previous file with comments | « chrome/browser/history/history_tab_helper.h ('k') | chrome/browser/sync/test/integration/typed_urls_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698