summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-21 21:39:54 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-21 21:42:55 +0000
commit27a57c8b57b8299bfb4786759735becc4a77e63e (patch)
tree5706a6c6272aa0d90fad20f27db6c53d16819cef /sync
parent9a6fb22f348594098cc5a38329454ca19ce45867 (diff)
downloadchromium_src-27a57c8b57b8299bfb4786759735becc4a77e63e.zip
chromium_src-27a57c8b57b8299bfb4786759735becc4a77e63e.tar.gz
chromium_src-27a57c8b57b8299bfb4786759735becc4a77e63e.tar.bz2
[Sync] Move reenable logic into DTM
The DataTypeManager is now in charge of reenabling previously failed types. BUG=368834 R=maniscalco@chromium.org Review URL: https://codereview.chromium.org/439903002 Cr-Commit-Position: refs/heads/master@{#291198} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291198 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/engine/get_updates_delegate.cc2
-rw-r--r--sync/engine/sync_scheduler_impl.cc1
-rw-r--r--sync/internal_api/public/configure_reason.h4
-rw-r--r--sync/internal_api/sync_manager_impl.cc2
-rw-r--r--sync/protocol/get_updates_caller_info.proto2
-rw-r--r--sync/protocol/proto_enum_conversions.cc6
-rw-r--r--sync/protocol/sync_enums.proto2
7 files changed, 17 insertions, 2 deletions
diff --git a/sync/engine/get_updates_delegate.cc b/sync/engine/get_updates_delegate.cc
index ac66eef..af4ad57 100644
--- a/sync/engine/get_updates_delegate.cc
+++ b/sync/engine/get_updates_delegate.cc
@@ -136,6 +136,8 @@ ConfigureGetUpdatesDelegate::ConvertConfigureSourceToOrigin(
return sync_pb::SyncEnums::RECONFIGURATION;
case sync_pb::GetUpdatesCallerInfo::NEW_CLIENT:
return sync_pb::SyncEnums::NEW_CLIENT;
+ case sync_pb::GetUpdatesCallerInfo::PROGRAMMATIC:
+ return sync_pb::SyncEnums::PROGRAMMATIC;
default:
NOTREACHED();
return sync_pb::SyncEnums::UNKNOWN_ORIGIN;
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc
index 974ed27..7b07815 100644
--- a/sync/engine/sync_scheduler_impl.cc
+++ b/sync/engine/sync_scheduler_impl.cc
@@ -143,6 +143,7 @@ bool IsConfigRelatedUpdateSourceValue(
case GetUpdatesCallerInfo::MIGRATION:
case GetUpdatesCallerInfo::NEW_CLIENT:
case GetUpdatesCallerInfo::NEWLY_SUPPORTED_DATATYPE:
+ case GetUpdatesCallerInfo::PROGRAMMATIC:
return true;
default:
return false;
diff --git a/sync/internal_api/public/configure_reason.h b/sync/internal_api/public/configure_reason.h
index 43784b7..6dadeff 100644
--- a/sync/internal_api/public/configure_reason.h
+++ b/sync/internal_api/public/configure_reason.h
@@ -35,6 +35,10 @@ enum ConfigureReason {
// Configure data types for backup/rollback.
CONFIGURE_REASON_BACKUP_ROLLBACK,
+
+ // The client is configuring because of a programmatic type enable/disable,
+ // such as when an error is encountered/resolved.
+ CONFIGURE_REASON_PROGRAMMATIC,
};
} // namespace syncer
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index 8d2c8e2..a444b91 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -79,6 +79,8 @@ GetUpdatesCallerInfo::GetUpdatesSource GetSourceFromReason(
case CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE:
case CONFIGURE_REASON_CRYPTO:
return GetUpdatesCallerInfo::NEWLY_SUPPORTED_DATATYPE;
+ case CONFIGURE_REASON_PROGRAMMATIC:
+ return GetUpdatesCallerInfo::PROGRAMMATIC;
default:
NOTREACHED();
}
diff --git a/sync/protocol/get_updates_caller_info.proto b/sync/protocol/get_updates_caller_info.proto
index ce37e61..118cce8 100644
--- a/sync/protocol/get_updates_caller_info.proto
+++ b/sync/protocol/get_updates_caller_info.proto
@@ -43,6 +43,8 @@ message GetUpdatesCallerInfo {
// typically used when datatype's have custom
// sync UI, e.g. sessions.
RETRY = 13; // A follow-up GU to pick up updates missed by previous GU.
+ PROGRAMMATIC = 14; // The client is programmatically enabling/disabling
+ // a type, typically for error handling purposes.
}
required GetUpdatesSource source = 1;
diff --git a/sync/protocol/proto_enum_conversions.cc b/sync/protocol/proto_enum_conversions.cc
index 213a096..4c43983 100644
--- a/sync/protocol/proto_enum_conversions.cc
+++ b/sync/protocol/proto_enum_conversions.cc
@@ -83,7 +83,7 @@ const char* GetPageTransitionRedirectTypeString(
const char* GetUpdatesSourceString(
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) {
ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource,
- UNKNOWN, RETRY);
+ UNKNOWN, PROGRAMMATIC);
switch (updates_source) {
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, UNKNOWN);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, FIRST_UPDATE);
@@ -97,6 +97,7 @@ const char* GetUpdatesSourceString(
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, RECONFIGURATION);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, DATATYPE_REFRESH);
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, RETRY);
+ ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PROGRAMMATIC);
}
NOTREACHED();
return "";
@@ -105,7 +106,7 @@ const char* GetUpdatesSourceString(
const char* GetUpdatesOriginString(
sync_pb::SyncEnums::GetUpdatesOrigin origin) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, GetUpdatesOrigin,
- UNKNOWN_ORIGIN, RETRY);
+ UNKNOWN_ORIGIN, PROGRAMMATIC);
switch (origin) {
ENUM_CASE(sync_pb::SyncEnums, UNKNOWN_ORIGIN);
ENUM_CASE(sync_pb::SyncEnums, PERIODIC);
@@ -115,6 +116,7 @@ const char* GetUpdatesOriginString(
ENUM_CASE(sync_pb::SyncEnums, RECONFIGURATION);
ENUM_CASE(sync_pb::SyncEnums, GU_TRIGGER);
ENUM_CASE(sync_pb::SyncEnums, RETRY);
+ ENUM_CASE(sync_pb::SyncEnums, PROGRAMMATIC);
}
NOTREACHED();
return "";
diff --git a/sync/protocol/sync_enums.proto b/sync/protocol/sync_enums.proto
index 6e1405b..9ee2a9c 100644
--- a/sync/protocol/sync_enums.proto
+++ b/sync/protocol/sync_enums.proto
@@ -157,5 +157,7 @@ message SyncEnums {
// GetUpdateTriggers message for more details.
RETRY = 13; // A retry GU to pick up updates missed by last GU due to
// replication delay, missing hints, etc.
+ PROGRAMMATIC = 14; // A GU to programmatically enable/disable a
+ // datatype, often due to error handling.
}
}