```
[4785:0123/172535.504545:FATAL:video_capture_device_factory_mac.mm(29)] Check failed: mode != NULL. The MacOS video capture code must be run on a CFRunLoop-enabled thread
0   Electron Framework                  0x000000011a8f6b9f base::debug::StackTrace::StackTrace(unsigned long) + 31
1   Electron Framework                  0x000000011a7e1664 logging::LogMessage::~LogMessage() + 228
2   Electron Framework                  0x000000011c87be82 (anonymous namespace)::EnsureRunsOnCFRunLoopEnabledThread() + 130
3   Electron Framework                  0x000000011c87c0f8 media::VideoCaptureDeviceFactoryMac::GetDeviceDescriptors(std::__1::vector<media::VideoCaptureDeviceDescriptor, std::__1::allocator<media::VideoCaptureDeviceDescriptor> >*) + 120
4   Electron Framework                  0x000000011c8713cc media::VideoCaptureSystemImpl::ProcessDeviceInfoRequest() + 76
5   Electron Framework                  0x000000011c87136b media::VideoCaptureSystemImpl::GetDeviceInfosAsync(base::OnceCallback<void (std::__1::vector<media::VideoCaptureDeviceInfo, std::__1::allocator<media::VideoCaptureDeviceInfo> > const&)>) + 171
6   Electron Framework                  0x00000001187b5fb2 video_capture::DeviceFactoryMediaToMojoAdapter::GetDeviceInfos(base::OnceCallback<void (std::__1::vector<media::VideoCaptureDeviceInfo, std::__1::allocator<media::VideoCaptureDeviceInfo> > const&)>) + 146
7   Electron Framework                  0x00000001187c36cd video_capture::VirtualDeviceEnabledDeviceFactory::GetDeviceInfos(base::OnceCallback<void (std::__1::vector<media::VideoCaptureDeviceInfo, std::__1::allocator<media::VideoCaptureDeviceInfo> > const&)>) + 285
8   Electron Framework                  0x0000000117b2afc7 video_capture::mojom::DeviceFactoryStubDispatch::AcceptWithResponder(video_capture::mojom::DeviceFactory*, mojo::Message*, std::__1::unique_ptr<mojo::MessageReceiverWithStatus, std::__1::default_delete<mojo::MessageReceiverWithStatus> >) + 439
9   Electron Framework                  0x00000001187b9536 video_capture::mojom::DeviceFactoryStub<mojo::RawPtrImplRefTraits<video_capture::mojom::DeviceFactory> >::AcceptWithResponder(mojo::Message*, std::__1::unique_ptr<mojo::MessageReceiverWithStatus, std::__1::default_delete<mojo::MessageReceiverWithStatus> >) + 38
10  Electron Framework                  0x000000011a795b77 mojo::InterfaceEndpointClient::HandleValidatedMessage(mojo::Message*) + 935
11  Electron Framework                  0x000000011a795456 mojo::FilterChain::Accept(mojo::Message*) + 150
12  Electron Framework                  0x000000011a796f85 mojo::InterfaceEndpointClient::HandleIncomingMessage(mojo::Message*) + 117
13  Electron Framework                  0x000000011a79d61b mojo::internal::MultiplexRouter::ProcessIncomingMessage(mojo::internal::MultiplexRouter::MessageWrapper*, mojo::internal::MultiplexRouter::ClientCallBehavior, base::SequencedTaskRunner*) + 1451
14  Electron Framework                  0x000000011a79ca89 mojo::internal::MultiplexRouter::Accept(mojo::Message*) + 377
15  Electron Framework                  0x000000011a795456 mojo::FilterChain::Accept(mojo::Message*) + 150
16  Electron Framework                  0x000000011a7903a0 mojo::Connector::ReadSingleMessage(unsigned int*) + 576
17  Electron Framework                  0x000000011a790f31 mojo::Connector::ReadAllAvailableMessages() + 97
18  Electron Framework                  0x000000011a790de9 mojo::Connector::OnHandleReadyInternal(unsigned int) + 137
19  Electron Framework                  0x0000000116ec0d47 mojo::SimpleWatcher::DiscardReadyState(base::RepeatingCallback<void (unsigned int)> const&, unsigned int, mojo::HandleSignalsState const&) + 103
20  Electron Framework                  0x000000011a93565d mojo::SimpleWatcher::OnHandleReady(int, unsigned int, mojo::HandleSignalsState const&) + 365
21  Electron Framework                  0x000000011a935b81 void base::internal::Invoker<base::internal::BindState<void (mojo::SimpleWatcher::*)(int, unsigned int, mojo::HandleSignalsState const&), base::WeakPtr<mojo::SimpleWatcher>, int, unsigned int, mojo::HandleSignalsState>, void ()>::RunImpl<void (mojo::SimpleWatcher::* const&)(int, unsigned int, mojo::HandleSignalsState const&), std::__1::tuple<base::WeakPtr<mojo::SimpleWatcher>, int, unsigned int, mojo::HandleSignalsState> const&, 0ul, 1ul, 2ul, 3ul>(void (mojo::SimpleWatcher::* const&&&)(int, unsigned int, mojo::HandleSignalsState const&), std::__1::tuple<base::WeakPtr<mojo::SimpleWatcher>, int, unsigned int, mojo::HandleSignalsState> const&&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul>) + 193
22  Electron Framework                  0x000000011a7c5fe8 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) + 344
23  Electron Framework                  0x000000011a8035a0 base::MessageLoopImpl::RunTask(base::PendingTask*) + 272
24  Electron Framework                  0x000000011a803c13 base::MessageLoopImpl::DoWork() + 387
25  Electron Framework                  0x000000011a804af9 base::MessagePumpDefault::Run(base::MessagePump::Delegate*) + 201
26  Electron Framework                  0x000000011a803148 base::MessageLoopImpl::Run(bool) + 136
27  Electron Framework                  0x000000011a83d319 base::RunLoop::Run() + 249
28  Electron Framework                  0x000000011a2e3262 content::UtilityMain(content::MainFunctionParams const&) + 578
29  Electron Framework                  0x000000011a32efc3 content::ContentMainRunnerImpl::Run(bool) + 435
30  Electron Framework                  0x000000011cbfde2e service_manager::Main(service_manager::MainParams const&) + 3166
31  Electron Framework                  0x000000011a32e0c4 content::ContentMain(content::ContentMainParams const&) + 68
32  Electron Framework                  0x0000000116ae7f54 AtomMain + 84
33  Electron Helper                     0x0000000108aef765 main + 357
34  libdyld.dylib                       0x00007fff7d508ed9 start + 1
```
atom/browser/atom_browser_client.cc
return g_browser_client;
}
void AtomBrowserClient::SetApplicationLocale(const std::string& locale) {
  if (!BrowserThread::IsThreadInitialized(BrowserThread::IO) ||
      !base::PostTaskWithTraits(
          FROM_HERE, {BrowserThread::IO},
          base::BindOnce(&SetApplicationLocaleOnIOThread, locale))) {
    g_io_thread_application_locale.Get() = locale;
  }
  *g_application_locale = locale;
}
AtomBrowserClient::AtomBrowserClient() {
  DCHECK(!g_browser_client);
  g_browser_client = this;
}
AtomBrowserClient::~AtomBrowserClient() {
  DCHECK(g_browser_client);
  g_browser_client = nullptr;
}
content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID(
    int process_id) {
  
  
  if (base::ContainsKey(pending_processes_, process_id))
    return pending_processes_[process_id];
  
  
  return WebContentsPreferences::GetWebContentsFromProcessID(process_id);
}
bool AtomBrowserClient::ShouldForceNewSiteInstance(