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

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

Issue 1087773002: Sync typed urls with typed_cont() == 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 5 years, 8 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 92b0d06ca0bd11d7f538a2b5478a07adaef8443e..f5733159d6003db408d34ee7320d16f221f01a07 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -89,7 +89,7 @@ void TypedUrlChangeProcessor::OnURLsModified(
DVLOG(1) << "Observed typed_url change.";
syncer::WriteTransaction trans(FROM_HERE, share_handle());
for (const auto& row : changed_urls) {
- if (row.typed_count() > 0) {
+ if (row.typed_count() >= 0) {
// If there were any errors updating the sync node, just ignore them and
// continue on to process the next URL.
CreateOrUpdateSyncNode(row, &trans);
@@ -149,7 +149,7 @@ void TypedUrlChangeProcessor::OnURLsDeleted(
bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode(
history::URLRow url, syncer::WriteTransaction* trans) {
- DCHECK_GT(url.typed_count(), 0);
+ DCHECK_GE(url.typed_count(), 0);
// Get the visits for this node.
history::VisitVector visit_vector;
if (!model_associator_->FixupURLAndGetVisits(&url, &visit_vector)) {
@@ -216,7 +216,7 @@ bool TypedUrlChangeProcessor::ShouldSyncVisit(int typed_count,
// tend to be more broadly distributed such that there's no need to sync up
// every visit to preserve their relative ordering.
return (ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED) &&
- typed_count > 0 &&
+ typed_count >= 0 &&
(typed_count < kTypedUrlVisitThrottleThreshold ||
(typed_count % kTypedUrlVisitThrottleMultiple) == 0));
}

Powered by Google App Engine
This is Rietveld 408576698