Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index faed5fc5c27350c10c45ba7767c8ff593cf45967..6acb38ba7551aaa7d7e69d036c9a3d4bab74bbf8 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -224,12 +224,21 @@ media::AudioManager* BrowserMainLoop::GetAudioManager() { |
media_stream::MediaStreamManager* BrowserMainLoop::GetMediaStreamManager() { |
return g_current_browser_main_loop->media_stream_manager_.get(); |
} |
+ |
+// static |
+void BrowserMainLoop::UseFakeMediaStreamDevice() { |
+ // Configure the manager once it gets created. |
+ BrowserMainLoop::use_fake_media_stream_device_ = true; |
jam
2012/09/04 15:18:14
nit: BrowserMainLoop:: is unnecessary
phoglund_chromium
2012/09/05 11:43:54
Done.
|
+} |
+ |
+bool BrowserMainLoop::use_fake_media_stream_device_ = false; |
+ |
// BrowserMainLoop construction / destruction ============================= |
BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
: parameters_(parameters), |
parsed_command_line_(parameters.command_line), |
- result_code_(content::RESULT_CODE_NORMAL_EXIT) { |
+ result_code_(content::RESULT_CODE_NORMAL_EXIT){ |
DCHECK(!g_current_browser_main_loop); |
g_current_browser_main_loop = this; |
} |
@@ -468,6 +477,9 @@ void BrowserMainLoop::CreateThreads() { |
void BrowserMainLoop::RunMainMessageLoopParts() { |
TRACE_EVENT_BEGIN_ETW("BrowserMain:MESSAGE_LOOP", 0, ""); |
+ if (use_fake_media_stream_device_) |
jam
2012/09/04 15:18:14
actually, it seems that this static better belongs
phoglund_chromium
2012/09/05 11:43:54
Good point, I'll move it.
|
+ media_stream_manager_->UseFakeDevice(); |
+ |
bool ran_main_loop = false; |
if (parts_.get()) |
ran_main_loop = parts_->MainMessageLoopRun(&result_code_); |