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

Unified Diff: services/video_capture/video_capture_device_factory_impl.cc

Issue 2244773002: Video Capture Mojo (1.4c): Handle Subsequent Access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FillServicePart2
Patch Set: rockot's comments Created 4 years, 3 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: services/video_capture/video_capture_device_factory_impl.cc
diff --git a/services/video_capture/video_capture_device_factory_impl.cc b/services/video_capture/video_capture_device_factory_impl.cc
index ea3309fa18192d4b926dd079b4a152151b5d19de..4ac8e436df4fad154517630579441ee041f94387 100644
--- a/services/video_capture/video_capture_device_factory_impl.cc
+++ b/services/video_capture/video_capture_device_factory_impl.cc
@@ -46,10 +46,18 @@ bool VideoCaptureDeviceFactoryImpl::DeviceEntry::is_bound() const {
void VideoCaptureDeviceFactoryImpl::DeviceEntry::Bind(
mojom::VideoCaptureDeviceProxyRequest request) {
binding_->Bind(std::move(request));
+ binding_->set_connection_error_handler(base::Bind(
+ &VideoCaptureDeviceFactoryImpl::DeviceEntry::OnConnectionErrorOrClose,
+ base::Unretained(this)));
}
void VideoCaptureDeviceFactoryImpl::DeviceEntry::Unbind() {
binding_->Unbind();
+ device_proxy_->Stop();
+}
+
+void VideoCaptureDeviceFactoryImpl::DeviceEntry::OnConnectionErrorOrClose() {
+ Unbind();
}
VideoCaptureDeviceFactoryImpl::VideoCaptureDeviceFactoryImpl() = default;
« no previous file with comments | « services/video_capture/video_capture_device_factory_impl.h ('k') | services/video_capture/video_capture_device_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698