/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include"mozilla/ipc/UtilityProcessParent.h" #include"mozilla/ipc/UtilityProcessManager.h"
#ifdefined(XP_WIN) # include <dwrite.h> # include <process.h> # include "mozilla/WinDllServices.h" #endif
void UtilityProcessParent::ActorDestroy(ActorDestroyReason aWhy) {
RefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
if (aWhy == AbnormalShutdown) {
nsAutoString dumpID;
if (mCrashReporter) { #ifdefined(MOZ_SANDBOX)
RefPtr<mozilla::ipc::UtilityProcessManager> upm =
mozilla::ipc::UtilityProcessManager::GetSingleton(); if (upm) {
Span<const UtilityActorName> actors = upm->GetActors(this);
nsAutoCString actorsName; if (!actors.IsEmpty()) {
actorsName += GetUtilityActorName(actors.First<1>()[0]); for (constauto& actor : actors.From(1)) {
actorsName += ", "_ns + GetUtilityActorName(actor);
}
}
mCrashReporter->AddAnnotationNSCString(
CrashReporter::Annotation::UtilityActorsName, actorsName);
} #endif
}
GenerateCrashReport(OtherPid(), &dumpID);
// It's okay for dumpID to be empty if there was no minidump generated // tests like ipc/glue/test/browser/browser_utility_crashReporter.js are // there to verify this if (!dumpID.IsEmpty()) {
props->SetPropertyAsAString(u"dumpID"_ns, dumpID);
}
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService(); if (obs) {
obs->NotifyObservers((nsIPropertyBag2*)props, "ipc:utility-shutdown",
pid.get());
} else {
NS_WARNING("Could not get a nsIObserverService, ipc:utility-shutdown skip");
}
mHost->OnChannelClosed(aWhy);
}
// To ensure that IPDL is finished before UtilityParent gets deleted. class DeferredDeleteUtilityProcessParent : public Runnable { public: explicit DeferredDeleteUtilityProcessParent(
RefPtr<UtilityProcessParent> aParent)
: Runnable("ipc::glue::DeferredDeleteUtilityProcessParent"),
mParent(std::move(aParent)) {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.