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 ScopedKernelLock lock(this); |
| 800 return kernel_->metahandles_index ? kernel_->metahandles_index->size() : 0; |
| 801 } |
| 802 |
798 void Directory::SetDownloadProgress( | 803 void Directory::SetDownloadProgress( |
799 ModelType model_type, | 804 ModelType model_type, |
800 const sync_pb::DataTypeProgressMarker& new_progress) { | 805 const sync_pb::DataTypeProgressMarker& new_progress) { |
801 ScopedKernelLock lock(this); | 806 ScopedKernelLock lock(this); |
802 kernel_->persisted_info.download_progress[model_type].CopyFrom(new_progress); | 807 kernel_->persisted_info.download_progress[model_type].CopyFrom(new_progress); |
803 kernel_->info_status = KERNEL_SHARE_INFO_DIRTY; | 808 kernel_->info_status = KERNEL_SHARE_INFO_DIRTY; |
804 } | 809 } |
805 | 810 |
806 bool Directory::initial_sync_ended_for_type(ModelType type) const { | 811 bool Directory::initial_sync_ended_for_type(ModelType type) const { |
807 ScopedKernelLock lock(this); | 812 ScopedKernelLock lock(this); |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 Directory::ParentIdChildIndex::iterator | 1946 Directory::ParentIdChildIndex::iterator |
1942 Directory::GetParentChildIndexUpperBound(const ScopedKernelLock& lock, | 1947 Directory::GetParentChildIndexUpperBound(const ScopedKernelLock& lock, |
1943 const Id& parent_id) { | 1948 const Id& parent_id) { |
1944 // The upper bound of |parent_id|'s range is the lower | 1949 // The upper bound of |parent_id|'s range is the lower |
1945 // bound of |++parent_id|'s range. | 1950 // bound of |++parent_id|'s range. |
1946 return GetParentChildIndexLowerBound(lock, | 1951 return GetParentChildIndexLowerBound(lock, |
1947 parent_id.GetLexicographicSuccessor()); | 1952 parent_id.GetLexicographicSuccessor()); |
1948 } | 1953 } |
1949 | 1954 |
1950 } // namespace syncable | 1955 } // namespace syncable |
OLD | NEW |