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

Side by Side Diff: services/preferences/public/cpp/pref_registry_serializer.cc

Issue 2803023005: Switch base::Value typemapping to be by value instead of by unique_ptr.
Patch Set: Created 3 years, 8 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
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/public/cpp/pref_registry_serializer.h" 5 #include "services/preferences/public/cpp/pref_registry_serializer.h"
6 6
7 #include "components/prefs/pref_registry.h" 7 #include "components/prefs/pref_registry.h"
8 8
9 namespace prefs { 9 namespace prefs {
10 10
11 mojom::PrefRegistryPtr SerializePrefRegistry(PrefRegistry& pref_registry) { 11 mojom::PrefRegistryPtr SerializePrefRegistry(PrefRegistry& pref_registry) {
12 auto registry = mojom::PrefRegistry::New(); 12 auto registry = mojom::PrefRegistry::New();
13 for (auto& pref : pref_registry) { 13 for (auto& pref : pref_registry) {
14 registry->registrations[pref.first] = mojom::PrefRegistration::New( 14 registry->registrations[pref.first] = mojom::PrefRegistration::New(
15 pref.second->CreateDeepCopy(), 15 *pref.second, pref_registry.GetRegistrationFlags(pref.first));
16 pref_registry.GetRegistrationFlags(pref.first));
17 } 16 }
18 return registry; 17 return registry;
19 } 18 }
20 19
21 } // namespace prefs 20 } // namespace prefs
OLDNEW
« no previous file with comments | « services/preferences/public/cpp/persistent_pref_store_client.cc ('k') | services/preferences/public/cpp/pref_store_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698