Bug 1609110 - Follow up fixes on async process creation. r=Yoric,asuth

Differential Revision: https://phabricator.services.mozilla.com/D59854

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Luca Greco 2020-01-17 21:00:44 +00:00
Родитель c28a24abaf
Коммит 1dd72eeb1a
2 изменённых файлов: 3 добавлений и 4 удалений

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

@ -976,17 +976,16 @@ ContentParent::GetNewOrUsedBrowserProcessAsync(Element* aFrameElement,
// cleanup manually in the `OnReject`.
PreallocatedProcessManager::AddBlocker(p);
nsAutoString remoteType(aRemoteType);
return launchPromise->Then(
GetCurrentThreadSerialEventTarget(), __func__,
// on resolve
[p, recordReplayState, remoteType,
[p, recordReplayState,
launchPromise](const RefPtr<ContentParent>& subProcess) {
if (recordReplayState == eNotRecordingOrReplaying) {
// We cannot reuse `contentParents` as it may have been
// overwritten or otherwise altered by another process launch.
nsTArray<ContentParent*>& contentParents =
GetOrCreatePool(remoteType);
GetOrCreatePool(p->GetRemoteType());
contentParents.AppendElement(p);
}

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

@ -363,7 +363,7 @@ void RemoteWorkerManager::LaunchNewContentProcess(
/* aFrameElement = */ nullptr,
/* aRemoteType = */ NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE))
->Then(GetCurrentThreadSerialEventTarget(), __func__,
[isServiceWorker, &principalInfo](
[isServiceWorker, principalInfo](
const ContentParent::LaunchPromise::ResolveOrRejectValue&
aResult) {
if (!isServiceWorker) {