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

Unified Diff: chrome/browser/policy/cloud/user_policy_signin_service_base.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/cloud/user_policy_signin_service_base.cc
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_base.cc b/chrome/browser/policy/cloud/user_policy_signin_service_base.cc
index e73e834ce77c8d9e3dd3b95f1f5a8f9cffedf982..c26ea2f6e31464314e68ca74809955555e68cf95 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_base.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_base.cc
@@ -82,21 +82,17 @@ void UserPolicySigninServiceBase::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_PROFILE_ADDED:
- // A new profile has been loaded - if it's signed in, then initialize the
- // UCPM, otherwise shut down the UCPM (which deletes any cached policy
- // data). This must be done here instead of at constructor time because
- // the Profile is not fully initialized when this object is constructed
- // (DoFinalInit() has not yet been called, so ProfileIOData and
- // SSLConfigServiceManager have not been created yet).
- // TODO(atwilson): Switch to using a timer instead, to avoid contention
- // with other services at startup (http://crbug.com/165468).
- InitializeOnProfileReady(content::Source<Profile>(source).ptr());
- break;
- default:
- NOTREACHED();
- }
+ DCHECK_EQ(chrome::NOTIFICATION_PROFILE_ADDED, type);
+
+ // A new profile has been loaded - if it's signed in, then initialize the
+ // UCPM, otherwise shut down the UCPM (which deletes any cached policy
+ // data). This must be done here instead of at constructor time because
+ // the Profile is not fully initialized when this object is constructed
+ // (DoFinalInit() has not yet been called, so ProfileIOData and
+ // SSLConfigServiceManager have not been created yet).
+ // TODO(atwilson): Switch to using a timer instead, to avoid contention
+ // with other services at startup (http://crbug.com/165468).
+ InitializeOnProfileReady(content::Source<Profile>(source).ptr());
}
void UserPolicySigninServiceBase::OnInitializationCompleted(
« no previous file with comments | « chrome/browser/policy/cloud/user_cloud_policy_invalidator.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698