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 | |
140 return make_scoped_refptr( | 136 return make_scoped_refptr( |
141 new V4LocalDatabaseManager(base_path, extended_reporting_level_callback)); | 137 new V4LocalDatabaseManager(base_path, extended_reporting_level_callback)); |
142 } | 138 } |
143 | 139 |
144 V4LocalDatabaseManager::V4LocalDatabaseManager( | 140 V4LocalDatabaseManager::V4LocalDatabaseManager( |
145 const base::FilePath& base_path, | 141 const base::FilePath& base_path, |
146 ExtendedReportingLevelCallback extended_reporting_level_callback) | 142 ExtendedReportingLevelCallback extended_reporting_level_callback) |
147 : base_path_(base_path), | 143 : base_path_(base_path), |
148 extended_reporting_level_callback_(extended_reporting_level_callback), | 144 extended_reporting_level_callback_(extended_reporting_level_callback), |
149 list_infos_(GetListInfos()), | 145 list_infos_(GetListInfos()), |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 db_updated_callback_); | 735 db_updated_callback_); |
740 } | 736 } |
741 | 737 |
742 bool V4LocalDatabaseManager::AreStoresAvailableNow( | 738 bool V4LocalDatabaseManager::AreStoresAvailableNow( |
743 const StoresToCheck& stores_to_check) const { | 739 const StoresToCheck& stores_to_check) const { |
744 return enabled_ && v4_database_ && | 740 return enabled_ && v4_database_ && |
745 v4_database_->AreStoresAvailable(stores_to_check); | 741 v4_database_->AreStoresAvailable(stores_to_check); |
746 } | 742 } |
747 | 743 |
748 } // namespace safe_browsing | 744 } // namespace safe_browsing |
OLD | NEW |