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

Unified Diff: chrome/browser/sync/chrome_sync_client.cc

Issue 2847803008: ProfileSyncService: Handle null SupervisedUserService (Closed)
Patch Set: break 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/chrome_sync_client.cc
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc
index 6a489904cb124e421cfa86dd44245c65dfc1c0d5..4151c8ae089dfb9abbb1c6db9c0a2e98b0a6ab2d 100644
--- a/chrome/browser/sync/chrome_sync_client.cc
+++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -447,10 +447,15 @@ ChromeSyncClient::GetSyncableServiceForType(syncer::ModelType type) {
return SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
profile_)->AsWeakPtr();
#endif // !defined(OS_ANDROID)
- case syncer::SUPERVISED_USER_WHITELISTS:
- return SupervisedUserServiceFactory::GetForProfile(profile_)
- ->GetWhitelistService()
- ->AsWeakPtr();
+ case syncer::SUPERVISED_USER_WHITELISTS: {
+ // SupervisedUserServiceFactory depends on ProfileSyncServiceFactory
skym 2017/05/01 17:24:03 I'd rephrase this to talk about the dep in the oth
Marc Treib 2017/05/02 08:27:36 +1
rishiag 2017/05/05 17:22:02 Done.
+ // so SupervisedUserService might be destroyed before ProfileSyncService.
+ SupervisedUserService* supervised_user_service =
+ SupervisedUserServiceFactory::GetForProfile(profile_);
Marc Treib 2017/05/02 08:27:36 SupervisedUserServiceFactory::GetForProfile will c
rishiag 2017/05/05 17:22:02 Done.
+ if (supervised_user_service)
+ return supervised_user_service->GetWhitelistService()->AsWeakPtr();
+ return base::WeakPtr<syncer::SyncableService>();
+ }
#endif // BUILDFLAG(ENABLE_SUPERVISED_USERS)
case syncer::ARTICLES: {
dom_distiller::DomDistillerService* service =
@@ -507,7 +512,7 @@ ChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) {
->AsWeakPtr();
#endif // defined(OS_CHROMEOS)
case syncer::TYPED_URLS:
- // TODO(gangwu):implement TypedURLSyncBridge and return real
+ // TODO(gangwu): Implement TypedURLSyncBridge and return real
// TypedURLSyncBridge here.
return base::WeakPtr<syncer::ModelTypeSyncBridge>();
default:
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service_factory.cc ('k') | chrome/browser/sync/profile_sync_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698