diff --git a/dom/workers/remoteworkers/RemoteWorkerManager.cpp b/dom/workers/remoteworkers/RemoteWorkerManager.cpp index 6745c0dc8a24..5a7ac8a19c83 100644 --- a/dom/workers/remoteworkers/RemoteWorkerManager.cpp +++ b/dom/workers/remoteworkers/RemoteWorkerManager.cpp @@ -6,6 +6,7 @@ #include "RemoteWorkerManager.h" +#include "mozilla/dom/ContentParent.h" #include "mozilla/dom/RemoteWorkerParent.h" #include "mozilla/ipc/BackgroundParent.h" #include "mozilla/ipc/PBackgroundParent.h" @@ -195,7 +196,19 @@ RemoteWorkerManager::LaunchNewContentProcess() AssertIsOnBackgroundThread(); MOZ_ASSERT(XRE_IsParentProcess()); - // TODO: exec a new process + // This runnable will spawn a new process if it doesn't exist yet. + nsCOMPtr r = + NS_NewRunnableFunction("LaunchNewContentProcess", [] () { + RefPtr unused = + ContentParent::GetNewOrUsedBrowserProcess( + nullptr, + NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE)); + } + ); + + nsCOMPtr target = + SystemGroup::EventTargetFor(TaskCategory::Other); + target->Dispatch(r.forget(), NS_DISPATCH_NORMAL); } } // dom namespace