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

Unified Diff: media/video/capture/fake_video_capture_device.h

Issue 88283002: Reland review 34393006: Refactor MediaStreamManager to not output real device id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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
« no previous file with comments | « media/audio/mock_audio_manager.cc ('k') | media/video/capture/fake_video_capture_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..de1fe3224458c0c50f782a148a760d866da80ee4 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,11 @@ 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.
+ // TODO(perkj): Make tests independent of global state. crbug/323913
+ static base::subtle::Atomic32 number_of_devices_;
DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice);
};
« no previous file with comments | « media/audio/mock_audio_manager.cc ('k') | media/video/capture/fake_video_capture_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698