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

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

Issue 1126633005: Don't create a sync node when updating an URL that wasn't typed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 49f07fe102cdaaeed08adc1994c219294f4a4f06..044ac504a4dfd7087a42b6085bc1dbe88b78ea0a 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -157,6 +157,14 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode(
return false;
}
+ if (std::find_if(visit_vector.begin(), visit_vector.end(),
maniscalco 2015/05/08 19:38:00 Question about performance. How big does visit_ve
mpawlowski 2015/05/11 09:27:18 Good point, I've checked with an old profile with
+ [](const history::VisitRow& visit) {
+ return ui::PageTransitionCoreTypeIs(
+ visit.transition, ui::PAGE_TRANSITION_TYPED);
+ }) == visit_vector.end())
+ // This URL has no TYPED visits, don't sync it.
+ return false;
+
syncer::ReadNode typed_url_root(trans);
if (typed_url_root.InitTypeRoot(syncer::TYPED_URLS) !=
syncer::BaseNode::INIT_OK) {

Powered by Google App Engine
This is Rietveld 408576698