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

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

Issue 6111012: sync: avoid creating a HistoryModelWorker unless it is needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: fix test Created 9 years, 11 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 | chrome/browser/sync/profile_sync_service_password_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 4dafe249d9d0a50de14532a140b73c135cfdcf2f..ed363fc01934de792ca7a2be6b851c2addcd6975 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -97,12 +97,18 @@ void SyncBackendHost::Initialize(
// when a new type is synced as the worker may already exist and you just
// need to update routing_info_.
registrar_.workers[GROUP_DB] = new DatabaseModelWorker();
- registrar_.workers[GROUP_HISTORY] =
- new HistoryModelWorker(
- profile_->GetHistoryService(Profile::IMPLICIT_ACCESS));
registrar_.workers[GROUP_UI] = new UIModelWorker(frontend_loop_);
registrar_.workers[GROUP_PASSIVE] = new ModelSafeWorker();
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableSyncTypedUrls) || types.count(syncable::TYPED_URLS)) {
+ // TODO(tim): Bug 53916. HistoryModelWorker crashes, so avoid adding it
+ // unless specifically requested until bug is fixed.
+ registrar_.workers[GROUP_HISTORY] =
+ new HistoryModelWorker(
+ profile_->GetHistoryService(Profile::IMPLICIT_ACCESS));
+ }
+
PasswordStore* password_store =
profile_->GetPasswordStore(Profile::IMPLICIT_ACCESS);
if (password_store) {
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_password_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698