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

Side by Side Diff: sync/syncable/entry.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
« no previous file with comments | « sync/syncable/entry.h ('k') | sync/syncable/entry_kernel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "sync/syncable/entry.h" 5 #include "sync/syncable/entry.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "net/base/escape.h" 9 #include "base/json/string_escape.h"
10 #include "sync/syncable/base_transaction.h" 10 #include "sync/syncable/base_transaction.h"
11 #include "sync/syncable/blob.h" 11 #include "sync/syncable/blob.h"
12 #include "sync/syncable/directory.h" 12 #include "sync/syncable/directory.h"
13 #include "sync/syncable/syncable_columns.h" 13 #include "sync/syncable/syncable_columns.h"
14 14
15 using std::string; 15 using std::string;
16 16
17 namespace syncer { 17 namespace syncer {
18 namespace syncable { 18 namespace syncable {
19 19
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 os << "Flags: "; 120 os << "Flags: ";
121 for ( ; i < BIT_FIELDS_END; ++i) { 121 for ( ; i < BIT_FIELDS_END; ++i) {
122 if (kernel->ref(static_cast<BitField>(i))) 122 if (kernel->ref(static_cast<BitField>(i)))
123 os << g_metas_columns[i].name << ", "; 123 os << g_metas_columns[i].name << ", ";
124 } 124 }
125 for ( ; i < STRING_FIELDS_END; ++i) { 125 for ( ; i < STRING_FIELDS_END; ++i) {
126 const std::string& field = kernel->ref(static_cast<StringField>(i)); 126 const std::string& field = kernel->ref(static_cast<StringField>(i));
127 os << g_metas_columns[i].name << ": " << field << ", "; 127 os << g_metas_columns[i].name << ": " << field << ", ";
128 } 128 }
129 for ( ; i < PROTO_FIELDS_END; ++i) { 129 for ( ; i < PROTO_FIELDS_END; ++i) {
130 std::string escaped_str;
131 base::JsonDoubleQuote(
132 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString(),
133 false,
134 &escaped_str);
135 os << g_metas_columns[i].name << ": " << escaped_str << ", ";
136 }
137 for ( ; i < ORDINAL_FIELDS_END; ++i) {
130 os << g_metas_columns[i].name << ": " 138 os << g_metas_columns[i].name << ": "
131 << net::EscapePath( 139 << kernel->ref(static_cast<OrdinalField>(i)).ToDebugString()
132 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString())
133 << ", "; 140 << ", ";
134 } 141 }
135 os << "TempFlags: "; 142 os << "TempFlags: ";
136 for ( ; i < BIT_TEMPS_END; ++i) { 143 for ( ; i < BIT_TEMPS_END; ++i) {
137 if (kernel->ref(static_cast<BitTemp>(i))) 144 if (kernel->ref(static_cast<BitTemp>(i)))
138 os << "#" << i - BIT_TEMPS_BEGIN << ", "; 145 os << "#" << i - BIT_TEMPS_BEGIN << ", ";
139 } 146 }
140 return os; 147 return os;
141 } 148 }
142 149
143 } // namespace syncable 150 } // namespace syncable
144 } // namespace syncer 151 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/entry.h ('k') | sync/syncable/entry_kernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698