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

Unified Diff: chrome/browser/sync/glue/typed_url_change_processor.cc

Issue 8289026: Correctly handle expired and truncated visits in typed url sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a bunch of debug statements/unrelated test code Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/typed_url_change_processor.cc
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index 9ed54a339a28c45b158d0a0761b486a4c1f5cfbe..ded3076d5d70834d4d43d09794a9cbcb8c9728aa 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -96,6 +96,7 @@ void TypedUrlChangeProcessor::HandleURLsModified(
bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode(
history::URLRow url, sync_api::WriteTransaction* trans) {
+ DCHECK(url.typed_count() > 0);
// Get the visits for this node.
history::VisitVector visit_vector;
if (!TypedUrlModelAssociator::FixupURLAndGetVisits(
@@ -185,6 +186,7 @@ bool TypedUrlChangeProcessor::ShouldSyncVisit(
// tend to be more broadly distributed such that there's no need to sync up
// every visit to preserve their relative ordering.
return (transition == content::PAGE_TRANSITION_TYPED &&
+ typed_count > 0 &&
(typed_count < kTypedUrlVisitThrottleThreshold ||
(typed_count % kTypedUrlVisitThrottleMultiple) == 0));
}

Powered by Google App Engine
This is Rietveld 408576698