Chromium Code Reviews| 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_DEVICE_FACTORY_IMPL_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_IMPL_H_ |
| 6 #define SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_IMPL_H_ | 6 #define SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/binding.h" | |
| 10 #include "services/video_capture/public/interfaces/video_capture_device_factory. mojom.h" | 11 #include "services/video_capture/public/interfaces/video_capture_device_factory. mojom.h" |
| 11 #include "services/video_capture/video_capture_device_proxy_impl.h" | 12 #include "services/video_capture/video_capture_device_proxy_impl.h" |
| 12 | 13 |
| 13 namespace video_capture { | 14 namespace video_capture { |
| 14 | 15 |
| 15 class VideoCaptureDeviceFactoryImpl : public mojom::VideoCaptureDeviceFactory { | 16 class VideoCaptureDeviceFactoryImpl : public mojom::VideoCaptureDeviceFactory { |
| 16 public: | 17 public: |
| 17 VideoCaptureDeviceFactoryImpl(); | 18 VideoCaptureDeviceFactoryImpl(); |
| 18 ~VideoCaptureDeviceFactoryImpl() override; | 19 ~VideoCaptureDeviceFactoryImpl() override; |
| 19 | 20 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 40 // the number of capture devices is typically small. | 41 // the number of capture devices is typically small. |
| 41 class DeviceEntry { | 42 class DeviceEntry { |
| 42 public: | 43 public: |
| 43 DeviceEntry(mojom::VideoCaptureDeviceDescriptorPtr descriptor, | 44 DeviceEntry(mojom::VideoCaptureDeviceDescriptorPtr descriptor, |
| 44 std::unique_ptr<VideoCaptureDeviceProxyImpl> bindable_target); | 45 std::unique_ptr<VideoCaptureDeviceProxyImpl> bindable_target); |
| 45 ~DeviceEntry(); | 46 ~DeviceEntry(); |
| 46 DeviceEntry(DeviceEntry&& other); | 47 DeviceEntry(DeviceEntry&& other); |
| 47 DeviceEntry& operator=(DeviceEntry&& other); | 48 DeviceEntry& operator=(DeviceEntry&& other); |
| 48 | 49 |
| 49 mojom::VideoCaptureDeviceDescriptorPtr MakeDescriptorCopy() const; | 50 mojom::VideoCaptureDeviceDescriptorPtr MakeDescriptorCopy() const; |
| 51 bool DescriptorEquals( | |
| 52 const mojom::VideoCaptureDeviceDescriptorPtr& other) const; | |
| 53 bool is_bound() const; | |
| 54 void Bind(mojom::VideoCaptureDeviceProxyRequest request); | |
| 55 void Unbind(); | |
| 50 | 56 |
| 51 private: | 57 private: |
| 52 mojom::VideoCaptureDeviceDescriptorPtr descriptor_; | 58 mojom::VideoCaptureDeviceDescriptorPtr descriptor_; |
| 53 std::unique_ptr<VideoCaptureDeviceProxyImpl> device_proxy_; | 59 std::unique_ptr<VideoCaptureDeviceProxyImpl> device_proxy_; |
| 60 std::unique_ptr<mojo::Binding<mojom::VideoCaptureDeviceProxy>> binding_; | |
|
Ken Rockot(use gerrit already)
2016/08/19 17:49:00
I don't see any reason to use a unique_ptr here. J
chfremer
2016/08/19 18:11:19
I tried that initially, but found that an inconven
| |
| 54 | 61 |
| 55 DISALLOW_COPY_AND_ASSIGN(DeviceEntry); | 62 DISALLOW_COPY_AND_ASSIGN(DeviceEntry); |
| 56 }; | 63 }; |
| 57 | 64 |
| 58 std::vector<DeviceEntry> devices_; | 65 std::vector<DeviceEntry> devices_; |
| 59 }; | 66 }; |
| 60 | 67 |
| 61 } // namespace video_capture | 68 } // namespace video_capture |
| 62 | 69 |
| 63 #endif // SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_IMPL_H_ | 70 #endif // SERVICES_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_FACTORY_IMPL_H_ |
| OLD | NEW |