| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Keep this file in sync with entry_kernel.h. | 5 // Keep this file in sync with entry_kernel.h. |
| 6 | 6 |
| 7 #include "sync/syncable/syncable_enum_conversions.h" | 7 #include "sync/syncable/syncable_enum_conversions.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ENUM_CASE(SERVER_MTIME); | 65 ENUM_CASE(SERVER_MTIME); |
| 66 ENUM_CASE(CTIME); | 66 ENUM_CASE(CTIME); |
| 67 ENUM_CASE(SERVER_CTIME); | 67 ENUM_CASE(SERVER_CTIME); |
| 68 case TIME_FIELDS_END: break; | 68 case TIME_FIELDS_END: break; |
| 69 } | 69 } |
| 70 NOTREACHED(); | 70 NOTREACHED(); |
| 71 return ""; | 71 return ""; |
| 72 } | 72 } |
| 73 | 73 |
| 74 const char* GetIdFieldString(IdField id_field) { | 74 const char* GetIdFieldString(IdField id_field) { |
| 75 ASSERT_ENUM_BOUNDS(ID, NEXT_ID, | 75 ASSERT_ENUM_BOUNDS(ID, SERVER_PARENT_ID, |
| 76 ID_FIELDS_BEGIN, ID_FIELDS_END - 1); | 76 ID_FIELDS_BEGIN, ID_FIELDS_END - 1); |
| 77 switch (id_field) { | 77 switch (id_field) { |
| 78 ENUM_CASE(ID); | 78 ENUM_CASE(ID); |
| 79 ENUM_CASE(PARENT_ID); | 79 ENUM_CASE(PARENT_ID); |
| 80 ENUM_CASE(SERVER_PARENT_ID); | 80 ENUM_CASE(SERVER_PARENT_ID); |
| 81 ENUM_CASE(PREV_ID); | |
| 82 ENUM_CASE(NEXT_ID); | |
| 83 case ID_FIELDS_END: break; | 81 case ID_FIELDS_END: break; |
| 84 } | 82 } |
| 85 NOTREACHED(); | 83 NOTREACHED(); |
| 86 return ""; | 84 return ""; |
| 87 } | 85 } |
| 88 | 86 |
| 89 const char* GetIndexedBitFieldString(IndexedBitField indexed_bit_field) { | 87 const char* GetIndexedBitFieldString(IndexedBitField indexed_bit_field) { |
| 90 ASSERT_ENUM_BOUNDS(IS_UNSYNCED, IS_UNAPPLIED_UPDATE, | 88 ASSERT_ENUM_BOUNDS(IS_UNSYNCED, IS_UNAPPLIED_UPDATE, |
| 91 BIT_FIELDS_BEGIN, INDEXED_BIT_FIELDS_END - 1); | 89 BIT_FIELDS_BEGIN, INDEXED_BIT_FIELDS_END - 1); |
| 92 switch (indexed_bit_field) { | 90 switch (indexed_bit_field) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 switch (proto_field) { | 139 switch (proto_field) { |
| 142 ENUM_CASE(SPECIFICS); | 140 ENUM_CASE(SPECIFICS); |
| 143 ENUM_CASE(SERVER_SPECIFICS); | 141 ENUM_CASE(SERVER_SPECIFICS); |
| 144 ENUM_CASE(BASE_SERVER_SPECIFICS); | 142 ENUM_CASE(BASE_SERVER_SPECIFICS); |
| 145 case PROTO_FIELDS_END: break; | 143 case PROTO_FIELDS_END: break; |
| 146 } | 144 } |
| 147 NOTREACHED(); | 145 NOTREACHED(); |
| 148 return ""; | 146 return ""; |
| 149 } | 147 } |
| 150 | 148 |
| 151 const char* GetOrdinalFieldString(OrdinalField ordinal_field) { | 149 const char* GetUniquePositionFieldString(UniquePositionField position_field) { |
| 152 ASSERT_ENUM_BOUNDS(SERVER_ORDINAL_IN_PARENT, SERVER_ORDINAL_IN_PARENT, | 150 ASSERT_ENUM_BOUNDS(SERVER_UNIQUE_POSITION, UNIQUE_POSITION, |
| 153 ORDINAL_FIELDS_BEGIN, ORDINAL_FIELDS_END - 1); | 151 UNIQUE_POSITION_FIELDS_BEGIN, |
| 154 switch(ordinal_field) { | 152 UNIQUE_POSITION_FIELDS_END - 1); |
| 155 ENUM_CASE(SERVER_ORDINAL_IN_PARENT); | 153 switch(position_field) { |
| 156 case ORDINAL_FIELDS_END: break; | 154 ENUM_CASE(SERVER_UNIQUE_POSITION); |
| 155 ENUM_CASE(UNIQUE_POSITION); |
| 156 case UNIQUE_POSITION_FIELDS_END: break; |
| 157 } | 157 } |
| 158 NOTREACHED(); | 158 NOTREACHED(); |
| 159 return ""; | 159 return ""; |
| 160 } |
| 161 |
| 162 const char* GetBytesFieldString(BytesField bytes_field) { |
| 163 ASSERT_ENUM_BOUNDS(UNIQUE_BOOKMARK_TAG, UNIQUE_BOOKMARK_TAG, |
| 164 BYTES_FIELDS_BEGIN, |
| 165 BYTES_FIELDS_END - 1); |
| 166 switch(bytes_field) { |
| 167 ENUM_CASE(UNIQUE_BOOKMARK_TAG); |
| 168 case BYTES_FIELDS_END: break; |
| 169 } |
| 170 NOTREACHED(); |
| 171 return ""; |
| 160 } | 172 } |
| 161 | 173 |
| 162 const char* GetBitTempString(BitTemp bit_temp) { | 174 const char* GetBitTempString(BitTemp bit_temp) { |
| 163 ASSERT_ENUM_BOUNDS(SYNCING, SYNCING, | 175 ASSERT_ENUM_BOUNDS(SYNCING, SYNCING, |
| 164 BIT_TEMPS_BEGIN, BIT_TEMPS_END - 1); | 176 BIT_TEMPS_BEGIN, BIT_TEMPS_END - 1); |
| 165 switch (bit_temp) { | 177 switch (bit_temp) { |
| 166 ENUM_CASE(SYNCING); | 178 ENUM_CASE(SYNCING); |
| 167 case BIT_TEMPS_END: break; | 179 case BIT_TEMPS_END: break; |
| 168 } | 180 } |
| 169 NOTREACHED(); | 181 NOTREACHED(); |
| 170 return ""; | 182 return ""; |
| 171 } | 183 } |
| 172 | 184 |
| 173 #undef ENUM_CASE | 185 #undef ENUM_CASE |
| 174 #undef ASSERT_ENUM_BOUNDS | 186 #undef ASSERT_ENUM_BOUNDS |
| 175 | 187 |
| 176 } // namespace syncable | 188 } // namespace syncable |
| 177 } // namespace syncer | 189 } // namespace syncer |
| OLD | NEW |