OLD | NEW |
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/internal_api/public/base_node.h" | 5 #include "sync/internal_api/public/base_node.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 int64 BaseNode::GetParentId() const { | 175 int64 BaseNode::GetParentId() const { |
176 return IdToMetahandle(GetTransaction()->GetWrappedTrans(), | 176 return IdToMetahandle(GetTransaction()->GetWrappedTrans(), |
177 GetEntry()->Get(syncable::PARENT_ID)); | 177 GetEntry()->Get(syncable::PARENT_ID)); |
178 } | 178 } |
179 | 179 |
180 int64 BaseNode::GetId() const { | 180 int64 BaseNode::GetId() const { |
181 return GetEntry()->Get(syncable::META_HANDLE); | 181 return GetEntry()->Get(syncable::META_HANDLE); |
182 } | 182 } |
183 | 183 |
184 const base::Time& BaseNode::GetModificationTime() const { | 184 base::Time BaseNode::GetModificationTime() const { |
185 return GetEntry()->Get(syncable::MTIME); | 185 return GetEntry()->Get(syncable::MTIME); |
186 } | 186 } |
187 | 187 |
188 bool BaseNode::GetIsFolder() const { | 188 bool BaseNode::GetIsFolder() const { |
189 return GetEntry()->Get(syncable::IS_DIR); | 189 return GetEntry()->Get(syncable::IS_DIR); |
190 } | 190 } |
191 | 191 |
192 std::string BaseNode::GetTitle() const { | 192 std::string BaseNode::GetTitle() const { |
193 std::string result; | 193 std::string result; |
194 // TODO(zea): refactor bookmarks to not need this functionality. | 194 // TODO(zea): refactor bookmarks to not need this functionality. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 const sync_pb::EntitySpecifics& specifics) { | 344 const sync_pb::EntitySpecifics& specifics) { |
345 ModelType type = GetModelTypeFromSpecifics(specifics); | 345 ModelType type = GetModelTypeFromSpecifics(specifics); |
346 DCHECK_NE(UNSPECIFIED, type); | 346 DCHECK_NE(UNSPECIFIED, type); |
347 if (GetModelType() != UNSPECIFIED) { | 347 if (GetModelType() != UNSPECIFIED) { |
348 DCHECK_EQ(GetModelType(), type); | 348 DCHECK_EQ(GetModelType(), type); |
349 } | 349 } |
350 unencrypted_data_.CopyFrom(specifics); | 350 unencrypted_data_.CopyFrom(specifics); |
351 } | 351 } |
352 | 352 |
353 } // namespace syncer | 353 } // namespace syncer |
OLD | NEW |