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

Unified Diff: sync/api/model_type_service.h

Issue 1763953002: [USS] Change the place where SharedModelTypeProcessor got created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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 | « sync/api/model_type_change_processor.h ('k') | sync/api/model_type_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/model_type_service.h
diff --git a/sync/api/model_type_service.h b/sync/api/model_type_service.h
index bba4211ffe47af84dfff1f733272dad5d594dcca..59579ad2c7f5f71708bb0f0a0b25972aceb63299 100644
--- a/sync/api/model_type_service.h
+++ b/sync/api/model_type_service.h
@@ -15,6 +15,7 @@
#include "sync/api/model_type_change_processor.h"
#include "sync/api/sync_error.h"
#include "sync/base/sync_export.h"
+#include "sync/internal_api/public/activation_context.h"
namespace syncer_v2 {
@@ -29,8 +30,13 @@ class SYNC_EXPORT ModelTypeService {
typedef base::Callback<void(syncer::SyncError, scoped_ptr<DataBatch>)>
DataCallback;
typedef std::vector<std::string> ClientTagList;
+ typedef base::Callback<scoped_ptr<ModelTypeChangeProcessor>(
+ syncer::ModelType,
+ ModelTypeService* service)>
+ ChangeProcessorFactory;
- ModelTypeService();
+ ModelTypeService(const ChangeProcessorFactory& change_processor_factory,
+ syncer::ModelType type);
virtual ~ModelTypeService();
@@ -78,17 +84,26 @@ class SYNC_EXPORT ModelTypeService {
// it to the processor.
virtual void OnChangeProcessorSet() = 0;
+ void clear_change_processor();
+
+ ModelTypeChangeProcessor* OnSyncStarting(
+ const ModelTypeChangeProcessor::StartCallback& callback);
+
+ protected:
// TODO(skym): See crbug/547087, do we need all these accessors?
ModelTypeChangeProcessor* change_processor() const;
- void set_change_processor(
- scoped_ptr<ModelTypeChangeProcessor> change_processor);
+ ModelTypeChangeProcessor* GetOrCreateChangeProcessor();
- void clear_change_processor();
+ // Model type for this service.
+ syncer::ModelType type() const;
private:
- // Recieves ownership in set_change_processor(...).
scoped_ptr<ModelTypeChangeProcessor> change_processor_;
+
+ ChangeProcessorFactory change_processor_factory_;
+
+ const syncer::ModelType type_;
};
} // namespace syncer_v2
« no previous file with comments | « sync/api/model_type_change_processor.h ('k') | sync/api/model_type_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698