Bug 1763848 - Use IPC remoting for MIME type information on all platforms. r=haik

The component that handles MIME type information will consult whatever
the OS uses as a registry of file types / applications; in the past
this caused problems for sandboxing on macOS and then Windows, so IPC was
used to remote those queries to the parent process.

We've also been having similar problems on Linux, and none of the
infrastructure here seems to be OS-specific; therefore I've removed the
`#ifdef` so that we always use IPC.

Differential Revision: https://phabricator.services.mozilla.com/D145823
This commit is contained in:
Jed Davis 2022-05-20 00:02:45 +00:00
Родитель edeb9a2237
Коммит a051b1b2bc
2 изменённых файлов: 2 добавлений и 11 удалений

Просмотреть файл

@ -321,7 +321,6 @@ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocol(
*aHandlerExists = false;
return IPC_OK();
}
#if defined(XP_MACOSX) || defined(XP_WIN)
// Check the datastore and fallback to an OS check.
// ExternalProcotolHandlerExists() does the fallback.
nsresult rv;
@ -337,10 +336,6 @@ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocol(
if (NS_WARN_IF(NS_FAILED(rv))) {
*aHandlerExists = false;
}
#else
MOZ_RELEASE_ASSERT(false, "No implementation on this platform.");
*aHandlerExists = false;
#endif
return IPC_OK();
}

Просмотреть файл

@ -604,23 +604,19 @@ static const char* descriptionOverwriteExtensions[] = {
static StaticRefPtr<nsExternalHelperAppService> sExtHelperAppSvcSingleton;
/**
* On Mac child processes, return an nsOSHelperAppServiceChild for remoting
* OS calls to the parent process. On all other platforms use
* In child processes, return an nsOSHelperAppServiceChild for remoting
* OS calls to the parent process. In the parent process itself, use
* nsOSHelperAppService.
*/
/* static */
already_AddRefed<nsExternalHelperAppService>
nsExternalHelperAppService::GetSingleton() {
if (!sExtHelperAppSvcSingleton) {
#if defined(XP_MACOSX) || defined(XP_WIN)
if (XRE_IsParentProcess()) {
sExtHelperAppSvcSingleton = new nsOSHelperAppService();
} else {
sExtHelperAppSvcSingleton = new nsOSHelperAppServiceChild();
}
#else
sExtHelperAppSvcSingleton = new nsOSHelperAppService();
#endif // defined(XP_MACOSX) || defined(XP_WIN)
ClearOnShutdown(&sExtHelperAppSvcSingleton);
}