| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const base::FilePath& base_path) { | 131 const base::FilePath& base_path) { |
| 132 if (!V4FeatureList::IsLocalDatabaseManagerEnabled()) { | 132 if (!V4FeatureList::IsLocalDatabaseManagerEnabled()) { |
| 133 return nullptr; | 133 return nullptr; |
| 134 } | 134 } |
| 135 | 135 |
| 136 return make_scoped_refptr(new V4LocalDatabaseManager(base_path)); | 136 return make_scoped_refptr(new V4LocalDatabaseManager(base_path)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 V4LocalDatabaseManager::V4LocalDatabaseManager(const base::FilePath& base_path) | 139 V4LocalDatabaseManager::V4LocalDatabaseManager(const base::FilePath& base_path) |
| 140 : base_path_(base_path), | 140 : base_path_(base_path), |
| 141 enabled_(false), | |
| 142 list_infos_(GetListInfos()), | 141 list_infos_(GetListInfos()), |
| 143 weak_factory_(this) { | 142 weak_factory_(this) { |
| 144 DCHECK(!base_path_.empty()); | 143 DCHECK(!base_path_.empty()); |
| 145 DCHECK(!list_infos_.empty()); | 144 DCHECK(!list_infos_.empty()); |
| 146 | 145 |
| 147 DVLOG(1) << "V4LocalDatabaseManager::V4LocalDatabaseManager: " | 146 DVLOG(1) << "V4LocalDatabaseManager::V4LocalDatabaseManager: " |
| 148 << "base_path_: " << base_path_.AsUTF8Unsafe(); | 147 << "base_path_: " << base_path_.AsUTF8Unsafe(); |
| 149 } | 148 } |
| 150 | 149 |
| 151 V4LocalDatabaseManager::~V4LocalDatabaseManager() { | 150 V4LocalDatabaseManager::~V4LocalDatabaseManager() { |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 db_updated_callback_); | 722 db_updated_callback_); |
| 724 } | 723 } |
| 725 | 724 |
| 726 bool V4LocalDatabaseManager::AreStoresAvailableNow( | 725 bool V4LocalDatabaseManager::AreStoresAvailableNow( |
| 727 const StoresToCheck& stores_to_check) const { | 726 const StoresToCheck& stores_to_check) const { |
| 728 return enabled_ && v4_database_ && | 727 return enabled_ && v4_database_ && |
| 729 v4_database_->AreStoresAvailable(stores_to_check); | 728 v4_database_->AreStoresAvailable(stores_to_check); |
| 730 } | 729 } |
| 731 | 730 |
| 732 } // namespace safe_browsing | 731 } // namespace safe_browsing |
| OLD | NEW |