void ElectronBrowserClient::RenderProcessWillLaunch(
    content::RenderProcessHost* host) {
  // When a render process is crashed, it might be reused.
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
  int process_id = host->GetID();

  auto* browser_context = host->GetBrowserContext();

  host->AddFilter(
      new extensions::ExtensionMessageFilter(process_id, browser_context));
  host->AddFilter(
      new ElectronExtensionMessageFilter(process_id, browser_context));
  host->AddFilter(
      new extensions::MessagingAPIMessageFilter(process_id, browser_context));
#endif

  // ensure the ProcessPreferences is removed later
  host->AddObserver(this);
}
void ElectronBrowserClient::RenderProcessWillLaunch(
    content::RenderProcessHost* host) {
   
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
  int process_id = host->GetID();

  auto* browser_context = host->GetBrowserContext();

  host->AddFilter(
      new extensions::ExtensionMessageFilter(process_id, browser_context));
  host->AddFilter(
      new ElectronExtensionMessageFilter(process_id, browser_context));
  host->AddFilter(
      new extensions::MessagingAPIMessageFilter(process_id, browser_context));
#endif

   
  host->AddObserver(this);
}