| 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 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 5 #ifndef COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
| 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 6 #define COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 std::unique_ptr<StoreMap> store_map); | 82 std::unique_ptr<StoreMap> store_map); |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 friend class V4DatabaseTest; | 85 friend class V4DatabaseTest; |
| 86 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestSetupDatabaseWithFakeStores); | 86 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestSetupDatabaseWithFakeStores); |
| 87 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, | 87 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, |
| 88 TestSetupDatabaseWithFakeStoresFailsReset); | 88 TestSetupDatabaseWithFakeStoresFailsReset); |
| 89 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNewStates); | 89 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNewStates); |
| 90 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNoNewState); | 90 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithNoNewState); |
| 91 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithEmptyUpdate); | 91 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithEmptyUpdate); |
| 92 FRIEND_TEST_ALL_PREFIXES(V4DatabaseTest, TestApplyUpdateWithInvalidUpdate); |
| 92 | 93 |
| 93 // Makes the passed |factory| the factory used to instantiate a V4Store. Only | 94 // Makes the passed |factory| the factory used to instantiate a V4Store. Only |
| 94 // for tests. | 95 // for tests. |
| 95 static void RegisterStoreFactoryForTest(V4StoreFactory* factory) { | 96 static void RegisterStoreFactoryForTest(V4StoreFactory* factory) { |
| 96 factory_ = factory; | 97 factory_ = factory; |
| 97 } | 98 } |
| 98 | 99 |
| 99 // Factory method to create a V4Database. When the database creation is | 100 // Factory method to create a V4Database. When the database creation is |
| 100 // complete, it calls the NewDatabaseReadyCallback on |callback_task_runner|. | 101 // complete, it calls the NewDatabaseReadyCallback on |callback_task_runner|. |
| 101 static void CreateOnTaskRunner( | 102 static void CreateOnTaskRunner( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 126 // that needed updating and is ready for the next update. It should only be | 127 // that needed updating and is ready for the next update. It should only be |
| 127 // accessed on the IO thread. | 128 // accessed on the IO thread. |
| 128 int pending_store_updates_; | 129 int pending_store_updates_; |
| 129 | 130 |
| 130 DISALLOW_COPY_AND_ASSIGN(V4Database); | 131 DISALLOW_COPY_AND_ASSIGN(V4Database); |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 } // namespace safe_browsing | 134 } // namespace safe_browsing |
| 134 | 135 |
| 135 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ | 136 #endif // COMPONENTS_SAFE_BROWSING_DB_V4_DATABASE_H_ |
| OLD | NEW |