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

Unified Diff: components/sync/model_impl/shared_model_type_processor.cc

Issue 2406163006: [Sync] Services can now always assume processor exists. (Closed)
Patch Set: Updates for Max. Created 4 years, 2 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: components/sync/model_impl/shared_model_type_processor.cc
diff --git a/components/sync/model_impl/shared_model_type_processor.cc b/components/sync/model_impl/shared_model_type_processor.cc
index 9aac0477bc9a843eb2ce94cf5da9f6a738e76b62..06d0a1a99d0d9d035fe5fa8f2e370dbc6c41990a 100644
--- a/components/sync/model_impl/shared_model_type_processor.cc
+++ b/components/sync/model_impl/shared_model_type_processor.cc
@@ -106,7 +106,7 @@ void SharedModelTypeProcessor::ConnectIfReady() {
std::unique_ptr<ActivationContext> activation_context;
if (!start_error_.IsSet()) {
- activation_context = base::WrapUnique(new ActivationContext);
+ activation_context = base::MakeUnique<ActivationContext>();
activation_context->model_type_state = model_type_state_;
activation_context->type_processor =
base::MakeUnique<ModelTypeProcessorProxy>(
@@ -129,6 +129,7 @@ bool SharedModelTypeProcessor::IsConnected() const {
void SharedModelTypeProcessor::DisableSync() {
DCHECK(CalledOnValidThread());
+ DCHECK(is_metadata_loaded_);
std::unique_ptr<MetadataChangeList> change_list =
service_->CreateMetadataChangeList();
for (auto it = entities_.begin(); it != entities_.end(); ++it) {
@@ -139,6 +140,10 @@ void SharedModelTypeProcessor::DisableSync() {
service_->ApplySyncChanges(std::move(change_list), EntityChangeList());
}
+bool SharedModelTypeProcessor::IsTrackingMetadata() {
+ return model_type_state_.initial_sync_done();
+}
+
SyncError SharedModelTypeProcessor::CreateAndUploadError(
const tracked_objects::Location& location,
const std::string& message) {

Powered by Google App Engine
This is Rietveld 408576698