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

Unified Diff: content/browser/renderer_host/media/service_video_capture_device_launcher.cc

Issue 2902203002: [Mojo Video Capture] Hook up connection lost events (Closed)
Patch Set: Fix duplicate member introduced during merging Created 3 years, 7 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: content/browser/renderer_host/media/service_video_capture_device_launcher.cc
diff --git a/content/browser/renderer_host/media/service_video_capture_device_launcher.cc b/content/browser/renderer_host/media/service_video_capture_device_launcher.cc
index 522570ae017b9cb83091ee4e9f63c4ee556b43f1..cbd9f49c63d56553fa4c07106955bc2250c6c78e 100644
--- a/content/browser/renderer_host/media/service_video_capture_device_launcher.cc
+++ b/content/browser/renderer_host/media/service_video_capture_device_launcher.cc
@@ -19,6 +19,7 @@ void ConcludeLaunchDeviceWithSuccess(
const media::VideoCaptureParams& params,
video_capture::mojom::DevicePtr device,
base::WeakPtr<media::VideoFrameReceiver> receiver,
+ base::OnceClosure connection_lost_cb,
VideoCaptureDeviceLauncher::Callbacks* callbacks,
base::OnceClosure done_cb) {
if (abort_requested) {
@@ -38,7 +39,8 @@ void ConcludeLaunchDeviceWithSuccess(
std::move(receiver_adapter), mojo::MakeRequest(&receiver_proxy));
device->Start(params, std::move(receiver_proxy));
callbacks->OnDeviceLaunched(
- base::MakeUnique<ServiceLaunchedVideoCaptureDevice>(std::move(device)));
+ base::MakeUnique<ServiceLaunchedVideoCaptureDevice>(
+ std::move(device), std::move(connection_lost_cb)));
base::ResetAndReturn(&done_cb).Run();
}
@@ -71,6 +73,7 @@ void ServiceVideoCaptureDeviceLauncher::LaunchDeviceAsync(
MediaStreamType stream_type,
const media::VideoCaptureParams& params,
base::WeakPtr<media::VideoFrameReceiver> receiver,
+ base::OnceClosure connection_lost_cb,
Callbacks* callbacks,
base::OnceClosure done_cb) {
DCHECK(sequence_checker_.CalledOnValidSequence());
@@ -110,7 +113,7 @@ void ServiceVideoCaptureDeviceLauncher::LaunchDeviceAsync(
// that |this| stays alive.
&ServiceVideoCaptureDeviceLauncher::OnCreateDeviceCallback,
base::Unretained(this), params, base::Passed(&device),
- std::move(receiver)));
+ std::move(receiver), base::Passed(&connection_lost_cb)));
state_ = State::DEVICE_START_IN_PROGRESS;
}
@@ -124,6 +127,7 @@ void ServiceVideoCaptureDeviceLauncher::OnCreateDeviceCallback(
const media::VideoCaptureParams& params,
video_capture::mojom::DevicePtr device,
base::WeakPtr<media::VideoFrameReceiver> receiver,
+ base::OnceClosure connection_lost_cb,
video_capture::mojom::DeviceAccessResultCode result_code) {
DCHECK(sequence_checker_.CalledOnValidSequence());
DCHECK(callbacks_);
@@ -135,9 +139,9 @@ void ServiceVideoCaptureDeviceLauncher::OnCreateDeviceCallback(
callbacks_ = nullptr;
switch (result_code) {
case video_capture::mojom::DeviceAccessResultCode::SUCCESS:
- ConcludeLaunchDeviceWithSuccess(abort_requested, params,
- std::move(device), std::move(receiver),
- callbacks, std::move(done_cb_));
+ ConcludeLaunchDeviceWithSuccess(
+ abort_requested, params, std::move(device), std::move(receiver),
+ std::move(connection_lost_cb), callbacks, std::move(done_cb_));
return;
case video_capture::mojom::DeviceAccessResultCode::ERROR_DEVICE_NOT_FOUND:
case video_capture::mojom::DeviceAccessResultCode::NOT_INITIALIZED:

Powered by Google App Engine
This is Rietveld 408576698