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

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

Issue 10825137: FYI: Control Data + Per-Device Metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add PER_USER_METADATA, refactor some encryption code Created 8 years, 4 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/sync_backend_registrar.cc
diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc
index 4cd91b7adb93ac4b2a099866325c7c9a98c39c48..e9725dec8e24741453569fd9b7d7d82a89979970 100644
--- a/chrome/browser/sync/glue/sync_backend_registrar.cc
+++ b/chrome/browser/sync/glue/sync_backend_registrar.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/sync/glue/password_model_worker.h"
#include "chrome/browser/sync/glue/ui_model_worker.h"
#include "content/public/browser/browser_thread.h"
+#include "sync/internal_api/public/engine/control_model_worker.h"
#include "sync/internal_api/public/engine/passive_model_worker.h"
using content::BrowserThread;
@@ -33,6 +34,8 @@ bool IsOnThreadForGroup(syncer::ModelSafeGroup group) {
switch (group) {
case syncer::GROUP_PASSIVE:
return false;
+ case syncer::GROUP_CONTROL:
+ return false;
case syncer::GROUP_UI:
return BrowserThread::CurrentlyOn(BrowserThread::UI);
case syncer::GROUP_DB:
@@ -68,6 +71,7 @@ SyncBackendRegistrar::SyncBackendRegistrar(
workers_[syncer::GROUP_FILE] = new FileModelWorker();
workers_[syncer::GROUP_UI] = ui_worker_;
workers_[syncer::GROUP_PASSIVE] = new syncer::PassiveModelWorker(sync_loop_);
+ workers_[syncer::GROUP_CONTROL] = new syncer::ControlModelWorker(sync_loop_);
rlarocque 2012/08/11 01:31:52 There's a DCHECK in the PassiveModelWorker that pr
HistoryService* history_service =
HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
@@ -95,7 +99,11 @@ void SyncBackendRegistrar::SetInitialTypes(syncer::ModelTypeSet initial_types) {
// return correct results.
for (syncer::ModelTypeSet::Iterator it = initial_types.First();
it.Good(); it.Inc()) {
- routing_info_[it.Get()] = syncer::GROUP_PASSIVE;
+ if (IsControlType(it.Get())) {
+ routing_info_[it.Get()] = syncer::GROUP_CONTROL;
+ } else {
+ routing_info_[it.Get()] = syncer::GROUP_PASSIVE;
+ }
}
if (!workers_.count(syncer::GROUP_HISTORY)) {
@@ -145,7 +153,11 @@ syncer::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes(
// Add a newly specified data type as syncer::GROUP_PASSIVE into the
// routing_info, if it does not already exist.
if (routing_info_.count(it.Get()) == 0) {
- routing_info_[it.Get()] = syncer::GROUP_PASSIVE;
+ if (IsControlType(it.Get())) {
+ routing_info_[it.Get()] = syncer::GROUP_CONTROL;
+ } else {
+ routing_info_[it.Get()] = syncer::GROUP_PASSIVE;
+ }
newly_added_types.Put(it.Get());
}
}

Powered by Google App Engine
This is Rietveld 408576698