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

Side by Side Diff: components/sync_preferences/pref_service_syncable_factory.cc

Issue 2778643002: Pref service: Filter updates from read-only pref stores. (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
« no previous file with comments | « no previous file | services/preferences/persistent_pref_store_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/sync_preferences/pref_service_syncable_factory.h" 5 #include "components/sync_preferences/pref_service_syncable_factory.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "components/pref_registry/pref_registry_syncable.h" 9 #include "components/pref_registry/pref_registry_syncable.h"
10 #include "components/prefs/default_pref_store.h" 10 #include "components/prefs/default_pref_store.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 scoped_refptr<::PrefStore> backing_pref_store, 63 scoped_refptr<::PrefStore> backing_pref_store,
64 PrefValueStore::PrefStoreType type) { 64 PrefValueStore::PrefStoreType type) {
65 // If we're testing or if the prefs service feature flag is off we don't 65 // If we're testing or if the prefs service feature flag is off we don't
66 // register. 66 // register.
67 if (!connector) 67 if (!connector)
68 return backing_pref_store; 68 return backing_pref_store;
69 69
70 prefs::mojom::PrefStoreRegistryPtr registry_ptr; 70 prefs::mojom::PrefStoreRegistryPtr registry_ptr;
71 connector->BindInterface(prefs::mojom::kPrefStoreServiceName, &registry_ptr); 71 connector->BindInterface(prefs::mojom::kPrefStoreServiceName, &registry_ptr);
72 return make_scoped_refptr(new prefs::PrefStoreAdapter( 72 return make_scoped_refptr(new prefs::PrefStoreAdapter(
73 backing_pref_store, 73 backing_pref_store, prefs::PrefStoreImpl::Create(
74 prefs::PrefStoreImpl::Create(std::move(registry_ptr), backing_pref_store, 74 registry_ptr.get(), backing_pref_store, type)));
75 type)));
76 } 75 }
77 76
78 } // namespace 77 } // namespace
79 78
80 std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable( 79 std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable(
81 user_prefs::PrefRegistrySyncable* pref_registry, 80 user_prefs::PrefRegistrySyncable* pref_registry,
82 service_manager::Connector* connector) { 81 service_manager::Connector* connector) {
83 TRACE_EVENT0("browser", "PrefServiceSyncableFactory::CreateSyncable"); 82 TRACE_EVENT0("browser", "PrefServiceSyncableFactory::CreateSyncable");
84 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); 83 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
85 84
(...skipping 15 matching lines...) Expand all
101 new PrefValueStore(managed.get(), supervised.get(), extension.get(), 100 new PrefValueStore(managed.get(), supervised.get(), extension.get(),
102 command_line.get(), user_prefs_.get(), 101 command_line.get(), user_prefs_.get(),
103 recommended.get(), pref_registry->defaults().get(), 102 recommended.get(), pref_registry->defaults().get(),
104 pref_notifier), 103 pref_notifier),
105 user_prefs_.get(), pref_registry, pref_model_associator_client_, 104 user_prefs_.get(), pref_registry, pref_model_associator_client_,
106 read_error_callback_, async_)); 105 read_error_callback_, async_));
107 return pref_service; 106 return pref_service;
108 } 107 }
109 108
110 } // namespace sync_preferences 109 } // namespace sync_preferences
OLDNEW
« no previous file with comments | « no previous file | services/preferences/persistent_pref_store_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698