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

Unified Diff: chrome/browser/media/webrtc/media_stream_devices_controller.cc

Issue 2842493003: Fix use-after-move in media/webrtc permission prompting code (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc/media_stream_devices_controller.cc
diff --git a/chrome/browser/media/webrtc/media_stream_devices_controller.cc b/chrome/browser/media/webrtc/media_stream_devices_controller.cc
index 9a867c301c00791fd34809f48f475edc0d427cda..768ef2b0fc9b8e5b0b2fcc5ff5592526b00fd55b 100644
--- a/chrome/browser/media/webrtc/media_stream_devices_controller.cc
+++ b/chrome/browser/media/webrtc/media_stream_devices_controller.cc
@@ -430,14 +430,16 @@ void MediaStreamDevicesController::RequestPermissionsWithDelegate(
new MediaStreamDevicesController(web_contents, request, callback));
// Show a prompt if needed.
- if (controller->IsAskingForAudio() || controller->IsAskingForVideo()) {
+ bool is_asking_for_audio = controller->IsAskingForAudio();
+ bool is_asking_for_video = controller->IsAskingForVideo();
+ if (is_asking_for_audio || is_asking_for_video) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
delegate->ShowPrompt(
request.user_gesture, web_contents,
base::MakeUnique<Request>(
- profile, controller->IsAskingForAudio(),
- controller->IsAskingForVideo(), request.security_origin,
+ profile, is_asking_for_audio, is_asking_for_video,
+ request.security_origin,
base::Bind(&MediaStreamDevicesController::PromptAnswered,
base::Passed(&controller))));
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698