| 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 27 matching lines...) Expand all Loading... |
| 38 ASSERT_ENUM_BOUNDS(BASE_VERSION, BASE_VERSION, | 38 ASSERT_ENUM_BOUNDS(BASE_VERSION, BASE_VERSION, |
| 39 META_HANDLE + 1, SERVER_VERSION - 1); | 39 META_HANDLE + 1, SERVER_VERSION - 1); |
| 40 switch (base_version) { | 40 switch (base_version) { |
| 41 ENUM_CASE(BASE_VERSION); | 41 ENUM_CASE(BASE_VERSION); |
| 42 } | 42 } |
| 43 NOTREACHED(); | 43 NOTREACHED(); |
| 44 return ""; | 44 return ""; |
| 45 } | 45 } |
| 46 | 46 |
| 47 const char* GetInt64FieldString(Int64Field int64_field) { | 47 const char* GetInt64FieldString(Int64Field int64_field) { |
| 48 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID, | 48 ASSERT_ENUM_BOUNDS(SERVER_VERSION, TRANSACTION_VERSION, |
| 49 BASE_VERSION + 1, INT64_FIELDS_END - 1); | 49 BASE_VERSION + 1, INT64_FIELDS_END - 1); |
| 50 switch (int64_field) { | 50 switch (int64_field) { |
| 51 ENUM_CASE(SERVER_VERSION); | 51 ENUM_CASE(SERVER_VERSION); |
| 52 ENUM_CASE(LOCAL_EXTERNAL_ID); | 52 ENUM_CASE(LOCAL_EXTERNAL_ID); |
| 53 ENUM_CASE(TRANSACTION_VERSION); |
| 53 case INT64_FIELDS_END: break; | 54 case INT64_FIELDS_END: break; |
| 54 } | 55 } |
| 55 NOTREACHED(); | 56 NOTREACHED(); |
| 56 return ""; | 57 return ""; |
| 57 } | 58 } |
| 58 | 59 |
| 59 const char* GetTimeFieldString(TimeField time_field) { | 60 const char* GetTimeFieldString(TimeField time_field) { |
| 60 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID, | 61 ASSERT_ENUM_BOUNDS(MTIME, SERVER_CTIME, |
| 61 BASE_VERSION + 1, INT64_FIELDS_END - 1); | 62 TIME_FIELDS_BEGIN, TIME_FIELDS_END - 1); |
| 62 switch (time_field) { | 63 switch (time_field) { |
| 63 ENUM_CASE(MTIME); | 64 ENUM_CASE(MTIME); |
| 64 ENUM_CASE(SERVER_MTIME); | 65 ENUM_CASE(SERVER_MTIME); |
| 65 ENUM_CASE(CTIME); | 66 ENUM_CASE(CTIME); |
| 66 ENUM_CASE(SERVER_CTIME); | 67 ENUM_CASE(SERVER_CTIME); |
| 67 case TIME_FIELDS_END: break; | 68 case TIME_FIELDS_END: break; |
| 68 } | 69 } |
| 69 NOTREACHED(); | 70 NOTREACHED(); |
| 70 return ""; | 71 return ""; |
| 71 } | 72 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 168 } |
| 168 NOTREACHED(); | 169 NOTREACHED(); |
| 169 return ""; | 170 return ""; |
| 170 } | 171 } |
| 171 | 172 |
| 172 #undef ENUM_CASE | 173 #undef ENUM_CASE |
| 173 #undef ASSERT_ENUM_BOUNDS | 174 #undef ASSERT_ENUM_BOUNDS |
| 174 | 175 |
| 175 } // namespace syncable | 176 } // namespace syncable |
| 176 } // namespace syncer | 177 } // namespace syncer |
| OLD | NEW |