Bug 1701794 - Use nsOSHelperAppServiceChild with Windows r=nika,haik

Currently, the Windows implemenation of nsOSHelperAppService uses COM to figure out MIME types and extension
associations. That is incompatible with Win32k lockdown.

Luckily, Haik already made a class that handles these calls in content process and either marks them as
unimplemented or-else forwards them to the main process. This seems to work fine on Windows, so it looks like all
that needs to be done is adding XP_WIN to a couple of #ifdefs and we're good to go!

Differential Revision: https://phabricator.services.mozilla.com/D118391
This commit is contained in:
Chris Martin 2021-07-12 19:41:22 +00:00
parent 3a387e8175
commit 44cf790576
2 changed files with 3 additions and 3 deletions

View File

@ -321,7 +321,7 @@ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocol(
*aHandlerExists = false;
return IPC_OK();
}
#if defined(XP_MACOSX)
#if defined(XP_MACOSX) || defined(XP_WIN)
// Check the datastore and fallback to an OS check.
// ExternalProcotolHandlerExists() does the fallback.
nsresult rv;

View File

@ -638,7 +638,7 @@ static StaticRefPtr<nsExternalHelperAppService> sExtHelperAppSvcSingleton;
already_AddRefed<nsExternalHelperAppService>
nsExternalHelperAppService::GetSingleton() {
if (!sExtHelperAppSvcSingleton) {
#ifdef XP_MACOSX
#if defined(XP_MACOSX) || defined(XP_WIN)
if (XRE_IsParentProcess()) {
sExtHelperAppSvcSingleton = new nsOSHelperAppService();
} else {
@ -646,7 +646,7 @@ nsExternalHelperAppService::GetSingleton() {
}
#else
sExtHelperAppSvcSingleton = new nsOSHelperAppService();
#endif /* XP_MACOSX */
#endif // defined(XP_MACOSX) || defined(XP_WIN)
ClearOnShutdown(&sExtHelperAppSvcSingleton);
}