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

Unified Diff: chrome/browser/task_manager/web_contents_information.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/task_manager/web_contents_information.cc
diff --git a/chrome/browser/task_manager/web_contents_information.cc b/chrome/browser/task_manager/web_contents_information.cc
index c82cd1697cb747c795dc194713f6cc3615583fbc..f2f7b513668c5b22f1a1c655dd6fc6ee4b199561 100644
--- a/chrome/browser/task_manager/web_contents_information.cc
+++ b/chrome/browser/task_manager/web_contents_information.cc
@@ -38,15 +38,12 @@ void NotificationObservingWebContentsInformation::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
+ DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_CONNECTED, type);
+
content::WebContents* web_contents =
content::Source<content::WebContents>(source).ptr();
-
- switch (type) {
- case content::NOTIFICATION_WEB_CONTENTS_CONNECTED:
- if (CheckOwnership(web_contents))
- observer_callback_.Run(web_contents);
- break;
- }
+ if (CheckOwnership(web_contents))
+ observer_callback_.Run(web_contents);
}
} // namespace task_manager
« no previous file with comments | « chrome/browser/ssl/ssl_error_handler.cc ('k') | chrome/browser/web_applications/update_shortcut_worker_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698