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

Side by Side Diff: sync/syncable/syncable_enum_conversions.cc

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed memory leak error in unittest Created 8 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 unified diff | Download patch
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, LOCAL_EXTERNAL_ID,
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(SERVER_POSITION_IN_PARENT);
53 ENUM_CASE(LOCAL_EXTERNAL_ID); 52 ENUM_CASE(LOCAL_EXTERNAL_ID);
54 case INT64_FIELDS_END: break; 53 case INT64_FIELDS_END: break;
55 } 54 }
56 NOTREACHED(); 55 NOTREACHED();
57 return ""; 56 return "";
58 } 57 }
59 58
60 const char* GetTimeFieldString(TimeField time_field) { 59 const char* GetTimeFieldString(TimeField time_field) {
61 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID, 60 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID,
62 BASE_VERSION + 1, INT64_FIELDS_END - 1); 61 BASE_VERSION + 1, INT64_FIELDS_END - 1);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 switch (proto_field) { 140 switch (proto_field) {
142 ENUM_CASE(SPECIFICS); 141 ENUM_CASE(SPECIFICS);
143 ENUM_CASE(SERVER_SPECIFICS); 142 ENUM_CASE(SERVER_SPECIFICS);
144 ENUM_CASE(BASE_SERVER_SPECIFICS); 143 ENUM_CASE(BASE_SERVER_SPECIFICS);
145 case PROTO_FIELDS_END: break; 144 case PROTO_FIELDS_END: break;
146 } 145 }
147 NOTREACHED(); 146 NOTREACHED();
148 return ""; 147 return "";
149 } 148 }
150 149
150 const char* GetOrdinalFieldString(OrdinalField ordinal_field) {
151 ASSERT_ENUM_BOUNDS(SERVER_ORDINAL_IN_PARENT, SERVER_ORDINAL_IN_PARENT,
152 ORDINAL_FIELDS_BEGIN, ORDINAL_FIELDS_END - 1);
153 switch(ordinal_field) {
154 ENUM_CASE(SERVER_ORDINAL_IN_PARENT);
155 case ORDINAL_FIELDS_END: break;
156 }
157 NOTREACHED();
158 return "";
159 }
160
151 const char* GetBitTempString(BitTemp bit_temp) { 161 const char* GetBitTempString(BitTemp bit_temp) {
152 ASSERT_ENUM_BOUNDS(SYNCING, SYNCING, 162 ASSERT_ENUM_BOUNDS(SYNCING, SYNCING,
153 BIT_TEMPS_BEGIN, BIT_TEMPS_END - 1); 163 BIT_TEMPS_BEGIN, BIT_TEMPS_END - 1);
154 switch (bit_temp) { 164 switch (bit_temp) {
155 ENUM_CASE(SYNCING); 165 ENUM_CASE(SYNCING);
156 case BIT_TEMPS_END: break; 166 case BIT_TEMPS_END: break;
157 } 167 }
158 NOTREACHED(); 168 NOTREACHED();
159 return ""; 169 return "";
160 } 170 }
161 171
162 #undef ENUM_CASE 172 #undef ENUM_CASE
163 #undef ASSERT_ENUM_BOUNDS 173 #undef ASSERT_ENUM_BOUNDS
164 174
165 } // namespace syncable 175 } // namespace syncable
166 } // namespace syncer 176 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/syncable_enum_conversions.h ('k') | sync/syncable/syncable_enum_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698