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

Unified Diff: components/history/core/browser/typed_url_syncable_service.cc

Issue 2176893002: [Sync] Ignore urls which contain username/password (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comments Created 4 years, 5 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 | « no previous file | components/history/core/browser/typed_url_syncable_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/typed_url_syncable_service.cc
diff --git a/components/history/core/browser/typed_url_syncable_service.cc b/components/history/core/browser/typed_url_syncable_service.cc
index b152df15538f73e9dc7b26a6d43dcf58fb42731f..018bf14e782d3931e62f3f1ce2ace2d2a172d20f 100644
--- a/components/history/core/browser/typed_url_syncable_service.cc
+++ b/components/history/core/browser/typed_url_syncable_service.cc
@@ -150,6 +150,9 @@ syncer::SyncMergeResult TypedUrlSyncableService::MergeDataAndStartSyncing(
const sync_pb::EntitySpecifics& specifics = sync_iter->GetSpecifics();
const sync_pb::TypedUrlSpecifics& typed_url(specifics.typed_url());
+ if (ShouldIgnoreUrl(GURL(typed_url.url())))
+ continue;
+
// Add url to cache of sync state. Note that this is done irrespective of
// whether the synced url is ignored locally, so that we know what to delete
// at a later point.
@@ -747,6 +750,12 @@ bool TypedUrlSyncableService::ShouldIgnoreUrl(const GURL& url) {
if (net::IsLocalhost(url.host()))
return true;
+ // Ignore username and password, sonce history backend will remove user name
+ // and password in URLDatabase::GURLToDatabaseURL and send username/password
+ // removed url to sync later.
+ if (url.has_username() || url.has_password())
+ return true;
+
return false;
}
« no previous file with comments | « no previous file | components/history/core/browser/typed_url_syncable_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698