Chromium Code Reviews| Index: content/browser/browser_main_loop.cc |
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
| index d6d917b4c3f3ac7a90f23333b621bec4cf94a67f..73ca6aacc73ec07ee473f87e39ddde88b516408c 100644 |
| --- a/content/browser/browser_main_loop.cc |
| +++ b/content/browser/browser_main_loop.cc |
| @@ -94,6 +94,7 @@ |
| #include "device/gamepad/gamepad_service.h" |
| #include "media/base/media.h" |
| #include "media/base/user_input_monitor.h" |
| +#include "media/base/video_facing.h" |
| #include "media/midi/midi_service.h" |
| #include "mojo/edk/embedder/embedder.h" |
| #include "mojo/edk/embedder/scoped_ipc_support.h" |
| @@ -162,6 +163,7 @@ |
| #if defined(OS_CHROMEOS) |
| #include "base/memory/memory_pressure_monitor_chromeos.h" |
| +#include "chromeos/audio/cras_audio_handler.h" |
| #include "chromeos/chromeos_switches.h" |
| #endif |
| @@ -1157,6 +1159,22 @@ int BrowserMainLoop::PreMainMessageLoopRun() { |
| "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); |
| parts_->PreMainMessageLoopRun(); |
| + |
| +#if defined(OS_CHROMEOS) |
| + if (chromeos::CrasAudioHandler::IsInitialized()) { |
| + if (media_stream_manager_.get() != NULL) { |
| + media_stream_manager_->SetVideoCaptureObserver( |
| + std::unique_ptr<media::VideoCaptureObserver>( |
| + new media::VideoCaptureObserverAdapter( |
|
chfremer
2017/01/30 19:49:28
We should use base::MakeUnique<> here.
shenghao
2017/02/08 02:07:10
Done.
|
| + static_cast<chromeos::VideoCaptureObserver*>( |
|
chfremer
2017/01/30 19:49:28
I don't think the compiler needs this cast, and I
shenghao
2017/02/08 02:07:10
Done.
|
| + chromeos::CrasAudioHandler::Get())))); |
| + } else { |
| + DLOG(ERROR) << "media_stream_manager_ is null."; |
| + } |
| + } else { |
| + DLOG(ERROR) << "CrasAudioHandler is not initialized."; |
| + } |
| +#endif |
| } |
| // If the UI thread blocks, the whole UI is unresponsive. |
| @@ -1206,6 +1224,8 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { |
| if (parts_) { |
| TRACE_EVENT0("shutdown", |
| "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); |
| + media_stream_manager_->SetVideoCaptureObserver( |
| + std::unique_ptr<media::VideoCaptureObserver>()); |
|
chfremer
2017/01/30 19:49:28
media_stream_manager_->SetVideoCaptureObserver(nul
shenghao
2017/02/08 02:07:10
Done.
|
| parts_->PostMainMessageLoopRun(); |
| } |