| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 return initial_sync_ended_types; | 978 return initial_sync_ended_types; |
| 979 } | 979 } |
| 980 | 980 |
| 981 bool Directory::InitialSyncEndedForType(ModelType type) { | 981 bool Directory::InitialSyncEndedForType(ModelType type) { |
| 982 syncable::ReadTransaction trans(FROM_HERE, this); | 982 syncable::ReadTransaction trans(FROM_HERE, this); |
| 983 return InitialSyncEndedForType(&trans, type); | 983 return InitialSyncEndedForType(&trans, type); |
| 984 } | 984 } |
| 985 | 985 |
| 986 bool Directory::InitialSyncEndedForType( | 986 bool Directory::InitialSyncEndedForType( |
| 987 BaseTransaction* trans, ModelType type) { | 987 BaseTransaction* trans, ModelType type) { |
| 988 // True iff the type's root node has been received and applied. | 988 // True iff the type's root node has been created. |
| 989 syncable::Entry entry(trans, syncable::GET_TYPE_ROOT, type); | 989 syncable::Entry entry(trans, syncable::GET_TYPE_ROOT, type); |
| 990 return entry.good() && entry.GetBaseVersion() != CHANGES_VERSION; | 990 return entry.good(); |
| 991 } | 991 } |
| 992 | 992 |
| 993 string Directory::store_birthday() const { | 993 string Directory::store_birthday() const { |
| 994 ScopedKernelLock lock(this); | 994 ScopedKernelLock lock(this); |
| 995 return kernel_->persisted_info.store_birthday; | 995 return kernel_->persisted_info.store_birthday; |
| 996 } | 996 } |
| 997 | 997 |
| 998 void Directory::set_store_birthday(const string& store_birthday) { | 998 void Directory::set_store_birthday(const string& store_birthday) { |
| 999 ScopedKernelLock lock(this); | 999 ScopedKernelLock lock(this); |
| 1000 if (kernel_->persisted_info.store_birthday == store_birthday) | 1000 if (kernel_->persisted_info.store_birthday == store_birthday) |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 Directory::Kernel* Directory::kernel() { | 1555 Directory::Kernel* Directory::kernel() { |
| 1556 return kernel_; | 1556 return kernel_; |
| 1557 } | 1557 } |
| 1558 | 1558 |
| 1559 const Directory::Kernel* Directory::kernel() const { | 1559 const Directory::Kernel* Directory::kernel() const { |
| 1560 return kernel_; | 1560 return kernel_; |
| 1561 } | 1561 } |
| 1562 | 1562 |
| 1563 } // namespace syncable | 1563 } // namespace syncable |
| 1564 } // namespace syncer | 1564 } // namespace syncer |
| OLD | NEW |