diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 18a9df24b10b..f439e84d8362 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -18,6 +18,7 @@ #include "base/strings/utf_string_conversions.h" #include "brightray/browser/browser_context.h" #include "brightray/browser/devtools_manager_delegate.h" +#include "brightray/browser/media/media_capture_devices_dispatcher.h" #include "brightray/browser/web_ui_controller_factory.h" #include "brightray/common/application_info.h" #include "brightray/common/main_delegate.h" @@ -268,6 +269,9 @@ int BrowserMainParts::PreCreateThreads() { #endif #endif + // Force MediaCaptureDevicesDispatcher to be created on UI thread. + MediaCaptureDevicesDispatcher::GetInstance(); + if (!views::LayoutProvider::Get()) layout_provider_.reset(new views::LayoutProvider()); diff --git a/brightray/browser/media/media_capture_devices_dispatcher.cc b/brightray/browser/media/media_capture_devices_dispatcher.cc index aafb37594b6b..8d122890b773 100644 --- a/brightray/browser/media/media_capture_devices_dispatcher.cc +++ b/brightray/browser/media/media_capture_devices_dispatcher.cc @@ -44,8 +44,7 @@ MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() : is_device_enumeration_disabled_(false) { // MediaCaptureDevicesDispatcher is a singleton. It should be created on // UI thread. - // FIXME: Ensure the DCHECK doesn't fail and then re-enable - // DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); } MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {}