| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // This file should not be build on Android but is currently getting built. | 5 // This file should not be build on Android but is currently getting built. |
| 6 // TODO(vakh): Fix that: http://crbug.com/621647 | 6 // TODO(vakh): Fix that: http://crbug.com/621647 |
| 7 | 7 |
| 8 #include "components/safe_browsing_db/v4_local_database_manager.h" | 8 #include "components/safe_browsing_db/v4_local_database_manager.h" |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 stores_to_check(stores_to_check) { | 126 stores_to_check(stores_to_check) { |
| 127 full_hashes.assign(full_hashes_set.begin(), full_hashes_set.end()); | 127 full_hashes.assign(full_hashes_set.begin(), full_hashes_set.end()); |
| 128 } | 128 } |
| 129 | 129 |
| 130 V4LocalDatabaseManager::PendingCheck::~PendingCheck() {} | 130 V4LocalDatabaseManager::PendingCheck::~PendingCheck() {} |
| 131 | 131 |
| 132 // static | 132 // static |
| 133 scoped_refptr<V4LocalDatabaseManager> V4LocalDatabaseManager::Create( | 133 scoped_refptr<V4LocalDatabaseManager> V4LocalDatabaseManager::Create( |
| 134 const base::FilePath& base_path, | 134 const base::FilePath& base_path, |
| 135 ExtendedReportingLevelCallback extended_reporting_level_callback) { | 135 ExtendedReportingLevelCallback extended_reporting_level_callback) { |
| 136 if (!V4FeatureList::IsLocalDatabaseManagerEnabled()) { |
| 137 return nullptr; |
| 138 } |
| 139 |
| 136 return make_scoped_refptr( | 140 return make_scoped_refptr( |
| 137 new V4LocalDatabaseManager(base_path, extended_reporting_level_callback)); | 141 new V4LocalDatabaseManager(base_path, extended_reporting_level_callback)); |
| 138 } | 142 } |
| 139 | 143 |
| 140 V4LocalDatabaseManager::V4LocalDatabaseManager( | 144 V4LocalDatabaseManager::V4LocalDatabaseManager( |
| 141 const base::FilePath& base_path, | 145 const base::FilePath& base_path, |
| 142 ExtendedReportingLevelCallback extended_reporting_level_callback) | 146 ExtendedReportingLevelCallback extended_reporting_level_callback) |
| 143 : base_path_(base_path), | 147 : base_path_(base_path), |
| 144 extended_reporting_level_callback_(extended_reporting_level_callback), | 148 extended_reporting_level_callback_(extended_reporting_level_callback), |
| 145 list_infos_(GetListInfos()), | 149 list_infos_(GetListInfos()), |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 db_updated_callback_); | 739 db_updated_callback_); |
| 736 } | 740 } |
| 737 | 741 |
| 738 bool V4LocalDatabaseManager::AreStoresAvailableNow( | 742 bool V4LocalDatabaseManager::AreStoresAvailableNow( |
| 739 const StoresToCheck& stores_to_check) const { | 743 const StoresToCheck& stores_to_check) const { |
| 740 return enabled_ && v4_database_ && | 744 return enabled_ && v4_database_ && |
| 741 v4_database_->AreStoresAvailable(stores_to_check); | 745 v4_database_->AreStoresAvailable(stores_to_check); |
| 742 } | 746 } |
| 743 | 747 |
| 744 } // namespace safe_browsing | 748 } // namespace safe_browsing |
| OLD | NEW |