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

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: Added SetUpVersion81Database() fn. 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 #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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 os << g_metas_columns[i].name << ": " 130 os << g_metas_columns[i].name << ": "
131 << net::EscapePath( 131 << base::GetDoubleQuotedJson(
akalin 2012/10/08 21:09:46 use JsonDoubleQuote with put_in_quotes set to fals
132 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString()) 132 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString())
133 << ", "; 133 << ", ";
134 } 134 }
135 for ( ; i < ORDINAL_FIELDS_END; ++i) {
136 os << g_metas_columns[i].name << ": "
137 << kernel->ref(static_cast<OrdinalField>(i)).ToDebugString()
138 << ", ";
139 }
135 os << "TempFlags: "; 140 os << "TempFlags: ";
136 for ( ; i < BIT_TEMPS_END; ++i) { 141 for ( ; i < BIT_TEMPS_END; ++i) {
137 if (kernel->ref(static_cast<BitTemp>(i))) 142 if (kernel->ref(static_cast<BitTemp>(i)))
138 os << "#" << i - BIT_TEMPS_BEGIN << ", "; 143 os << "#" << i - BIT_TEMPS_BEGIN << ", ";
139 } 144 }
140 return os; 145 return os;
141 } 146 }
142 147
143 } // namespace syncable 148 } // namespace syncable
144 } // namespace syncer 149 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698