Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: services/preferences/persistent_pref_store_factory.cc

Issue 2738353002: Pref service: integrate PersistentPrefStoreImpl with PrefStoreManagerImpl. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "services/preferences/persistent_pref_store_factory.h"
6
7 #include <memory>
8 #include <utility>
9
10 #include "components/prefs/json_pref_store.h"
11 #include "components/prefs/pref_filter.h"
12 #include "services/preferences/persistent_pref_store_impl.h"
13
14 namespace prefs {
15 namespace {
16
17 std::unique_ptr<PersistentPrefStoreImpl> CreateSimplePersistentPrefStore(
18 mojom::SimplePersistentPrefStoreConfigurationPtr config,
19 base::SequencedWorkerPool* worker_pool) {
20 return base::MakeUnique<PersistentPrefStoreImpl>(
21 new JsonPrefStore(config->pref_filename,
22 JsonPrefStore::GetTaskRunnerForFile(
23 config->pref_filename.DirName(), worker_pool),
24 nullptr),
25 nullptr);
26 }
27
28 } // namespace
29
30 std::unique_ptr<PersistentPrefStoreImpl> CreatePersistentPrefStore(
31 mojom::PersistentPrefStoreConfigurationPtr configuration,
32 base::SequencedWorkerPool* worker_pool) {
33 if (configuration->is_simple_configuration()) {
34 return CreateSimplePersistentPrefStore(
35 std::move(configuration->get_simple_configuration()), worker_pool);
36 }
37 NOTREACHED();
38 return nullptr;
39 }
40
41 } // namespace prefs
OLDNEW
« no previous file with comments | « services/preferences/persistent_pref_store_factory.h ('k') | services/preferences/public/cpp/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698