| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_SERVICE_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_SERVICE_H_ |
| 6 #define SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_SERVICE_H_ | 6 #define SERVICES_VIDEO_CAPTURE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/binding_set.h" | 10 #include "mojo/public/cpp/bindings/binding_set.h" |
| 11 #include "services/shell/public/cpp/service.h" | 11 #include "services/shell/public/cpp/service.h" |
| 12 #include "services/video_capture/public/interfaces/service_configurator.mojom.h" |
| 12 #include "services/video_capture/public/interfaces/video_capture_device_factory.
mojom.h" | 13 #include "services/video_capture/public/interfaces/video_capture_device_factory.
mojom.h" |
| 13 #include "services/video_capture/video_capture_device_factory_impl.h" | |
| 14 | 14 |
| 15 namespace video_capture { | 15 namespace video_capture { |
| 16 | 16 |
| 17 class VideoCaptureDeviceFactoryImpl; |
| 18 class ServiceConfiguratorImpl; |
| 19 |
| 17 // Exposes a single internal instance of VideoCaptureDeviceFactoryImpl | 20 // Exposes a single internal instance of VideoCaptureDeviceFactoryImpl |
| 18 // through a Mojo Shell Service. | 21 // through a Mojo Shell Service. Additionally exposes an instance of |
| 22 // ServiceConfiguratorImpl that can be used to configure the |
| 23 // VideoCaptureDeviceFactoryImpl instance. |
| 19 class VideoCaptureService | 24 class VideoCaptureService |
| 20 : public shell::Service, | 25 : public shell::Service, |
| 26 public shell::InterfaceFactory<mojom::ServiceConfigurator>, |
| 21 public shell::InterfaceFactory<mojom::VideoCaptureDeviceFactory> { | 27 public shell::InterfaceFactory<mojom::VideoCaptureDeviceFactory> { |
| 22 public: | 28 public: |
| 23 VideoCaptureService(); | 29 VideoCaptureService(); |
| 24 ~VideoCaptureService() override; | 30 ~VideoCaptureService() override; |
| 25 | 31 |
| 26 // shell::Service: | 32 // shell::Service: |
| 27 bool OnConnect(const shell::Identity& remote_identity, | 33 bool OnConnect(const shell::Identity& remote_identity, |
| 28 shell::InterfaceRegistry* registry) override; | 34 shell::InterfaceRegistry* registry) override; |
| 29 | 35 |
| 36 // shell::InterfaceFactory<mojom::ServiceConfigurator>: |
| 37 void Create(const shell::Identity& remote_identity, |
| 38 mojom::ServiceConfiguratorRequest request) override; |
| 39 |
| 30 // shell::InterfaceFactory<mojom::VideoCaptureDeviceFactory>: | 40 // shell::InterfaceFactory<mojom::VideoCaptureDeviceFactory>: |
| 31 void Create(const shell::Identity& remote_identity, | 41 void Create(const shell::Identity& remote_identity, |
| 32 mojom::VideoCaptureDeviceFactoryRequest request) override; | 42 mojom::VideoCaptureDeviceFactoryRequest request) override; |
| 33 | 43 |
| 34 private: | 44 private: |
| 35 mojo::BindingSet<mojom::VideoCaptureDeviceFactory> bindings_; | 45 mojo::BindingSet<mojom::ServiceConfigurator> configurator_bindings_; |
| 36 VideoCaptureDeviceFactoryImpl device_factory_; | 46 mojo::BindingSet<mojom::VideoCaptureDeviceFactory> factory_bindings_; |
| 47 std::unique_ptr<VideoCaptureDeviceFactoryImpl> device_factory_; |
| 48 std::unique_ptr<ServiceConfiguratorImpl> configurator_; |
| 37 }; | 49 }; |
| 38 | 50 |
| 39 } // namespace video_capture | 51 } // namespace video_capture |
| 40 | 52 |
| 41 #endif // SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_SERVICE_H_ | 53 #endif // SERVICES_VIDEO_CAPTURE_SERVICE_H_ |
| OLD | NEW |