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

Unified Diff: chrome/browser/chromeos/policy/cloud_external_data_policy_observer.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/chromeos/policy/cloud_external_data_policy_observer.cc
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc
index 74e7c9d9b3f2f74aa6dcf977efe9511877900925..196b6a0ad92b5354d8544e2b9deb052834a3060a 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer.cc
@@ -158,12 +158,9 @@ void CloudExternalDataPolicyObserver::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (type != chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED) {
- NOTREACHED();
- return;
- }
- Profile* profile = content::Details<Profile>(details).ptr();
+ DCHECK_EQ(chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, type);
+ Profile* profile = content::Details<Profile>(details).ptr();
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
if (!user) {

Powered by Google App Engine
This is Rietveld 408576698