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

Unified Diff: chrome/browser/sync/chrome_sync_client.cc

Issue 2723953002: [sync] skeleton implementation of TypedURLSyncBridge (Closed)
Patch Set: Created 3 years, 10 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/chrome_sync_client.cc
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc
index 295fdfb8744f2e644e06eb11f0344dbc64232807..a7fa143973cc1624f35376e1eefa465af2111b26 100644
--- a/chrome/browser/sync/chrome_sync_client.cc
+++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -456,6 +456,17 @@ ChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) {
->GetSyncBridge()
->AsWeakPtr();
#endif
+ case syncer::TYPED_URLS: {
+ // We request history service with explicit access here because this
+ // codepath is executed on backend thread while HistoryServiceFactory
skym 2017/03/03 17:41:09 I'm not sure I agree with you that the way the cod
Gang Wu 2017/03/06 08:21:23 Done.
+ // checks preference value in implicit mode and PrefService expectes calls
+ // only from UI thread.
+ history::HistoryService* history = HistoryServiceFactory::GetForProfile(
+ profile_, ServiceAccessType::EXPLICIT_ACCESS);
+ if (!history)
+ return base::WeakPtr<history::TypedURLSyncBridge>();
+ return history->GetTypedURLSyncBridge()->AsWeakPtr();
+ }
default:
NOTREACHED();
return base::WeakPtr<syncer::ModelTypeSyncBridge>();

Powered by Google App Engine
This is Rietveld 408576698