From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/ipc/ContentChild.cpp | 82 +++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 49 deletions(-) (limited to 'dom/ipc/ContentChild.cpp') 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(SandboxInfo::Get().AsInteger())); + SandboxInfo::Get().AsInteger()); # endif /* XP_LINUX && !ANDROID */ #endif /* MOZ_SANDBOX */ @@ -1984,12 +1984,6 @@ PRemotePrintJobChild* ContentChild::AllocPRemotePrintJobChild() { #endif } -already_AddRefed -ContentChild::AllocPClipboardReadRequestChild( - const nsTArray& aTypes) { - return MakeAndAddRef(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 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 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 -- cgit v1.2.3