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

Side by Side Diff: content/browser/renderer_host/media/service_launched_video_capture_device.cc

Issue 2902203002: [Mojo Video Capture] Hook up connection lost events (Closed)
Patch Set: Fix duplicate member introduced during merging Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "content/browser/renderer_host/media/service_launched_video_capture_dev ice.h" 5 #include "content/browser/renderer_host/media/service_launched_video_capture_dev ice.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 ServiceLaunchedVideoCaptureDevice::ServiceLaunchedVideoCaptureDevice( 9 ServiceLaunchedVideoCaptureDevice::ServiceLaunchedVideoCaptureDevice(
10 video_capture::mojom::DevicePtr device) 10 video_capture::mojom::DevicePtr device,
11 : device_(std::move(device)) { 11 base::OnceClosure connection_lost_cb)
12 : device_(std::move(device)),
13 connection_lost_cb_(std::move(connection_lost_cb)) {
12 // Unretained |this| is safe, because |this| owns |device_|. 14 // Unretained |this| is safe, because |this| owns |device_|.
13 device_.set_connection_error_handler( 15 device_.set_connection_error_handler(
14 base::Bind(&ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice, 16 base::Bind(&ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice,
15 base::Unretained(this))); 17 base::Unretained(this)));
16 } 18 }
17 19
18 ServiceLaunchedVideoCaptureDevice::~ServiceLaunchedVideoCaptureDevice() { 20 ServiceLaunchedVideoCaptureDevice::~ServiceLaunchedVideoCaptureDevice() {
19 DCHECK(sequence_checker_.CalledOnValidSequence()); 21 DCHECK(sequence_checker_.CalledOnValidSequence());
20 } 22 }
21 23
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 66
65 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport( 67 void ServiceLaunchedVideoCaptureDevice::OnUtilizationReport(
66 int frame_feedback_id, 68 int frame_feedback_id,
67 double utilization) { 69 double utilization) {
68 DCHECK(sequence_checker_.CalledOnValidSequence()); 70 DCHECK(sequence_checker_.CalledOnValidSequence());
69 device_->OnReceiverReportingUtilization(frame_feedback_id, utilization); 71 device_->OnReceiverReportingUtilization(frame_feedback_id, utilization);
70 } 72 }
71 73
72 void ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice() { 74 void ServiceLaunchedVideoCaptureDevice::OnLostConnectionToDevice() {
73 DCHECK(sequence_checker_.CalledOnValidSequence()); 75 DCHECK(sequence_checker_.CalledOnValidSequence());
74 NOTIMPLEMENTED(); 76 base::ResetAndReturn(&connection_lost_cb_).Run();
75 } 77 }
76 78
77 } // namespace content 79 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698