Bug 1753424 - Remove unused UtilityProcessParent and UtilityProcessManager code r=nika

Differential Revision: https://phabricator.services.mozilla.com/D139816
This commit is contained in:
Alexandre Lissy 2022-03-26 09:53:45 +00:00
Родитель 88d7369209
Коммит 1018aa811c
5 изменённых файлов: 3 добавлений и 35 удалений

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

@ -201,22 +201,6 @@ void UtilityProcessManager::OnProcessUnexpectedShutdown(
DestroyProcess();
}
void UtilityProcessManager::NotifyRemoteActorDestroyed() {
if (!NS_IsMainThread()) {
RefPtr<UtilityProcessManager> self = this;
NS_DispatchToMainThread(NS_NewRunnableFunction(
"UtilityProcessManager::NotifyRemoteActorDestroyed()",
[self]() { self->NotifyRemoteActorDestroyed(); }));
return;
}
// One of the bridged top-level actors for the Utility process has been
// prematurely terminated, and we're receiving a notification. This
// can happen if the ActorDestroy for a bridged protocol fires
// before the ActorDestroy for PUtilityProcessParent.
OnProcessUnexpectedShutdown(mProcess);
}
void UtilityProcessManager::CleanShutdown() { DestroyProcess(); }
void UtilityProcessManager::DestroyProcess() {

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

@ -36,10 +36,6 @@ class UtilityProcessManager final : public UtilityProcessHost::Listener {
void OnProcessUnexpectedShutdown(UtilityProcessHost* aHost);
// Notify the UtilityProcessManager that a top-level PUtility protocol has
// been terminated. This may be called from any thread.
void NotifyRemoteActorDestroyed();
// Returns the platform pid for the Utility process.
Maybe<base::ProcessId> ProcessPid();
@ -50,9 +46,6 @@ class UtilityProcessManager final : public UtilityProcessHost::Listener {
// Returns access to the PUtility protocol if a Utility process is present.
UtilityProcessParent* GetProcessParent() { return mProcessParent; }
// Returns whether or not a Utility process was ever launched.
bool AttemptedProcess() const { return mNumProcessAttempts > 0; }
// Returns the Utility Process
UtilityProcessHost* Process() { return mProcess; }

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

@ -21,23 +21,14 @@
namespace mozilla::ipc {
static std::atomic<UtilityProcessParent*> sUtilityProcessParent;
UtilityProcessParent::UtilityProcessParent(UtilityProcessHost* aHost)
: mHost(aHost) {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mHost);
sUtilityProcessParent = this;
}
UtilityProcessParent::~UtilityProcessParent() = default;
/* static */
UtilityProcessParent* UtilityProcessParent::GetSingleton() {
MOZ_DIAGNOSTIC_ASSERT(sUtilityProcessParent);
return sUtilityProcessParent;
}
bool UtilityProcessParent::SendRequestMemoryReport(
const uint32_t& aGeneration, const bool& aAnonymize,
const bool& aMinimizeMemoryUsage, const Maybe<FileDescriptor>& aDMDFile) {

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

@ -29,8 +29,6 @@ class UtilityProcessParent final
explicit UtilityProcessParent(UtilityProcessHost* aHost);
static UtilityProcessParent* GetSingleton();
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
bool SendRequestMemoryReport(const uint32_t& aGeneration,

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

@ -16,7 +16,9 @@ namespace ipc {
// to be updated as well.
enum SandboxingKind : uint64_t {
GENERIC_UTILITY = 0x01,
GENERIC_UTILITY,
COUNT,
};