Chromium Code Reviews| Index: media/video/capture/fake_video_capture_device.h |
| diff --git a/media/video/capture/fake_video_capture_device.h b/media/video/capture/fake_video_capture_device.h |
| index 7d5de57d2ce0df9b75fc7bd1113eaf838346794c..0531d8cf0bbb1e1c97a0cd83df01f917071ea319 100644 |
| --- a/media/video/capture/fake_video_capture_device.h |
| +++ b/media/video/capture/fake_video_capture_device.h |
| @@ -10,6 +10,7 @@ |
| #include <string> |
| +#include "base/atomicops.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/threading/thread.h" |
| #include "media/video/capture/video_capture_device.h" |
| @@ -23,6 +24,7 @@ class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice { |
| // Used for testing. This will make sure the next call to Create will |
| // return NULL; |
| static void SetFailNextCreate(); |
| + static void SetNumberOfFakeDevices(size_t number_of_devices); |
| static void GetDeviceNames(Names* device_names); |
| static void GetDeviceSupportedFormats(const Name& device, |
| @@ -64,6 +66,10 @@ class MEDIA_EXPORT FakeVideoCaptureDevice : public VideoCaptureDevice { |
| int format_roster_index_; |
| static bool fail_next_create_; |
| + // |number_of_devices_| is atomic since tests can call SetNumberOfFakeDevices |
| + // on the IO thread to set |number_of_devices_|. The variable can be |
| + // read from a separate thread. |
| + static base::subtle::Atomic32 number_of_devices_; |
|
tommi (sloooow) - chröme
2013/11/28 12:24:45
can you add a todo here that explains that use of
perkj_chrome
2013/11/28 13:40:50
Done.
|
| DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); |
| }; |