| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "services/preferences/persistent_pref_store_factory.h" | 5 #include "services/preferences/persistent_pref_store_factory.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "components/prefs/in_memory_pref_store.h" |
| 10 #include "components/prefs/json_pref_store.h" | 11 #include "components/prefs/json_pref_store.h" |
| 11 #include "components/prefs/pref_filter.h" | 12 #include "components/prefs/pref_filter.h" |
| 12 #include "services/preferences/persistent_pref_store_impl.h" | 13 #include "services/preferences/persistent_pref_store_impl.h" |
| 13 #include "services/preferences/tracked/tracked_persistent_pref_store_factory.h" | 14 #include "services/preferences/tracked/tracked_persistent_pref_store_factory.h" |
| 14 | 15 |
| 15 namespace prefs { | 16 namespace prefs { |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 std::unique_ptr<PersistentPrefStoreImpl> CreateSimplePersistentPrefStore( | 19 std::unique_ptr<PersistentPrefStoreImpl> CreateSimplePersistentPrefStore( |
| 19 mojom::SimplePersistentPrefStoreConfigurationPtr config, | 20 mojom::SimplePersistentPrefStoreConfigurationPtr config, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 37 return CreateSimplePersistentPrefStore( | 38 return CreateSimplePersistentPrefStore( |
| 38 std::move(configuration->get_simple_configuration()), worker_pool, | 39 std::move(configuration->get_simple_configuration()), worker_pool, |
| 39 std::move(on_initialized)); | 40 std::move(on_initialized)); |
| 40 } | 41 } |
| 41 if (configuration->is_tracked_configuration()) { | 42 if (configuration->is_tracked_configuration()) { |
| 42 return base::MakeUnique<PersistentPrefStoreImpl>( | 43 return base::MakeUnique<PersistentPrefStoreImpl>( |
| 43 CreateTrackedPersistentPrefStore( | 44 CreateTrackedPersistentPrefStore( |
| 44 std::move(configuration->get_tracked_configuration()), worker_pool), | 45 std::move(configuration->get_tracked_configuration()), worker_pool), |
| 45 std::move(on_initialized)); | 46 std::move(on_initialized)); |
| 46 } | 47 } |
| 48 if (configuration->is_incognito_configuration()) { |
| 49 return base::MakeUnique<PersistentPrefStoreImpl>(new InMemoryPrefStore(), |
| 50 std::move(on_initialized)); |
| 51 } |
| 47 NOTREACHED(); | 52 NOTREACHED(); |
| 48 return nullptr; | 53 return nullptr; |
| 49 } | 54 } |
| 50 | 55 |
| 51 } // namespace prefs | 56 } // namespace prefs |
| OLD | NEW |