mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
Bug 1605086 - Make RemoteWorkerManager::LaunchNewContentProcess use non-blocking process creation;r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D57786 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e830f0abe2
commit
1966141a9f
@ -355,13 +355,21 @@ void RemoteWorkerManager::LaunchNewContentProcess(
|
||||
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
|
||||
__func__, [isServiceWorker = IsServiceWorker(aData),
|
||||
principalInfo = aData.principalInfo()] {
|
||||
RefPtr<ContentParent> contentParent =
|
||||
ContentParent::GetNewOrUsedBrowserProcess(
|
||||
nullptr, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE));
|
||||
|
||||
if (isServiceWorker) {
|
||||
TransmitPermissionsForPrincipalInfo(contentParent, principalInfo);
|
||||
}
|
||||
ContentParent::GetNewOrUsedBrowserProcessAsync(
|
||||
/* aFrameElement = */ nullptr,
|
||||
/* aRemoteType = */ NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE))
|
||||
->Then(GetCurrentThreadSerialEventTarget(), __func__,
|
||||
[isServiceWorker, &principalInfo](
|
||||
const ContentParent::LaunchPromise::ResolveOrRejectValue&
|
||||
aResult) {
|
||||
if (!isServiceWorker) {
|
||||
return;
|
||||
}
|
||||
RefPtr<ContentParent> contentParent =
|
||||
aResult.IsResolve() ? aResult.ResolveValue() : nullptr;
|
||||
TransmitPermissionsForPrincipalInfo(contentParent,
|
||||
principalInfo);
|
||||
});
|
||||
});
|
||||
|
||||
nsCOMPtr<nsIEventTarget> target =
|
||||
|
Loading…
Reference in New Issue
Block a user