OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/syncable/syncable.h" | 5 #include "chrome/browser/sync/syncable/syncable.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 } | 788 } |
789 | 789 |
790 void Directory::GetDownloadProgressAsString( | 790 void Directory::GetDownloadProgressAsString( |
791 ModelType model_type, | 791 ModelType model_type, |
792 std::string* value_out) const { | 792 std::string* value_out) const { |
793 ScopedKernelLock lock(this); | 793 ScopedKernelLock lock(this); |
794 kernel_->persisted_info.download_progress[model_type].SerializeToString( | 794 kernel_->persisted_info.download_progress[model_type].SerializeToString( |
795 value_out); | 795 value_out); |
796 } | 796 } |
797 | 797 |
| 798 size_t Directory::GetEntriesCount() const { |
| 799 return kernel_->metahandles_index ? kernel_->metahandles_index->size() : 0; |
| 800 } |
| 801 |
798 void Directory::SetDownloadProgress( | 802 void Directory::SetDownloadProgress( |
799 ModelType model_type, | 803 ModelType model_type, |
800 const sync_pb::DataTypeProgressMarker& new_progress) { | 804 const sync_pb::DataTypeProgressMarker& new_progress) { |
801 ScopedKernelLock lock(this); | 805 ScopedKernelLock lock(this); |
802 kernel_->persisted_info.download_progress[model_type].CopyFrom(new_progress); | 806 kernel_->persisted_info.download_progress[model_type].CopyFrom(new_progress); |
803 kernel_->info_status = KERNEL_SHARE_INFO_DIRTY; | 807 kernel_->info_status = KERNEL_SHARE_INFO_DIRTY; |
804 } | 808 } |
805 | 809 |
806 bool Directory::initial_sync_ended_for_type(ModelType type) const { | 810 bool Directory::initial_sync_ended_for_type(ModelType type) const { |
807 ScopedKernelLock lock(this); | 811 ScopedKernelLock lock(this); |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 Directory::ParentIdChildIndex::iterator | 1945 Directory::ParentIdChildIndex::iterator |
1942 Directory::GetParentChildIndexUpperBound(const ScopedKernelLock& lock, | 1946 Directory::GetParentChildIndexUpperBound(const ScopedKernelLock& lock, |
1943 const Id& parent_id) { | 1947 const Id& parent_id) { |
1944 // The upper bound of |parent_id|'s range is the lower | 1948 // The upper bound of |parent_id|'s range is the lower |
1945 // bound of |++parent_id|'s range. | 1949 // bound of |++parent_id|'s range. |
1946 return GetParentChildIndexLowerBound(lock, | 1950 return GetParentChildIndexLowerBound(lock, |
1947 parent_id.GetLexicographicSuccessor()); | 1951 parent_id.GetLexicographicSuccessor()); |
1948 } | 1952 } |
1949 | 1953 |
1950 } // namespace syncable | 1954 } // namespace syncable |
OLD | NEW |