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 "components/drive/resource_metadata_storage.h" | 5 #include "components/drive/resource_metadata_storage.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 &batch); | 819 &batch); |
820 return LevelDBStatusToFileError(status); | 820 return LevelDBStatusToFileError(status); |
821 } | 821 } |
822 | 822 |
823 std::unique_ptr<ResourceMetadataStorage::Iterator> | 823 std::unique_ptr<ResourceMetadataStorage::Iterator> |
824 ResourceMetadataStorage::GetIterator() { | 824 ResourceMetadataStorage::GetIterator() { |
825 base::ThreadRestrictions::AssertIOAllowed(); | 825 base::ThreadRestrictions::AssertIOAllowed(); |
826 | 826 |
827 std::unique_ptr<leveldb::Iterator> it( | 827 std::unique_ptr<leveldb::Iterator> it( |
828 resource_map_->NewIterator(leveldb::ReadOptions())); | 828 resource_map_->NewIterator(leveldb::ReadOptions())); |
829 return base::WrapUnique(new Iterator(std::move(it))); | 829 return base::MakeUnique<Iterator>(std::move(it)); |
830 } | 830 } |
831 | 831 |
832 FileError ResourceMetadataStorage::GetChild(const std::string& parent_id, | 832 FileError ResourceMetadataStorage::GetChild(const std::string& parent_id, |
833 const std::string& child_name, | 833 const std::string& child_name, |
834 std::string* child_id) { | 834 std::string* child_id) { |
835 base::ThreadRestrictions::AssertIOAllowed(); | 835 base::ThreadRestrictions::AssertIOAllowed(); |
836 DCHECK(!parent_id.empty()); | 836 DCHECK(!parent_id.empty()); |
837 DCHECK(!child_name.empty()); | 837 DCHECK(!child_name.empty()); |
838 | 838 |
839 const leveldb::Status status = | 839 const leveldb::Status status = |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 RecordCheckValidityFailure( | 1061 RecordCheckValidityFailure( |
1062 CHECK_VALIDITY_FAILURE_CHILD_ENTRY_COUNT_MISMATCH); | 1062 CHECK_VALIDITY_FAILURE_CHILD_ENTRY_COUNT_MISMATCH); |
1063 return false; | 1063 return false; |
1064 } | 1064 } |
1065 | 1065 |
1066 return true; | 1066 return true; |
1067 } | 1067 } |
1068 | 1068 |
1069 } // namespace internal | 1069 } // namespace internal |
1070 } // namespace drive | 1070 } // namespace drive |
OLD | NEW |