| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/directory.h" | 5 #include "sync/syncable/directory.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 } | 945 } |
| 946 | 946 |
| 947 bool Directory::InitialSyncEndedForType(ModelType type) { | 947 bool Directory::InitialSyncEndedForType(ModelType type) { |
| 948 syncable::ReadTransaction trans(FROM_HERE, this); | 948 syncable::ReadTransaction trans(FROM_HERE, this); |
| 949 return InitialSyncEndedForType(&trans, type); | 949 return InitialSyncEndedForType(&trans, type); |
| 950 } | 950 } |
| 951 | 951 |
| 952 bool Directory::InitialSyncEndedForType( | 952 bool Directory::InitialSyncEndedForType( |
| 953 BaseTransaction* trans, ModelType type) { | 953 BaseTransaction* trans, ModelType type) { |
| 954 // True iff the type's root node has been received and applied. | 954 // True iff the type's root node has been received and applied. |
| 955 syncable::Entry entry(trans, | 955 syncable::Entry entry(trans, syncable::GET_TYPE_ROOT, type); |
| 956 syncable::GET_BY_SERVER_TAG, | |
| 957 ModelTypeToRootTag(type)); | |
| 958 return entry.good() && entry.GetBaseVersion() != CHANGES_VERSION; | 956 return entry.good() && entry.GetBaseVersion() != CHANGES_VERSION; |
| 959 } | 957 } |
| 960 | 958 |
| 961 string Directory::store_birthday() const { | 959 string Directory::store_birthday() const { |
| 962 ScopedKernelLock lock(this); | 960 ScopedKernelLock lock(this); |
| 963 return kernel_->persisted_info.store_birthday; | 961 return kernel_->persisted_info.store_birthday; |
| 964 } | 962 } |
| 965 | 963 |
| 966 void Directory::set_store_birthday(const string& store_birthday) { | 964 void Directory::set_store_birthday(const string& store_birthday) { |
| 967 ScopedKernelLock lock(this); | 965 ScopedKernelLock lock(this); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 | 1441 |
| 1444 for (OrderedChildSet::const_iterator i = children->begin(); | 1442 for (OrderedChildSet::const_iterator i = children->begin(); |
| 1445 i != children->end(); ++i) { | 1443 i != children->end(); ++i) { |
| 1446 DCHECK_EQ(parent_id, (*i)->ref(PARENT_ID)); | 1444 DCHECK_EQ(parent_id, (*i)->ref(PARENT_ID)); |
| 1447 result->push_back((*i)->ref(META_HANDLE)); | 1445 result->push_back((*i)->ref(META_HANDLE)); |
| 1448 } | 1446 } |
| 1449 } | 1447 } |
| 1450 | 1448 |
| 1451 } // namespace syncable | 1449 } // namespace syncable |
| 1452 } // namespace syncer | 1450 } // namespace syncer |
| OLD | NEW |