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

Unified Diff: chrome/browser/extensions/api/font_settings/font_settings_api.cc

Issue 11307020: Cleanup: Simplify some extensions / content_settings Observer code by simply DCHECKING instead of u… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Flip DCHECK_EQ arguments to (expected, actual) Created 8 years, 2 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/extensions/api/font_settings/font_settings_api.cc
===================================================================
--- chrome/browser/extensions/api/font_settings/font_settings_api.cc (revision 165014)
+++ chrome/browser/extensions/api/font_settings/font_settings_api.cc (working copy)
@@ -158,30 +158,27 @@
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (type != chrome::NOTIFICATION_PREF_CHANGED) {
- NOTREACHED();
- return;
- }
+ DCHECK_EQ(chrome::NOTIFICATION_PREF_CHANGED, type);
PrefService* pref_service = content::Source<PrefService>(source).ptr();
bool incognito = (pref_service != profile_->GetPrefs());
// We're only observing pref changes on the regular profile.
DCHECK(!incognito);
- const std::string* pref_name =
- content::Details<const std::string>(details).ptr();
+ const std::string& pref_name =
+ *content::Details<const std::string>(details).ptr();
- PrefEventMap::iterator iter = pref_event_map_.find(*pref_name);
+ PrefEventMap::iterator iter = pref_event_map_.find(pref_name);
if (iter != pref_event_map_.end()) {
const std::string& event_name = iter->second.first;
const std::string& key = iter->second.second;
- OnFontPrefChanged(pref_service, *pref_name, event_name, key, incognito);
+ OnFontPrefChanged(pref_service, pref_name, event_name, key, incognito);
return;
}
std::string generic_family;
std::string script;
- if (ParseFontNamePrefPath(*pref_name, &generic_family, &script)) {
- OnFontNamePrefChanged(pref_service, *pref_name, generic_family, script,
+ if (ParseFontNamePrefPath(pref_name, &generic_family, &script)) {
+ OnFontNamePrefChanged(pref_service, pref_name, generic_family, script,
incognito);
return;
}
« no previous file with comments | « chrome/browser/content_settings/cookie_settings.cc ('k') | chrome/browser/extensions/api/preference/preference_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698