OLD | NEW |
(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/public/cpp/pref_registry_serializer.h" |
| 6 |
| 7 #include "components/prefs/pref_registry.h" |
| 8 |
| 9 namespace prefs { |
| 10 |
| 11 mojom::PrefRegistryPtr SerializePrefRegistry(PrefRegistry& pref_registry) { |
| 12 auto registry = mojom::PrefRegistry::New(); |
| 13 for (auto& pref : pref_registry) { |
| 14 registry->registrations[pref.first] = mojom::PrefRegistration::New( |
| 15 pref.second->CreateDeepCopy(), |
| 16 pref_registry.GetRegistrationFlags(pref.first)); |
| 17 } |
| 18 return registry; |
| 19 } |
| 20 |
| 21 } // namespace prefs |
OLD | NEW |