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 "sync/syncable/blob.h" | 10 #include "sync/syncable/blob.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 if (IsRoot()) | 88 if (IsRoot()) |
89 return TOP_LEVEL_FOLDER; | 89 return TOP_LEVEL_FOLDER; |
90 // Loose check for server-created top-level folders that aren't | 90 // Loose check for server-created top-level folders that aren't |
91 // bound to a particular model type. | 91 // bound to a particular model type. |
92 if (!Get(UNIQUE_SERVER_TAG).empty() && Get(IS_DIR)) | 92 if (!Get(UNIQUE_SERVER_TAG).empty() && Get(IS_DIR)) |
93 return TOP_LEVEL_FOLDER; | 93 return TOP_LEVEL_FOLDER; |
94 | 94 |
95 return UNSPECIFIED; | 95 return UNSPECIFIED; |
96 } | 96 } |
97 | 97 |
| 98 Id Entry::GetPredecessorId() const { |
| 99 return kernel_->ref(PREV_ID); |
| 100 } |
| 101 |
| 102 Id Entry::GetSuccessorId() const { |
| 103 return kernel_->ref(NEXT_ID); |
| 104 } |
| 105 |
98 std::ostream& operator<<(std::ostream& s, const Blob& blob) { | 106 std::ostream& operator<<(std::ostream& s, const Blob& blob) { |
99 for (Blob::const_iterator i = blob.begin(); i != blob.end(); ++i) | 107 for (Blob::const_iterator i = blob.begin(); i != blob.end(); ++i) |
100 s << std::hex << std::setw(2) | 108 s << std::hex << std::setw(2) |
101 << std::setfill('0') << static_cast<unsigned int>(*i); | 109 << std::setfill('0') << static_cast<unsigned int>(*i); |
102 return s << std::dec; | 110 return s << std::dec; |
103 } | 111 } |
104 | 112 |
105 std::ostream& operator<<(std::ostream& os, const Entry& entry) { | 113 std::ostream& operator<<(std::ostream& os, const Entry& entry) { |
106 int i; | 114 int i; |
107 EntryKernel* const kernel = entry.kernel_; | 115 EntryKernel* const kernel = entry.kernel_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 os << "TempFlags: "; | 150 os << "TempFlags: "; |
143 for ( ; i < BIT_TEMPS_END; ++i) { | 151 for ( ; i < BIT_TEMPS_END; ++i) { |
144 if (kernel->ref(static_cast<BitTemp>(i))) | 152 if (kernel->ref(static_cast<BitTemp>(i))) |
145 os << "#" << i - BIT_TEMPS_BEGIN << ", "; | 153 os << "#" << i - BIT_TEMPS_BEGIN << ", "; |
146 } | 154 } |
147 return os; | 155 return os; |
148 } | 156 } |
149 | 157 |
150 } // namespace syncable | 158 } // namespace syncable |
151 } // namespace syncer | 159 } // namespace syncer |
OLD | NEW |