Skip to content

Commit

Permalink
fix: make getUserMedia APIs work again on C72+ (backport: 5-0-x) (#16768
Browse files Browse the repository at this point in the history
)

* fix: resolve macos check for video and audio capture devices

* fix: resolve a minor compilation error
  • Loading branch information
trop[bot] authored and codebytere committed Feb 6, 2019
1 parent 379a7b7 commit 96e0dfc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions atom/browser/atom_browser_client.cc
Expand Up @@ -82,6 +82,8 @@
#include "net/ssl/client_cert_store_win.h"
#elif defined(OS_MACOSX)
#include "net/ssl/client_cert_store_mac.h"
#include "services/audio/public/mojom/constants.mojom.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#elif defined(USE_OPENSSL)
#include "net/ssl/client_cert_store.h"
#endif
Expand Down Expand Up @@ -512,6 +514,16 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
}
}

void AtomBrowserClient::AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity,
base::CommandLine* command_line) {
#if defined(OS_MACOSX)
if (identity.name() == video_capture::mojom::kServiceName ||
identity.name() == audio::mojom::kServiceName)
command_line->AppendSwitch(::switches::kMessageLoopTypeUi);
#endif
}

void AtomBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost* host) {
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
host->GetPpapiHost()->AddHostFactoryFilter(
Expand Down
3 changes: 3 additions & 0 deletions atom/browser/atom_browser_client.h
Expand Up @@ -85,6 +85,9 @@ class AtomBrowserClient : public content::ContentBrowserClient,
content::SiteInstance* pending_site_instance) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
void AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity,
base::CommandLine* command_line) override;
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
std::string GetGeolocationApiKey() override;
content::QuotaPermissionContext* CreateQuotaPermissionContext() override;
Expand Down

0 comments on commit 96e0dfc

Please sign in to comment.