diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 35819c2e8238..be67e2bd4555 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -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& subProcess) { if (recordReplayState == eNotRecordingOrReplaying) { // We cannot reuse `contentParents` as it may have been // overwritten or otherwise altered by another process launch. nsTArray& contentParents = - GetOrCreatePool(remoteType); + GetOrCreatePool(p->GetRemoteType()); contentParents.AppendElement(p); } diff --git a/dom/workers/remoteworkers/RemoteWorkerManager.cpp b/dom/workers/remoteworkers/RemoteWorkerManager.cpp index b2b8085bb083..4b036b90ef89 100644 --- a/dom/workers/remoteworkers/RemoteWorkerManager.cpp +++ b/dom/workers/remoteworkers/RemoteWorkerManager.cpp @@ -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) {