OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 std::string escaped_str = base::EscapeBytesAsInvalidJSONString( | 150 std::string escaped_str = base::EscapeBytesAsInvalidJSONString( |
151 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString(), | 151 kernel->ref(static_cast<ProtoField>(i)).SerializeAsString(), |
152 false); | 152 false); |
153 os << g_metas_columns[i].name << ": " << escaped_str << ", "; | 153 os << g_metas_columns[i].name << ": " << escaped_str << ", "; |
154 } | 154 } |
155 for ( ; i < UNIQUE_POSITION_FIELDS_END; ++i) { | 155 for ( ; i < UNIQUE_POSITION_FIELDS_END; ++i) { |
156 os << g_metas_columns[i].name << ": " | 156 os << g_metas_columns[i].name << ": " |
157 << kernel->ref(static_cast<UniquePositionField>(i)).ToDebugString() | 157 << kernel->ref(static_cast<UniquePositionField>(i)).ToDebugString() |
158 << ", "; | 158 << ", "; |
159 } | 159 } |
| 160 for ( ; i < ATTACHMENT_METADATA_FIELDS_END; ++i) { |
| 161 std::string escaped_str = base::EscapeBytesAsInvalidJSONString( |
| 162 kernel->ref(static_cast<AttachmentMetadataField>(i)) |
| 163 .SerializeAsString(), |
| 164 false); |
| 165 os << g_metas_columns[i].name << ": " << escaped_str << ", "; |
| 166 } |
160 os << "TempFlags: "; | 167 os << "TempFlags: "; |
161 for ( ; i < BIT_TEMPS_END; ++i) { | 168 for ( ; i < BIT_TEMPS_END; ++i) { |
162 if (kernel->ref(static_cast<BitTemp>(i))) | 169 if (kernel->ref(static_cast<BitTemp>(i))) |
163 os << "#" << i - BIT_TEMPS_BEGIN << ", "; | 170 os << "#" << i - BIT_TEMPS_BEGIN << ", "; |
164 } | 171 } |
165 return os; | 172 return os; |
166 } | 173 } |
167 | 174 |
168 } // namespace syncable | 175 } // namespace syncable |
169 } // namespace syncer | 176 } // namespace syncer |
OLD | NEW |