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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media/permission_bubble_media_access_handler.h" 5 #include "chrome/browser/media/permission_bubble_media_access_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "chrome/browser/media/media_permission.h" 10 #include "chrome/browser/media/media_permission.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 232
233 callback.Run(devices, result, std::move(ui)); 233 callback.Run(devices, result, std::move(ui));
234 } 234 }
235 235
236 void PermissionBubbleMediaAccessHandler::Observe( 236 void PermissionBubbleMediaAccessHandler::Observe(
237 int type, 237 int type,
238 const content::NotificationSource& source, 238 const content::NotificationSource& source,
239 const content::NotificationDetails& details) { 239 const content::NotificationDetails& details) {
240 DCHECK_CURRENTLY_ON(BrowserThread::UI); 240 DCHECK_CURRENTLY_ON(BrowserThread::UI);
241 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { 241 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type);
242 content::WebContents* web_contents = 242
243 content::Source<content::WebContents>(source).ptr(); 243 pending_requests_.erase(content::Source<content::WebContents>(source).ptr());
244 pending_requests_.erase(web_contents);
245 }
246 } 244 }
OLDNEW
« 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