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

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

Issue 7104088: Changed typed url sync to no longer modify typed/visit_count. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated per review comments. Created 9 years, 6 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
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index b854a30e5ad449b067b2ca60015d3eb39827c229..a61cfabf4a536927ec54a372669bc697bbe71974 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -785,18 +785,21 @@ void HistoryBackend::AddPagesWithDetails(const std::vector<URLRow>& urls,
i->title(), string16());
}
- // Make up a visit to correspond to that page.
- VisitRow visit_info(url_id, i->last_visit(), 0,
- PageTransition::LINK | PageTransition::CHAIN_START |
- PageTransition::CHAIN_END, 0);
- visit_info.is_indexed = has_indexed;
- if (!visit_database->AddVisit(&visit_info, visit_source)) {
- NOTREACHED() << "Adding visit failed.";
- return;
- }
+ // Sync code manages the visits itself.
+ if (visit_source != SOURCE_SYNCED) {
+ // Make up a visit to correspond to the last visit to the page.
+ VisitRow visit_info(url_id, i->last_visit(), 0,
+ PageTransition::LINK | PageTransition::CHAIN_START |
+ PageTransition::CHAIN_END, 0);
+ visit_info.is_indexed = has_indexed;
+ if (!visit_database->AddVisit(&visit_info, visit_source)) {
+ NOTREACHED() << "Adding visit failed.";
+ return;
+ }
- if (visit_info.visit_time < first_recorded_time_)
- first_recorded_time_ = visit_info.visit_time;
+ if (visit_info.visit_time < first_recorded_time_)
+ first_recorded_time_ = visit_info.visit_time;
+ }
}
// Broadcast a notification for typed URLs that have been modified. This
@@ -924,12 +927,13 @@ bool HistoryBackend::UpdateURL(URLID id, const history::URLRow& url) {
}
bool HistoryBackend::AddVisits(const GURL& url,
- const std::vector<base::Time>& visits,
+ const std::vector<VisitInfo>& visits,
VisitSource visit_source) {
if (db_.get()) {
- for (std::vector<base::Time>::const_iterator visit = visits.begin();
+ for (std::vector<VisitInfo>::const_iterator visit = visits.begin();
visit != visits.end(); ++visit) {
- if (!AddPageVisit(url, *visit, 0, 0, visit_source).first) {
+ if (!AddPageVisit(
+ url, visit->first, 0, visit->second, visit_source).first) {
return false;
}
}
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698