Hold onto UserMediaRequest strongly in UserMediaProcessor

... when dispatching callbacks that pass UserMediaRequest instances.

This CL switch from using WrapWeakPersistent to WrapPersistent in
UserMediaProcessor code, when dispatcking callback calls passing
UserMediaRequest as parameters.

This is a follow up of https://crrev.com/c/2064748.

BUG=1054999, 704136
R=guidou@chromium.org

Change-Id: I5696b1efdae769382d61d9dfb2652ccdcd3f3a55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2070228
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#744270}
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_processor.cc b/third_party/blink/renderer/modules/mediastream/user_media_processor.cc
index 625cc1a..1e68f50 100644
--- a/third_party/blink/renderer/modules/mediastream/user_media_processor.cc
+++ b/third_party/blink/renderer/modules/mediastream/user_media_processor.cc
@@ -617,7 +617,7 @@
     GetMediaDevicesDispatcher()->GetAudioInputCapabilities(
         WTF::Bind(&UserMediaProcessor::SelectAudioDeviceSettings,
                   WrapWeakPersistent(this),
-                  WrapWeakPersistent(current_request_info_->web_request())));
+                  WrapPersistent(current_request_info_->web_request())));
   } else {
     if (!blink::IsAudioInputMediaType(audio_controls.stream_type)) {
       String failed_constraint_name =
@@ -774,7 +774,7 @@
     GetMediaDevicesDispatcher()->GetVideoInputCapabilities(
         WTF::Bind(&UserMediaProcessor::SelectVideoDeviceSettings,
                   WrapWeakPersistent(this),
-                  WrapWeakPersistent(current_request_info_->web_request())));
+                  WrapPersistent(current_request_info_->web_request())));
   } else {
     if (!blink::IsVideoInputMediaType(video_controls.stream_type)) {
       String failed_constraint_name =
@@ -986,8 +986,8 @@
         video_device_id,
         WTF::Bind(&UserMediaProcessor::GotAllVideoInputFormatsForDevice,
                   WrapWeakPersistent(this),
-                  WrapWeakPersistent(current_request_info_->web_request()),
-                  label, video_device_id));
+                  WrapPersistent(current_request_info_->web_request()), label,
+                  video_device_id));
   }
 }
 
@@ -1481,7 +1481,7 @@
       FROM_HERE,
       WTF::Bind(&UserMediaProcessor::DelayedGetUserMediaRequestSucceeded,
                 WrapWeakPersistent(this), current_request_info_->request_id(),
-                stream, WrapWeakPersistent(web_request)));
+                stream, WrapPersistent(web_request)));
 }
 
 void UserMediaProcessor::DelayedGetUserMediaRequestSucceeded(
@@ -1515,8 +1515,8 @@
       FROM_HERE,
       WTF::Bind(&UserMediaProcessor::DelayedGetUserMediaRequestFailed,
                 WrapWeakPersistent(this), current_request_info_->request_id(),
-                WrapWeakPersistent(current_request_info_->web_request()),
-                result, constraint_name));
+                WrapPersistent(current_request_info_->web_request()), result,
+                constraint_name));
 }
 
 void UserMediaProcessor::DelayedGetUserMediaRequestFailed(