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 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 } | 623 } |
624 } else { | 624 } else { |
625 LOG(ERROR) << "Failed to create resource map DB: " << status.ToString(); | 625 LOG(ERROR) << "Failed to create resource map DB: " << status.ToString(); |
626 init_result = LevelDBStatusToDBInitStatus(status); | 626 init_result = LevelDBStatusToDBInitStatus(status); |
627 } | 627 } |
628 } | 628 } |
629 | 629 |
630 UMA_HISTOGRAM_ENUMERATION("Drive.MetadataDBInitResult", | 630 UMA_HISTOGRAM_ENUMERATION("Drive.MetadataDBInitResult", |
631 init_result, | 631 init_result, |
632 DB_INIT_MAX_VALUE); | 632 DB_INIT_MAX_VALUE); |
633 return resource_map_; | 633 return !!resource_map_; |
634 } | 634 } |
635 | 635 |
636 void ResourceMetadataStorage::RecoverCacheInfoFromTrashedResourceMap( | 636 void ResourceMetadataStorage::RecoverCacheInfoFromTrashedResourceMap( |
637 RecoveredCacheInfoMap* out_info) { | 637 RecoveredCacheInfoMap* out_info) { |
638 const base::FilePath trashed_resource_map_path = | 638 const base::FilePath trashed_resource_map_path = |
639 directory_path_.Append(kTrashedResourceMapDBName); | 639 directory_path_.Append(kTrashedResourceMapDBName); |
640 | 640 |
641 if (!base::PathExists(trashed_resource_map_path)) | 641 if (!base::PathExists(trashed_resource_map_path)) |
642 return; | 642 return; |
643 | 643 |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 RecordCheckValidityFailure( | 1058 RecordCheckValidityFailure( |
1059 CHECK_VALIDITY_FAILURE_CHILD_ENTRY_COUNT_MISMATCH); | 1059 CHECK_VALIDITY_FAILURE_CHILD_ENTRY_COUNT_MISMATCH); |
1060 return false; | 1060 return false; |
1061 } | 1061 } |
1062 | 1062 |
1063 return true; | 1063 return true; |
1064 } | 1064 } |
1065 | 1065 |
1066 } // namespace internal | 1066 } // namespace internal |
1067 } // namespace drive | 1067 } // namespace drive |
OLD | NEW |