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

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: Minor fixes 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 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);
130 os << g_metas_columns[i].name << ": " 135 os << g_metas_columns[i].name << ": "
131 << net::EscapePath( 136 << escaped_str
132 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString()) 137 << ", ";
akalin 2012/10/08 23:04:10 can probably just put this on previous line (and m
138 }
139 for ( ; i < ORDINAL_FIELDS_END; ++i) {
140 os << g_metas_columns[i].name << ": "
141 << kernel->ref(static_cast<OrdinalField>(i)).ToDebugString()
133 << ", "; 142 << ", ";
134 } 143 }
135 os << "TempFlags: "; 144 os << "TempFlags: ";
136 for ( ; i < BIT_TEMPS_END; ++i) { 145 for ( ; i < BIT_TEMPS_END; ++i) {
137 if (kernel->ref(static_cast<BitTemp>(i))) 146 if (kernel->ref(static_cast<BitTemp>(i)))
138 os << "#" << i - BIT_TEMPS_BEGIN << ", "; 147 os << "#" << i - BIT_TEMPS_BEGIN << ", ";
139 } 148 }
140 return os; 149 return os;
141 } 150 }
142 151
143 } // namespace syncable 152 } // namespace syncable
144 } // namespace syncer 153 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698