Chromium Code Reviews| Index: services/video_capture/video_capture_service.cc |
| diff --git a/services/video_capture/video_capture_service.cc b/services/video_capture/video_capture_service.cc |
| index e025b6b4903cf177e072c8f99e100bba4d06b9ac..95c5f47a3ce6e5c4f99c1ba0228c1b5f9be47d04 100644 |
| --- a/services/video_capture/video_capture_service.cc |
| +++ b/services/video_capture/video_capture_service.cc |
| @@ -4,22 +4,46 @@ |
| #include "services/video_capture/video_capture_service.h" |
| +#include "services/video_capture/fake_video_capture_device_factory_configurator_impl.h" |
| +#include "services/video_capture/video_capture_device_factory_impl.h" |
| + |
| namespace video_capture { |
| -VideoCaptureService::VideoCaptureService() = default; |
| +VideoCaptureService::VideoCaptureService() { |
| + device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(); |
|
yzshen1
2016/08/16 17:55:08
Please do these in the initailizer list.
chfremer
2016/08/16 18:34:40
In this case, I intentionally chose to do the init
|
| + fake_device_factory_ = base::MakeUnique<VideoCaptureDeviceFactoryImpl>(); |
| + configurator_ = |
| + base::MakeUnique<FakeVideoCaptureDeviceFactoryConfiguratorImpl>( |
| + fake_device_factory_.get()); |
| +} |
| VideoCaptureService::~VideoCaptureService() = default; |
| bool VideoCaptureService::OnConnect(const shell::Identity& remote_identity, |
| shell::InterfaceRegistry* registry) { |
| - registry->AddInterface<mojom::VideoCaptureDeviceFactory>(this); |
| + registry->AddInterface<mojom::VideoCaptureService>(this); |
| return true; |
| } |
| -void VideoCaptureService::Create( |
| - const shell::Identity& remote_identity, |
| +void VideoCaptureService::Create(const shell::Identity& remote_identity, |
| + mojom::VideoCaptureServiceRequest request) { |
| + bindings_.AddBinding(this, std::move(request)); |
| +} |
| + |
| +void VideoCaptureService::ConnectToDeviceFactory( |
| mojom::VideoCaptureDeviceFactoryRequest request) { |
| - bindings_.AddBinding(&device_factory_, std::move(request)); |
| + factory_bindings_.AddBinding(device_factory_.get(), std::move(request)); |
| +} |
| + |
| +void VideoCaptureService::ConnectToFakeDeviceFactory( |
| + mojom::VideoCaptureDeviceFactoryRequest request) { |
| + fake_factory_bindings_.AddBinding(fake_device_factory_.get(), |
| + std::move(request)); |
| +} |
| + |
| +void VideoCaptureService::ConnectToFakeDeviceFactoryConfigurator( |
| + mojom::FakeVideoCaptureDeviceFactoryConfiguratorRequest request) { |
| + configurator_bindings_.AddBinding(configurator_.get(), std::move(request)); |
| } |
| } // namespace video_capture |