summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorskym <skym@chromium.org>2016-02-11 11:42:01 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-11 19:43:46 +0000
commit0f0f3981f6ca07546cd9208c202ee512d4c807ba (patch)
tree3d01862269aafa68e552f96906f29217517c0f86 /sync
parentb59e556f58dd7f7d7e3cfd80d5be38359ec72cee (diff)
downloadchromium_src-0f0f3981f6ca07546cd9208c202ee512d4c807ba.zip
chromium_src-0f0f3981f6ca07546cd9208c202ee512d4c807ba.tar.gz
chromium_src-0f0f3981f6ca07546cd9208c202ee512d4c807ba.tar.bz2
[Sync] DeviceInfoService now gives metadata to processor during init.
BUG=543406, 582460 Review URL: https://codereview.chromium.org/1686833004 Cr-Commit-Position: refs/heads/master@{#374928}
Diffstat (limited to 'sync')
-rw-r--r--sync/api/model_type_service.cc1
-rw-r--r--sync/api/model_type_service.h5
-rw-r--r--sync/internal_api/public/test/fake_model_type_service.h2
-rw-r--r--sync/internal_api/test/fake_model_type_service.cc2
4 files changed, 10 insertions, 0 deletions
diff --git a/sync/api/model_type_service.cc b/sync/api/model_type_service.cc
index 0510f7f..87df14b 100644
--- a/sync/api/model_type_service.cc
+++ b/sync/api/model_type_service.cc
@@ -18,6 +18,7 @@ void ModelTypeService::set_change_processor(
scoped_ptr<ModelTypeChangeProcessor> change_processor) {
DCHECK(!change_processor_);
change_processor_.swap(change_processor);
+ OnChangeProcessorSet();
}
void ModelTypeService::clear_change_processor() {
diff --git a/sync/api/model_type_service.h b/sync/api/model_type_service.h
index a366276..a2ec808 100644
--- a/sync/api/model_type_service.h
+++ b/sync/api/model_type_service.h
@@ -63,6 +63,11 @@ class SYNC_EXPORT ModelTypeService {
// Get or generate a client tag for |entity_data|.
virtual std::string GetClientTag(const EntityData& entity_data) = 0;
+ // Overridable notification for when the processor is set. This is typically
+ // when the service should start loading metadata and then subsequently giving
+ // it to the processor.
+ virtual void OnChangeProcessorSet() = 0;
+
// TODO(skym): See crbug/547087, do we need all these accessors?
ModelTypeChangeProcessor* change_processor() const;
diff --git a/sync/internal_api/public/test/fake_model_type_service.h b/sync/internal_api/public/test/fake_model_type_service.h
index cb51acc..6587203 100644
--- a/sync/internal_api/public/test/fake_model_type_service.h
+++ b/sync/internal_api/public/test/fake_model_type_service.h
@@ -37,6 +37,8 @@ class FakeModelTypeService : public ModelTypeService {
void GetAllData(DataCallback callback) override;
std::string GetClientTag(const EntityData& entity_data) override;
+
+ void OnChangeProcessorSet() override;
};
} // namespace syncer_v2
diff --git a/sync/internal_api/test/fake_model_type_service.cc b/sync/internal_api/test/fake_model_type_service.cc
index 0c894c5..999d501 100644
--- a/sync/internal_api/test/fake_model_type_service.cc
+++ b/sync/internal_api/test/fake_model_type_service.cc
@@ -36,4 +36,6 @@ std::string FakeModelTypeService::GetClientTag(const EntityData& entity_data) {
return std::string();
}
+void FakeModelTypeService::OnChangeProcessorSet() {}
+
} // namespace syncer_v2