Skip to content

Commit aa43fa2

Browse files
Bug 1831092 - Use the new pull-based API for all crash annotations and remove the global annotations table r=jgilbert,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,padenot,handyman,afranchuk,valentin,alwu,sotaro
This changes comes with several different refactorings all rolled into one, unfotunately I couldn't find a way to pull them apart: - First of all annotations now can either recorded (that is, we copy the value and have the crash reporting code own the copy) or registered. Several annotations are changed to use this functionality so that we don't need to update them as their value change. - The code in the exception handler is modified to read the annotations from the mozannotation_client crate. This has the unfortunate side-effect that we need three different bits of code to serialize them: one for annotations read from a child process, one for reading annotations from the main process outside of the exception handler and one for reading annotations from the main process within the exception handler. As we move to fully out-of-process crash reporting the last two methods will go away. - The mozannotation_client crate now doesn't record annotation types anymore. I realized as I was working on this that storing types at runtime has two issues: the first one is that buggy code might change the type of an annotation (that is record it under two different types at two different moments), the second issue is that types might become corrupt during a crash, so better enforce them at annotation-writing time. The end result is that the mozannotation_* crates now only store byte buffers, track the format the data is stored in (null-terminated string, fixed size buffer, etc...) but not the type of data each annotation is supposed to contain. - Which brings us to the next change: concrete types for annotations are now enforced when they're written out. If an annotation doesn't match the expected type it's skipped. Storing an annotation with the wrong type will also trigger an assertion in debug builds. Differential Revision: https://phabricator.services.mozilla.com/D195248
1 parent 42efa58 commit aa43fa2

File tree

77 files changed

+1163
-844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1163
-844
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

accessible/base/nsAccessibilityService.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,8 +1522,8 @@ bool nsAccessibilityService::Init() {
15221522
NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
15231523
gApplicationAccessible->Init();
15241524

1525-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::Accessibility,
1526-
"Active"_ns);
1525+
CrashReporter::RecordAnnotationCString(
1526+
CrashReporter::Annotation::Accessibility, "Active");
15271527

15281528
// Now its safe to start platform accessibility.
15291529
if (XRE_IsParentProcess()) PlatformInit();

accessible/mac/Platform.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
256256
mozilla::Telemetry::ScalarSet(
257257
mozilla::Telemetry::ScalarID::A11Y_INSTANTIATORS, client);
258258
#endif // defined(MOZ_TELEMETRY_REPORTING)
259-
CrashReporter::AnnotateCrashReport(
259+
CrashReporter::RecordAnnotationNSCString(
260260
CrashReporter::Annotation::AccessibilityClient,
261261
NS_ConvertUTF16toUTF8(client));
262262
}

