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

Unified Diff: chrome/browser/chromeos/login/auth/auth_prewarmer.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/login/auth/auth_prewarmer.cc
diff --git a/chrome/browser/chromeos/login/auth/auth_prewarmer.cc b/chrome/browser/chromeos/login/auth/auth_prewarmer.cc
index 881ec2ec096cbcc983da4b2fb6a5ce629987c0ff..17ce83bf3484c348ddde53ea0befa3d4e7322887 100644
--- a/chrome/browser/chromeos/login/auth/auth_prewarmer.cc
+++ b/chrome/browser/chromeos/login/auth/auth_prewarmer.cc
@@ -77,18 +77,13 @@ void AuthPrewarmer::DefaultNetworkChanged(const NetworkState* network) {
void AuthPrewarmer::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- case chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED:
- registrar_.Remove(
- this,
- chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED,
- content::Source<Profile>(ProfileHelper::GetSigninProfile()));
- if (IsNetworkConnected())
- DoPrewarm();
- break;
- default:
- NOTREACHED();
- }
+ DCHECK_EQ(chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED,
+ type);
+ registrar_.Remove(
+ this, chrome::NOTIFICATION_PROFILE_URL_REQUEST_CONTEXT_GETTER_INITIALIZED,
+ content::Source<Profile>(ProfileHelper::GetSigninProfile()));
+ if (IsNetworkConnected())
+ DoPrewarm();
}
void AuthPrewarmer::DoPrewarm() {

Powered by Google App Engine
This is Rietveld 408576698