mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 02:35:41 +00:00
Bug 1438945 - Part 12: Spawning a new process if needed. r=asuth
--HG-- extra : rebase_source : 76cfdb0b7798d73d755183f8c431d631f67b9fac
This commit is contained in:
parent
e9bd43a3d1
commit
b08cb98eb5
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "RemoteWorkerManager.h"
|
#include "RemoteWorkerManager.h"
|
||||||
|
|
||||||
|
#include "mozilla/dom/ContentParent.h"
|
||||||
#include "mozilla/dom/RemoteWorkerParent.h"
|
#include "mozilla/dom/RemoteWorkerParent.h"
|
||||||
#include "mozilla/ipc/BackgroundParent.h"
|
#include "mozilla/ipc/BackgroundParent.h"
|
||||||
#include "mozilla/ipc/PBackgroundParent.h"
|
#include "mozilla/ipc/PBackgroundParent.h"
|
||||||
@ -195,7 +196,19 @@ RemoteWorkerManager::LaunchNewContentProcess()
|
|||||||
AssertIsOnBackgroundThread();
|
AssertIsOnBackgroundThread();
|
||||||
MOZ_ASSERT(XRE_IsParentProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
|
||||||
// TODO: exec a new process
|
// This runnable will spawn a new process if it doesn't exist yet.
|
||||||
|
nsCOMPtr<nsIRunnable> r =
|
||||||
|
NS_NewRunnableFunction("LaunchNewContentProcess", [] () {
|
||||||
|
RefPtr<ContentParent> unused =
|
||||||
|
ContentParent::GetNewOrUsedBrowserProcess(
|
||||||
|
nullptr,
|
||||||
|
NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIEventTarget> target =
|
||||||
|
SystemGroup::EventTargetFor(TaskCategory::Other);
|
||||||
|
target->Dispatch(r.forget(), NS_DISPATCH_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // dom namespace
|
} // dom namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user