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

Unified Diff: components/sync/protocol/proto_enum_conversions.cc

Issue 2374223003: Sync MDP: reimplement value conversions ontop of visitors
Patch Set: Created 4 years, 3 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/protocol/proto_enum_conversions.cc
diff --git a/components/sync/protocol/proto_enum_conversions.cc b/components/sync/protocol/proto_enum_conversions.cc
index ef90a1a0bc18de69910a7debaa28002e9e04483a..b3d017f0d99b44ec5d2f3527bb6180c58fbe5cc2 100644
--- a/components/sync/protocol/proto_enum_conversions.cc
+++ b/components/sync/protocol/proto_enum_conversions.cc
@@ -20,7 +20,7 @@ namespace syncer {
case enum_parent::enum_value: \
return #enum_value
-const char* GetAppListItemTypeString(
+const char* ProtoEnumToString(
sync_pb::AppListSpecifics::AppListItemType item_type) {
ASSERT_ENUM_BOUNDS(sync_pb::AppListSpecifics, AppListItemType, TYPE_APP,
TYPE_URL);
@@ -34,7 +34,7 @@ const char* GetAppListItemTypeString(
return "";
}
-const char* GetBrowserTypeString(
+const char* ProtoEnumToString(
sync_pb::SessionWindow::BrowserType browser_type) {
ASSERT_ENUM_BOUNDS(sync_pb::SessionWindow, BrowserType, TYPE_TABBED,
TYPE_POPUP);
@@ -46,7 +46,7 @@ const char* GetBrowserTypeString(
return "";
}
-const char* GetPageTransitionString(
+const char* ProtoEnumToString(
sync_pb::SyncEnums::PageTransition page_transition) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransition, LINK,
KEYWORD_GENERATED);
@@ -67,7 +67,7 @@ const char* GetPageTransitionString(
return "";
}
-const char* GetPageTransitionRedirectTypeString(
+const char* ProtoEnumToString(
sync_pb::SyncEnums::PageTransitionRedirectType page_transition_qualifier) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionRedirectType,
CLIENT_REDIRECT, SERVER_REDIRECT);
@@ -79,7 +79,7 @@ const char* GetPageTransitionRedirectTypeString(
return "";
}
-const char* GetWifiCredentialSecurityClassString(
+const char* ProtoEnumToString(
sync_pb::WifiCredentialSpecifics::SecurityClass security_class) {
ASSERT_ENUM_BOUNDS(sync_pb::WifiCredentialSpecifics, SecurityClass,
SECURITY_CLASS_INVALID, SECURITY_CLASS_PSK);
@@ -92,7 +92,7 @@ const char* GetWifiCredentialSecurityClassString(
NOTREACHED();
return "";
}
-const char* GetUpdatesSourceString(
+const char* ProtoEnumToString(
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) {
ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, UNKNOWN,
PROGRAMMATIC);
@@ -115,7 +115,7 @@ const char* GetUpdatesSourceString(
return "";
}
-const char* GetUpdatesOriginString(
+const char* ProtoEnumToString(
sync_pb::SyncEnums::GetUpdatesOrigin origin) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, GetUpdatesOrigin, UNKNOWN_ORIGIN,
PROGRAMMATIC);
@@ -134,7 +134,7 @@ const char* GetUpdatesOriginString(
return "";
}
-const char* GetResponseTypeString(
+const char* ProtoEnumToString(
sync_pb::CommitResponse::ResponseType response_type) {
ASSERT_ENUM_BOUNDS(sync_pb::CommitResponse, ResponseType, SUCCESS,
TRANSIENT_ERROR);
@@ -150,7 +150,8 @@ const char* GetResponseTypeString(
return "";
}
-const char* GetErrorTypeString(sync_pb::SyncEnums::ErrorType error_type) {
+const char* ProtoEnumToString(
+ sync_pb::SyncEnums::ErrorType error_type) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, ErrorType, SUCCESS, UNKNOWN);
switch (error_type) {
ENUM_CASE(sync_pb::SyncEnums, SUCCESS);
@@ -173,7 +174,8 @@ const char* GetErrorTypeString(sync_pb::SyncEnums::ErrorType error_type) {
return "";
}
-const char* GetActionString(sync_pb::SyncEnums::Action action) {
+const char* ProtoEnumToString(
+ sync_pb::SyncEnums::Action action) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, Action, UPGRADE_CLIENT,
UNKNOWN_ACTION);
switch (action) {
@@ -188,7 +190,8 @@ const char* GetActionString(sync_pb::SyncEnums::Action action) {
return "";
}
-const char* GetLaunchTypeString(sync_pb::AppSpecifics::LaunchType launch_type) {
+const char* ProtoEnumToString(
+ sync_pb::AppSpecifics::LaunchType launch_type) {
ASSERT_ENUM_BOUNDS(sync_pb::AppSpecifics, LaunchType, PINNED, WINDOW);
switch (launch_type) {
ENUM_CASE(sync_pb::AppSpecifics, PINNED);
@@ -200,7 +203,7 @@ const char* GetLaunchTypeString(sync_pb::AppSpecifics::LaunchType launch_type) {
return "";
}
-const char* GetWalletInfoTypeString(
+const char* ProtoEnumToString(
sync_pb::AutofillWalletSpecifics::WalletInfoType wallet_info_type) {
ASSERT_ENUM_BOUNDS(sync_pb::AutofillWalletSpecifics, WalletInfoType, UNKNOWN,
POSTAL_ADDRESS);
@@ -213,7 +216,7 @@ const char* GetWalletInfoTypeString(
return "";
}
-const char* GetWalletMetadataTypeString(
+const char* ProtoEnumToString(
sync_pb::WalletMetadataSpecifics::Type wallet_metadata_type) {
ASSERT_ENUM_BOUNDS(sync_pb::WalletMetadataSpecifics, Type, UNKNOWN, ADDRESS);
switch (wallet_metadata_type) {
@@ -225,7 +228,7 @@ const char* GetWalletMetadataTypeString(
return "";
}
-const char* GetWalletCardStatusString(
+const char* ProtoEnumToString(
sync_pb::WalletMaskedCreditCard::WalletCardStatus wallet_card_status) {
switch (wallet_card_status) {
ENUM_CASE(sync_pb::WalletMaskedCreditCard, VALID);
@@ -235,7 +238,7 @@ const char* GetWalletCardStatusString(
return "";
}
-const char* GetWalletCardTypeString(
+const char* ProtoEnumToString(
sync_pb::WalletMaskedCreditCard::WalletCardType wallet_card_type) {
switch (wallet_card_type) {
ENUM_CASE(sync_pb::WalletMaskedCreditCard, UNKNOWN);
@@ -252,7 +255,8 @@ const char* GetWalletCardTypeString(
return "";
}
-const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type) {
+const char* ProtoEnumToString(
+ sync_pb::SyncEnums::DeviceType device_type) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, DeviceType, TYPE_WIN, TYPE_TABLET);
switch (device_type) {
ENUM_CASE(sync_pb::SyncEnums, TYPE_WIN);
@@ -267,7 +271,7 @@ const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type) {
return "";
}
-const char* GetFaviconTypeString(
+const char* ProtoEnumToString(
sync_pb::SessionTab::FaviconType favicon_type) {
ASSERT_ENUM_BOUNDS(sync_pb::SessionTab, FaviconType, TYPE_WEB_FAVICON,
TYPE_WEB_FAVICON);
@@ -276,7 +280,7 @@ const char* GetFaviconTypeString(
return "";
}
-const char* PassphraseTypeString(
+const char* ProtoEnumToString(
sync_pb::NigoriSpecifics::PassphraseType type) {
ASSERT_ENUM_BOUNDS(sync_pb::NigoriSpecifics, PassphraseType,
IMPLICIT_PASSPHRASE, CUSTOM_PASSPHRASE);
@@ -290,7 +294,7 @@ const char* PassphraseTypeString(
return "";
}
-const char* SingletonDebugEventTypeString(
+const char* ProtoEnumToString(
sync_pb::SyncEnums::SingletonDebugEventType type) {
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, SingletonDebugEventType,
CONNECTION_STATUS_CHANGE, BOOTSTRAP_TOKEN_UPDATED);
@@ -313,7 +317,8 @@ const char* SingletonDebugEventTypeString(
return "";
}
-const char* GetBlockedStateString(sync_pb::TabNavigation::BlockedState state) {
+const char* ProtoEnumToString(
+ sync_pb::TabNavigation::BlockedState state) {
ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, BlockedState, STATE_ALLOWED,
STATE_BLOCKED);
switch (state) {
@@ -324,7 +329,7 @@ const char* GetBlockedStateString(sync_pb::TabNavigation::BlockedState state) {
return "";
}
-const char* GetPasswordStateString(
+const char* ProtoEnumToString(
sync_pb::TabNavigation::PasswordState state) {
ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, PasswordState,
PASSWORD_STATE_UNKNOWN, HAS_PASSWORD_FIELD);
@@ -337,7 +342,7 @@ const char* GetPasswordStateString(
return "";
}
-const char* GetReadingListEntryStatusString(
+const char* ProtoEnumToString(
sync_pb::ReadingListSpecifics::ReadingListEntryStatus status) {
ASSERT_ENUM_BOUNDS(sync_pb::ReadingListSpecifics, ReadingListEntryStatus,
UNREAD, READ);
« no previous file with comments | « components/sync/protocol/proto_enum_conversions.h ('k') | components/sync/protocol/proto_enum_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698