accessible/windows/msaa/Compatibility.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void Compatibility::Init() {
103103
// Note we collect some AT statistics/telemetry here for convenience.
104104
InitConsumers();
105105

106-
CrashReporter::AnnotateCrashReport(
106+
CrashReporter::RecordAnnotationNSCString(
107107
CrashReporter::Annotation::AccessibilityInProcClient,
108108
nsPrintfCString("0x%X", sConsumers));
109109

accessible/windows/msaa/Platform.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,8 @@ static void AccumulateInstantiatorTelemetry(const nsAString& aValue) {
197197
#if defined(MOZ_TELEMETRY_REPORTING)
198198
Telemetry::ScalarSet(Telemetry::ScalarID::A11Y_INSTANTIATORS, aValue);
199199
#endif // defined(MOZ_TELEMETRY_REPORTING)
200-
CrashReporter::AnnotateCrashReport(
201-
CrashReporter::Annotation::AccessibilityClient,
202-
NS_ConvertUTF16toUTF8(aValue));
200+
CrashReporter::RecordAnnotationNSString(
201+
CrashReporter::Annotation::AccessibilityClient, aValue);
203202
}
204203
}
205204

browser/app/winlauncher/freestanding/DllBlocklist.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "mozilla/Types.h"
1212
#include "mozilla/WindowsDllBlocklist.h"
1313

14-
#include "CrashAnnotations.h"
1514
#include "DllBlocklist.h"
1615
#include "LoaderPrivateAPI.h"
1716
#include "ModuleLoadFrame.h"
@@ -136,12 +135,8 @@ void NativeNtBlockSet::Write(WritableBuffer& aBuffer) {
136135

137136
static NativeNtBlockSet gBlockSet;
138137

139-
extern "C" void MOZ_EXPORT
140-
NativeNtBlockSet_Write(CrashReporter::AnnotationWriter& aWriter) {
141-
WritableBuffer buffer;
142-
gBlockSet.Write(buffer);
143-
aWriter.Write(CrashReporter::Annotation::BlockedDllList, buffer.Data(),
144-
buffer.Length());
138+
extern "C" void MOZ_EXPORT NativeNtBlockSet_Write(WritableBuffer& aBuffer) {
139+
gBlockSet.Write(aBuffer);
145140
}
146141

147142
enum class BlockAction {

config/external/rlbox_wasm2c_sandbox/rlbox_wasm2c_thread_locals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void moz_wasm2c_memgrow_failed() {
3838
# ifdef WASM_RT_GROW_FAILED_CRASH
3939
MOZ_CRASH("wasm2c memory grow failed");
4040
# else
41-
CrashReporter::AnnotateCrashReport(
41+
CrashReporter::RecordAnnotationBool(
4242
CrashReporter::Annotation::WasmLibrarySandboxMallocFailed, true);
4343
# endif
4444
}

docshell/base/BrowsingContext.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ static StaticAutoPtr<BrowsingContextMap> sBrowsingContexts;
161161
// Top-level Content BrowsingContexts only, indexed by BrowserId instead of Id
162162
static StaticAutoPtr<BrowsingContextMap> sCurrentTopByBrowserId;
163163

164+
static bool gIPCEnabledAnnotation = false;
165+
static bool gFissionEnabledAnnotation = false;
166+
164167
static void UnregisterBrowserId(BrowsingContext* aBrowsingContext) {
165168
if (!aBrowsingContext->IsTopContent() || !sCurrentTopByBrowserId) {
166169
return;
@@ -248,6 +251,11 @@ void BrowsingContext::Init() {
248251
sCurrentTopByBrowserId = new BrowsingContextMap();
249252
ClearOnShutdown(&sBrowsingContexts);
250253
ClearOnShutdown(&sCurrentTopByBrowserId);
254+
CrashReporter::RegisterAnnotationBool(
255+
CrashReporter::Annotation::DOMIPCEnabled, &gIPCEnabledAnnotation);
256+
CrashReporter::RegisterAnnotationBool(
257+
CrashReporter::Annotation::DOMFissionEnabled,
258+
&gFissionEnabledAnnotation);
251259
}
252260
}
253261

@@ -1658,11 +1666,8 @@ NS_IMETHODIMP BrowsingContext::SetRemoteTabs(bool aUseRemoteTabs) {
16581666
return NS_ERROR_FAILURE;
16591667
}
16601668

1661-
static bool annotated = false;
1662-
if (aUseRemoteTabs && !annotated) {
1663-
annotated = true;
1664-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::DOMIPCEnabled,
1665-
true);
1669+
if (aUseRemoteTabs && !gIPCEnabledAnnotation) {
1670+
gIPCEnabledAnnotation = true;
16661671
}
16671672

16681673
// Don't allow non-remote tabs with remote subframes.
@@ -1686,11 +1691,8 @@ NS_IMETHODIMP BrowsingContext::SetRemoteSubframes(bool aUseRemoteSubframes) {
16861691
return NS_ERROR_FAILURE;
16871692
}
16881693

1689-
static bool annotated = false;
1690-
if (aUseRemoteSubframes && !annotated) {
1691-
annotated = true;
1692-
CrashReporter::AnnotateCrashReport(
1693-
CrashReporter::Annotation::DOMFissionEnabled, true);
1694+
if (aUseRemoteSubframes && !gFissionEnabledAnnotation) {
1695+
gFissionEnabledAnnotation = true;
16941696
}
16951697

16961698
// Don't allow non-remote tabs with remote subframes.

dom/canvas/QueueParamTraits.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,13 @@ struct EnumSerializer {
354354
static bool Read(ConsumerView<U>& aConsumerView, ParamType* aResult) {
355355
DataType value;
356356
if (!aConsumerView.ReadParam(&value)) {
357-
CrashReporter::AnnotateCrashReport(
358-
CrashReporter::Annotation::IPCReadErrorReason, "Bad iter"_ns);
357+
CrashReporter::RecordAnnotationCString(
358+
CrashReporter::Annotation::IPCReadErrorReason, "Bad iter");
359359
return false;
360360
}
361361
if (!EnumValidator::IsLegalValue(static_cast<DataType>(value))) {
362-
CrashReporter::AnnotateCrashReport(
363-
CrashReporter::Annotation::IPCReadErrorReason, "Illegal value"_ns);
362+
CrashReporter::RecordAnnotationCString(
363+
CrashReporter::Annotation::IPCReadErrorReason, "Illegal value");
364364
return false;
365365
}
366366

dom/events/TouchEvent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ bool TouchEvent::PrefEnabled(nsIDocShell* aDocShell) {
233233
// The touch screen data seems to be inaccurate in the parent process,
234234
// and we really need the crash annotation in child processes.
235235
if (firstTime && !XRE_IsParentProcess()) {
236-
CrashReporter::AnnotateCrashReport(
236+
CrashReporter::RecordAnnotationBool(
237237
CrashReporter::Annotation::HasDeviceTouchScreen, enabled);
238238
firstTime = false;
239239
}

dom/ipc/BrowserChild.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,8 @@ mozilla::ipc::IPCResult BrowserChild::RecvLoadURL(
814814
}
815815
docShell->LoadURI(aLoadState, true);
816816

817-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, spec);
817+
CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL,
818+
spec);
818819
return IPC_OK();
819820
}
820821

@@ -3481,8 +3482,8 @@ NS_IMETHODIMP BrowserChild::OnLocationChange(nsIWebProgress* aWebProgress,
34813482
annotationURI = aLocation;
34823483
}
34833484

3484-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
3485-
annotationURI->GetSpecOrDefault());
3485+
CrashReporter::RecordAnnotationNSCString(
3486+
CrashReporter::Annotation::URL, annotationURI->GetSpecOrDefault());
34863487
}
34873488
#endif
34883489
}

dom/ipc/ContentChild.cpp

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,12 +1714,12 @@ mozilla::ipc::IPCResult ContentChild::RecvSetProcessSandbox(
17141714
DisconnectWindowServer(sandboxEnabled);
17151715
# endif
17161716

1717-
CrashReporter::AnnotateCrashReport(
1717+
CrashReporter::RecordAnnotationBool(
17181718
CrashReporter::Annotation::ContentSandboxEnabled, sandboxEnabled);
17191719
# if defined(XP_LINUX) && !defined(ANDROID)
1720-
CrashReporter::AnnotateCrashReport(
1720+
CrashReporter::RecordAnnotationU32(
17211721
CrashReporter::Annotation::ContentSandboxCapabilities,
1722-
static_cast<int>(SandboxInfo::Get().AsInteger()));
1722+
SandboxInfo::Get().AsInteger());
17231723
# endif /* XP_LINUX && !ANDROID */
17241724
#endif /* MOZ_SANDBOX */
17251725

@@ -2223,9 +2223,8 @@ void ContentChild::ProcessingError(Result aCode, const char* aReason) {
22232223
MOZ_CRASH("not reached");
22242224
}
22252225

2226-
nsDependentCString reason(aReason);
2227-
CrashReporter::AnnotateCrashReport(
2228-
CrashReporter::Annotation::ipc_channel_error, reason);
2226+
CrashReporter::RecordAnnotationCString(
2227+
CrashReporter::Annotation::ipc_channel_error, aReason);
22292228

22302229
MOZ_CRASH("Content child abort due to IPC error");
22312230
}
@@ -2677,8 +2676,8 @@ mozilla::ipc::IPCResult ContentChild::RecvRemoteType(
26772676
}
26782677

26792678
// Use the prefix to avoid URIs from Fission isolated processes.
2680-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::RemoteType,
2681-
remoteTypePrefix);
2679+
CrashReporter::RecordAnnotationNSCString(
2680+
CrashReporter::Annotation::RemoteType, remoteTypePrefix);
26822681

26832682
// Defer RemoteWorkerService initialization until the child process does
26842683
// receive its specific remoteType and can become actionable for the
@@ -2951,8 +2950,7 @@ void ContentChild::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure) {
29512950
}
29522951

29532952
mozilla::ipc::IPCResult ContentChild::RecvShutdownConfirmedHP() {
2954-
CrashReporter::AppendToCrashReportAnnotation(
2955-
CrashReporter::Annotation::IPCShutdownState,
2953+
ProcessChild::AppendToIPCShutdownStateAnnotation(
29562954
"RecvShutdownConfirmedHP entry"_ns);
29572955

29582956
// Bug 1755376: If we see "RecvShutdownConfirmedHP entry" often in
@@ -2963,8 +2961,7 @@ mozilla::ipc::IPCResult ContentChild::RecvShutdownConfirmedHP() {
29632961
}
29642962

29652963
mozilla::ipc::IPCResult ContentChild::RecvShutdown() {
2966-
CrashReporter::AppendToCrashReportAnnotation(
2967-
CrashReporter::Annotation::IPCShutdownState, "RecvShutdown entry"_ns);
2964+
ProcessChild::AppendToIPCShutdownStateAnnotation("RecvShutdown entry"_ns);
29682965

29692966
// Signal the ongoing shutdown to AppShutdown, this
29702967
// will make abort nested SpinEventLoopUntilOrQuit loops
@@ -2973,8 +2970,7 @@ mozilla::ipc::IPCResult ContentChild::RecvShutdown() {
29732970

29742971
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
29752972
if (os) {
2976-
CrashReporter::AppendToCrashReportAnnotation(
2977-
CrashReporter::Annotation::IPCShutdownState,
2973+
ProcessChild::AppendToIPCShutdownStateAnnotation(
29782974
"content-child-will-shutdown started"_ns);
29792975

29802976
os->NotifyObservers(ToSupports(this), "content-child-will-shutdown",
@@ -2986,8 +2982,7 @@ mozilla::ipc::IPCResult ContentChild::RecvShutdown() {
29862982
}
29872983

29882984
void ContentChild::ShutdownInternal() {
2989-
CrashReporter::AppendToCrashReportAnnotation(
2990-
CrashReporter::Annotation::IPCShutdownState, "ShutdownInternal entry"_ns);
2985+
ProcessChild::AppendToIPCShutdownStateAnnotation("ShutdownInternal entry"_ns);
29912986

29922987
// If we receive the shutdown message from within a nested event loop, we want
29932988
// to wait for that event loop to finish. Otherwise we could prematurely
@@ -3025,8 +3020,7 @@ void ContentChild::ShutdownInternal() {
30253020

30263021
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
30273022
if (os) {
3028-
CrashReporter::AppendToCrashReportAnnotation(
3029-
CrashReporter::Annotation::IPCShutdownState,
3023+
ProcessChild::AppendToIPCShutdownStateAnnotation(
30303024
"content-child-shutdown started"_ns);
30313025
os->NotifyObservers(ToSupports(this), "content-child-shutdown", nullptr);
30323026
}
@@ -3035,21 +3029,21 @@ void ContentChild::ShutdownInternal() {
30353029

30363030
if (mProfilerController) {
30373031
const bool isProfiling = profiler_is_active();
3038-
CrashReporter::AnnotateCrashReport(
3032+
CrashReporter::RecordAnnotationCString(
30393033
CrashReporter::Annotation::ProfilerChildShutdownPhase,
3040-
isProfiling ? "Profiling - GrabShutdownProfileAndShutdown"_ns
3041-
: "Not profiling - GrabShutdownProfileAndShutdown"_ns);
3034+
isProfiling ? "Profiling - GrabShutdownProfileAndShutdown"
3035+
: "Not profiling - GrabShutdownProfileAndShutdown");
30423036
ProfileAndAdditionalInformation shutdownProfileAndAdditionalInformation =
30433037
mProfilerController->GrabShutdownProfileAndShutdown();
3044-
CrashReporter::AnnotateCrashReport(
3038+
CrashReporter::RecordAnnotationCString(
30453039
CrashReporter::Annotation::ProfilerChildShutdownPhase,
3046-
isProfiling ? "Profiling - Destroying ChildProfilerController"_ns
3047-
: "Not profiling - Destroying ChildProfilerController"_ns);
3040+
isProfiling ? "Profiling - Destroying ChildProfilerController"
3041+
: "Not profiling - Destroying ChildProfilerController");
30483042
mProfilerController = nullptr;
3049-
CrashReporter::AnnotateCrashReport(
3043+
CrashReporter::RecordAnnotationCString(
30503044
CrashReporter::Annotation::ProfilerChildShutdownPhase,
3051-
isProfiling ? "Profiling - SendShutdownProfile (sending)"_ns
3052-
: "Not profiling - SendShutdownProfile (sending)"_ns);
3045+
isProfiling ? "Profiling - SendShutdownProfile (sending)"
3046+
: "Not profiling - SendShutdownProfile (sending)");
30533047
if (const size_t len = shutdownProfileAndAdditionalInformation.SizeOf();
30543048
len >= size_t(IPC::Channel::kMaximumMessageSize)) {
30553049
shutdownProfileAndAdditionalInformation.mProfile = nsPrintfCString(
@@ -3061,13 +3055,12 @@ void ContentChild::ShutdownInternal() {
30613055
// message channel, which we know will survive for long enough.
30623056
bool sent =
30633057
SendShutdownProfile(shutdownProfileAndAdditionalInformation.mProfile);
3064-
CrashReporter::AnnotateCrashReport(
3058+
CrashReporter::RecordAnnotationCString(
30653059
CrashReporter::Annotation::ProfilerChildShutdownPhase,
3066-
sent ? (isProfiling ? "Profiling - SendShutdownProfile (sent)"_ns
3067-
: "Not profiling - SendShutdownProfile (sent)"_ns)
3068-
: (isProfiling
3069-
? "Profiling - SendShutdownProfile (failed)"_ns
3070-
: "Not profiling - SendShutdownProfile (failed)"_ns));
3060+
sent ? (isProfiling ? "Profiling - SendShutdownProfile (sent)"
3061+
: "Not profiling - SendShutdownProfile (sent)")
3062+
: (isProfiling ? "Profiling - SendShutdownProfile (failed)"
3063+
: "Not profiling - SendShutdownProfile (failed)"));
30713064
}
30723065

30733066
if (PerfStats::GetCollectionMask() != 0) {
@@ -3077,12 +3070,10 @@ void ContentChild::ShutdownInternal() {
30773070
// Start a timer that will ensure we quickly exit after a reasonable period
30783071
// of time. Prevents shutdown hangs after our connection to the parent
30793072
// closes or when the parent is too busy to ever kill us.
3080-
CrashReporter::AppendToCrashReportAnnotation(
3081-
CrashReporter::Annotation::IPCShutdownState, "StartForceKillTimer"_ns);
3073+
ProcessChild::AppendToIPCShutdownStateAnnotation("StartForceKillTimer"_ns);
30823074
StartForceKillTimer();
30833075

3084-
CrashReporter::AppendToCrashReportAnnotation(
3085-
CrashReporter::Annotation::IPCShutdownState,
3076+
ProcessChild::AppendToIPCShutdownStateAnnotation(
30863077
"SendFinishShutdown (sending)"_ns);
30873078

30883079
// Notify the parent that we are done with shutdown. This is sent with high
@@ -3094,8 +3085,7 @@ void ContentChild::ShutdownInternal() {
30943085
// ever process for this ContentChild.
30953086
bool sent = SendFinishShutdown();
30963087

3097-
CrashReporter::AppendToCrashReportAnnotation(
3098-
CrashReporter::Annotation::IPCShutdownState,
3088+
ProcessChild::AppendToIPCShutdownStateAnnotation(
30993089
sent ? "SendFinishShutdown (sent)"_ns : "SendFinishShutdown (failed)"_ns);
31003090
}
31013091

@@ -4345,8 +4335,8 @@ mozilla::ipc::IPCResult ContentChild::RecvLoadURI(
43454335
annotationURI = aLoadState->URI();
43464336
}
43474337

4348-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
4349-
annotationURI->GetSpecOrDefault());
4338+
CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL,
4339+
annotationURI->GetSpecOrDefault());
43504340
}
43514341
#endif
43524342

@@ -4379,8 +4369,8 @@ mozilla::ipc::IPCResult ContentChild::RecvInternalLoad(
43794369
annotationURI = aLoadState->URI();
43804370
}
43814371

4382-
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
4383-
annotationURI->GetSpecOrDefault());
4372+
CrashReporter::RecordAnnotationNSCString(CrashReporter::Annotation::URL,
4373+
annotationURI->GetSpecOrDefault());
43844374
}
43854375
#endif
43864376

dom/ipc/ContentParent.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4441,11 +4441,11 @@ void ContentParent::GeneratePairedMinidump(const char* aReason) {
44414441
// minidump tagging along, so we have to tell the crash reporter that
44424442
// it exists and is being appended.
44434443
nsAutoCString additionalDumps("browser");
4444-
mCrashReporter->AddAnnotation(
4444+
mCrashReporter->AddAnnotationNSCString(
44454445
CrashReporter::Annotation::additional_minidumps, additionalDumps);
44464446
nsDependentCString reason(aReason);
4447-
mCrashReporter->AddAnnotation(CrashReporter::Annotation::ipc_channel_error,
4448-
reason);
4447+
mCrashReporter->AddAnnotationNSCString(
4448+
CrashReporter::Annotation::ipc_channel_error, reason);
44494449

44504450
// Generate the report and insert into the queue for submittal.
44514451
if (mCrashReporter->GenerateMinidumpAndPair(this, "browser"_ns)) {

dom/ipc/ProcessHangMonitor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,10 @@ mozilla::ipc::IPCResult HangMonitorChild::RecvRequestContentJSInterrupt() {
560560
// In order to cancel JS execution on shutdown, we expect that
561561
// ProcessChild::NotifiedImpendingShutdown has been called before.
562562
if (mozilla::ipc::ProcessChild::ExpectingShutdown()) {
563-
CrashReporter::AppendToCrashReportAnnotation(
564-
CrashReporter::Annotation::IPCShutdownState,
563+
ProcessChild::AppendToIPCShutdownStateAnnotation(
565564
"HangMonitorChild::RecvRequestContentJSInterrupt (expected)"_ns);
566565
} else {
567-
CrashReporter::AppendToCrashReportAnnotation(
568-
CrashReporter::Annotation::IPCShutdownState,
566+
ProcessChild::AppendToIPCShutdownStateAnnotation(
569567
"HangMonitorChild::RecvRequestContentJSInterrupt (unexpected)"_ns);
570568
}
571569
JS_RequestInterruptCallback(mContext);

0 commit comments

Comments
 (0)