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

Unified Diff: sync/api/model_type_service.cc

Issue 1763953002: [USS] Change the place where SharedModelTypeProcessor got created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: sync/api/model_type_service.cc
diff --git a/sync/api/model_type_service.cc b/sync/api/model_type_service.cc
index 87df14bf6011dc559b98e90082d0e2d29f1235d7..1918db98e45a465e7fd9909367b0b9fa586da17c 100644
--- a/sync/api/model_type_service.cc
+++ b/sync/api/model_type_service.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "sync/api/model_type_service.h"
+#include "sync/internal_api/public/shared_model_type_processor.h"
namespace syncer_v2 {
@@ -14,13 +15,17 @@ ModelTypeChangeProcessor* ModelTypeService::change_processor() const {
return change_processor_.get();
}
-void ModelTypeService::set_change_processor(
- scoped_ptr<ModelTypeChangeProcessor> change_processor) {
- DCHECK(!change_processor_);
- change_processor_.swap(change_processor);
+void ModelTypeService::InitializeProcessor(syncer::ModelType type) {
+ DCHECK(!change_processor_.get());
+ change_processor_.reset(CreateSharedModelTypeProcessor(type).release());
OnChangeProcessorSet();
}
+scoped_ptr<SharedModelTypeProcessor>
+ModelTypeService::CreateSharedModelTypeProcessor(syncer::ModelType type) {
+ return make_scoped_ptr(new syncer_v2::SharedModelTypeProcessor(type, this));
+}
+
void ModelTypeService::clear_change_processor() {
change_processor_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698