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

Unified Diff: chrome/browser/policy/schema_registry_service_factory.cc

Issue 2729093002: Fix crash during sync load of the signin profile (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/schema_registry_service_factory.cc
diff --git a/chrome/browser/policy/schema_registry_service_factory.cc b/chrome/browser/policy/schema_registry_service_factory.cc
index 6c9fd50b43cc265bcabeb970a71404ad8108e030..a2eef5a3a9f7cd3af8b08366cf4c26b81d134781 100644
--- a/chrome/browser/policy/schema_registry_service_factory.cc
+++ b/chrome/browser/policy/schema_registry_service_factory.cc
@@ -123,6 +123,23 @@ SchemaRegistryServiceFactory::CreateForContextInternal(
if (!registry)
registry.reset(new SchemaRegistry);
+#if defined(OS_CHROMEOS)
+ Profile* const profile = Profile::FromBrowserContext(context);
+ if (chromeos::ProfileHelper::IsSigninProfile(profile)) {
+ // Pass the SchemaRegistry of the signin profile to device cloud policy
+ // manager, for being used for fetching the component policies.
+ policy::DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager =
bartfab (slow) 2017/03/03 17:31:28 Nit: #include "chrome/browser/chromeos/policy/devi
emaxx 2017/03/03 17:42:09 Done.
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceCloudPolicyManager();
+ // TODO(tnagel): Do we need to do something for Active Directory management?
+ if (device_cloud_policy_manager) {
+ device_cloud_policy_manager->SetSigninProfileSchemaRegistry(
+ registry.get());
+ }
+ }
+#endif
+
std::unique_ptr<SchemaRegistryService> service(new SchemaRegistryService(
std::move(registry), chrome_schema, global_registry));
registries_[context] = service.get();

Powered by Google App Engine
This is Rietveld 408576698