summaryrefslogtreecommitdiffstats
path: root/dom/ipc/ContentChild.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /dom/ipc/ContentChild.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/ContentChild.cpp')
-rw-r--r--dom/ipc/ContentChild.cpp82
1 files changed, 33 insertions, 49 deletions
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index e3b0ebd795..7507d88fe0 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1714,12 +1714,12 @@ mozilla::ipc::IPCResult ContentChild::RecvSetProcessSandbox(
DisconnectWindowServer(sandboxEnabled);
# endif
- CrashReporter::AnnotateCrashReport(
+ CrashReporter::RecordAnnotationBool(
CrashReporter::Annotation::ContentSandboxEnabled, sandboxEnabled);
# if defined(XP_LINUX) && !defined(ANDROID)
- CrashReporter::AnnotateCrashReport(
+ CrashReporter::RecordAnnotationU32(
CrashReporter::Annotation::ContentSandboxCapabilities,
- static_cast<int>(SandboxInfo::Get().AsInteger()));
+ SandboxInfo::Get().AsInteger());
# endif /* XP_LINUX && !ANDROID */
#endif /* MOZ_SANDBOX */
@@ -1984,12 +1984,6 @@ PRemotePrintJobChild* ContentChild::AllocPRemotePrintJobChild() {
#endif
}
-already_AddRefed<PClipboardReadRequestChild>
-ContentChild::AllocPClipboardReadRequestChild(
- const nsTArray<nsCString>& aTypes) {
- return MakeAndAddRef<ClipboardReadRequestChild>(aTypes);
-}
-
media::PMediaChild* ContentChild::AllocPMediaChild() {
return media::AllocPMediaChild();
}
@@ -2223,9 +2217,8 @@ void ContentChild::ProcessingError(Result aCode, const char* aReason) {
MOZ_CRASH("not reached");
}
- nsDependentCString reason(aReason);
- CrashReporter::AnnotateCrashReport(
- CrashReporter::Annotation::ipc_channel_error, reason);
+ CrashReporter::RecordAnnotationCString(
+ CrashReporter::Annotation::ipc_channel_error, aReason);
MOZ_CRASH("Content child abort due to IPC error");
}
@@ -2677,8 +2670,8 @@ mozilla::ipc::IPCResult ContentChild::RecvRemoteType(
}
// Use the prefix to avoid URIs from Fission isolated processes.
- CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::RemoteType,
- remoteTypePrefix);
+ CrashReporter::RecordAnnotationNSCString(
+ CrashReporter::Annotation::RemoteType, remoteTypePrefix);
// Defer RemoteWorkerService initialization until the child process does
// receive its specific remoteType and can become actionable for the
@@ -2951,8 +2944,7 @@ void ContentChild::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure) {
}
mozilla::ipc::IPCResult ContentChild::RecvShutdownConfirmedHP() {
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState,
+ ProcessChild::AppendToIPCShutdownStateAnnotation(
"RecvShutdownConfirmedHP entry"_ns);
// Bug 1755376: If we see "RecvShutdownConfirmedHP entry" often in
@@ -2963,8 +2955,7 @@ mozilla::ipc::IPCResult ContentChild::RecvShutdownConfirmedHP() {
}
mozilla::ipc::IPCResult ContentChild::RecvShutdown() {
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState, "RecvShutdown entry"_ns);
+ ProcessChild::AppendToIPCShutdownStateAnnotation("RecvShutdown entry"_ns);
// Signal the ongoing shutdown to AppShutdown, this
// will make abort nested SpinEventLoopUntilOrQuit loops
@@ -2973,8 +2964,7 @@ mozilla::ipc::IPCResult ContentChild::RecvShutdown() {
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
if (os) {
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState,
+ ProcessChild::AppendToIPCShutdownStateAnnotation(
"content-child-will-shutdown started"_ns);
os->NotifyObservers(ToSupports(this), "content-child-will-shutdown",
@@ -2986,8 +2976,7 @@ mozilla::ipc::IPCResult ContentChild::RecvShutdown() {
}
void ContentChild::ShutdownInternal() {
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState, "ShutdownInternal entry"_ns);
+ ProcessChild::AppendToIPCShutdownStateAnnotation("ShutdownInternal entry"_ns);
// If we receive the shutdown message from within a nested event loop, we want
// to wait for that event loop to finish. Otherwise we could prematurely
@@ -3025,8 +3014,7 @@ void ContentChild::ShutdownInternal() {
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
if (os) {
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState,
+ ProcessChild::AppendToIPCShutdownStateAnnotation(
"content-child-shutdown started"_ns);
os->NotifyObservers(ToSupports(this), "content-child-shutdown", nullptr);
}
@@ -3035,21 +3023,21 @@ void ContentChild::ShutdownInternal() {
if (mProfilerController) {
const bool isProfiling = profiler_is_active();
- CrashReporter::AnnotateCrashReport(
+ CrashReporter::RecordAnnotationCString(
CrashReporter::Annotation::ProfilerChildShutdownPhase,
- isProfiling ? "Profiling - GrabShutdownProfileAndShutdown"_ns
- : "Not profiling - GrabShutdownProfileAndShutdown"_ns);
+ isProfiling ? "Profiling - GrabShutdownProfileAndShutdown"
+ : "Not profiling - GrabShutdownProfileAndShutdown");
ProfileAndAdditionalInformation shutdownProfileAndAdditionalInformation =
mProfilerController->GrabShutdownProfileAndShutdown();
- CrashReporter::AnnotateCrashReport(
+ CrashReporter::RecordAnnotationCString(
CrashReporter::Annotation::ProfilerChildShutdownPhase,
- isProfiling ? "Profiling - Destroying ChildProfilerController"_ns
- : "Not profiling - Destroying ChildProfilerController"_ns);
+ isProfiling ? "Profiling - Destroying ChildProfilerController"
+ : "Not profiling - Destroying ChildProfilerController");
mProfilerController = nullptr;
- CrashReporter::AnnotateCrashReport(
+ CrashReporter::RecordAnnotationCString(
CrashReporter::Annotation::ProfilerChildShutdownPhase,
- isProfiling ? "Profiling - SendShutdownProfile (sending)"_ns
- : "Not profiling - SendShutdownProfile (sending)"_ns);
+ isProfiling ? "Profiling - SendShutdownProfile (sending)"
+ : "Not profiling - SendShutdownProfile (sending)");
if (const size_t len = shutdownProfileAndAdditionalInformation.SizeOf();
len >= size_t(IPC::Channel::kMaximumMessageSize)) {
shutdownProfileAndAdditionalInformation.mProfile = nsPrintfCString(
@@ -3061,13 +3049,12 @@ void ContentChild::ShutdownInternal() {
// message channel, which we know will survive for long enough.
bool sent =
SendShutdownProfile(shutdownProfileAndAdditionalInformation.mProfile);
- CrashReporter::AnnotateCrashReport(
+ CrashReporter::RecordAnnotationCString(
CrashReporter::Annotation::ProfilerChildShutdownPhase,
- sent ? (isProfiling ? "Profiling - SendShutdownProfile (sent)"_ns
- : "Not profiling - SendShutdownProfile (sent)"_ns)
- : (isProfiling
- ? "Profiling - SendShutdownProfile (failed)"_ns
- : "Not profiling - SendShutdownProfile (failed)"_ns));
+ sent ? (isProfiling ? "Profiling - SendShutdownProfile (sent)"
+ : "Not profiling - SendShutdownProfile (sent)")
+ : (isProfiling ? "Profiling - SendShutdownProfile (failed)"
+ : "Not profiling - SendShutdownProfile (failed)"));
}
if (PerfStats::GetCollectionMask() != 0) {
@@ -3077,12 +3064,10 @@ void ContentChild::ShutdownInternal() {
// Start a timer that will ensure we quickly exit after a reasonable period
// of time. Prevents shutdown hangs after our connection to the parent
// closes or when the parent is too busy to ever kill us.
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState, "StartForceKillTimer"_ns);
+ ProcessChild::AppendToIPCShutdownStateAnnotation("StartForceKillTimer"_ns);
StartForceKillTimer();
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState,
+ ProcessChild::AppendToIPCShutdownStateAnnotation(
"SendFinishShutdown (sending)"_ns);
// Notify the parent that we are done with shutdown. This is sent with high
@@ -3094,8 +3079,7 @@ void ContentChild::ShutdownInternal() {
// ever process for this ContentChild.
bool sent = SendFinishShutdown();
- CrashReporter::AppendToCrashReportAnnotation(
- CrashReporter::Annotation::IPCShutdownState,
+ ProcessChild::AppendToIPCShutdownStateAnnotation(
sent ? "SendFinishShutdown (sent)"_ns : "SendFinishShutdown (failed)"_ns);
}
@@ -4345,8 +4329,8 @@ mozilla::ipc::IPCResult ContentChild::RecvLoadURI(
annotationURI = aLoadState->URI();
}
- CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
- annotationURI->GetSpecOrDefault());
+ CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL,
+ annotationURI->GetSpecOrDefault());
}
#endif
@@ -4379,8 +4363,8 @@ mozilla::ipc::IPCResult ContentChild::RecvInternalLoad(
annotationURI = aLoadState->URI();
}
- CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
- annotationURI->GetSpecOrDefault());
+ CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL,
+ annotationURI->GetSpecOrDefault());
}
#endif