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

Unified Diff: chrome/browser/media/permission_bubble_media_access_handler.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
« no previous file with comments | « chrome/browser/jumplist_win.cc ('k') | chrome/browser/plugins/plugin_status_pref_setter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/permission_bubble_media_access_handler.cc
diff --git a/chrome/browser/media/permission_bubble_media_access_handler.cc b/chrome/browser/media/permission_bubble_media_access_handler.cc
index f4a6e6cfa70fde4cbfee64123a4f91803d2fecd7..7a110159a58fe089002a84126791eff38e48ece4 100644
--- a/chrome/browser/media/permission_bubble_media_access_handler.cc
+++ b/chrome/browser/media/permission_bubble_media_access_handler.cc
@@ -238,9 +238,7 @@ void PermissionBubbleMediaAccessHandler::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) {
- content::WebContents* web_contents =
- content::Source<content::WebContents>(source).ptr();
- pending_requests_.erase(web_contents);
- }
+ DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type);
+
+ pending_requests_.erase(content::Source<content::WebContents>(source).ptr());
}
« no previous file with comments | « chrome/browser/jumplist_win.cc ('k') | chrome/browser/plugins/plugin_status_pref_setter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698