[M141] [a11y] Replace fatal 140 CHECK/NOTREACHED by non-fatal alternatives
Original change's description:
> [a11y] Replace fatal 140 CHECK/NOTREACHED by non-fatal alternatives
>
> In CL:6062485, we added NOTREACHED(base::NotFatalUntil::M140) and
> CHECK(condition, base::NotFatalUntil::M140) in a few places across blink
> accessibility. Now that 140 is stable, we observe a spike of crashes
> caused by those now-fatal checks. Unfortunately, the person who added
> those checks isn't around anymore so the crashes are kinda meaningless
> right now. The crashes were meant to raise flags about issues in our
> serialization logic and create a sense of priority, but until this
> becomes a priority again and we assign someone to that, we should avoid
> crashes tabs in release builds.
>
> Bug: 452392024
> Change-Id: Ie10412a708161a72983b308dfffe5534467b03cf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7046819
> Auto-Submit: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
> Reviewed-by: Lucas Radaelli <lucasradaelli@google.com>
> Commit-Queue: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#1531735}
(cherry picked from commit ae919b6a000889f66091f44f4636ad073cb17a25)
Bug: 453647742,452392024
Change-Id: Ie10412a708161a72983b308dfffe5534467b03cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7063912
Auto-Submit: Chrome Cherry Picker <chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/7390@{#2667}
Cr-Branched-From: d481efce5eb300acbb896686676ebd0352a6f1db-refs/heads/main@{#1509326}
diff --git a/third_party/blink/renderer/modules/accessibility/ax_debug_utils.cc b/third_party/blink/renderer/modules/accessibility/ax_debug_utils.cc
index 5e1f050..c2c6b7a3 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_debug_utils.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_debug_utils.cc
@@ -167,7 +167,9 @@
msg << "\n* Serialized an unincluded node: " << obj;
}
}
- NOTREACHED(base::NotFatalUntil::M140) << msg.str();
+ // TODO(crbug.com/452392024): Investigate why this is reached, fix it, and
+ // move to a NOTREACHED.
+ DUMP_WILL_BE_NOTREACHED() << msg.str();
}
#if EXPENSIVE_DCHECKS_ARE_ON()
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
index 27d7b1ae..2d06bf04 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -6314,7 +6314,9 @@
int new_index = index;
for (wtf_size_t i = 0; i < length; ++i) {
if (children[i]->IsDetached()) {
- NOTREACHED(base::NotFatalUntil::M140)
+ // TODO(crbug.com/452392024): Investigate why this is reached, fix it,
+ // and move to a NOTREACHED.
+ DUMP_WILL_BE_NOTREACHED()
<< "Cannot add a detached child: " << "\n* Child: " << children[i]
<< "\n* Parent: " << child << "\n* Grandparent: " << this;
continue;
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
index 715254ac..12b2f70 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -4015,7 +4015,9 @@
return;
}
- CHECK(!ax_object->IsMissingParent(), base::NotFatalUntil::M140)
+ // TODO(crbug.com/452392024): Investigate why this fails, fix it, and move to
+ // a CHECK.
+ DUMP_WILL_BE_CHECK(!ax_object->IsMissingParent())
<< tree_update->ToString() << " on " << ax_object;
// Update cached attributes for all changed nodes before serialization,
@@ -4088,7 +4090,9 @@
return;
}
- CHECK(!ax_object->IsMissingParent(), base::NotFatalUntil::M140)
+ // TODO(crbug.com/452392024): Investigate why this fails, fix it, and move to
+ // a CHECK.
+ DUMP_WILL_BE_CHECK(!ax_object->IsMissingParent())
<< tree_update->ToString() << " on " << ax_object;
base::AutoReset<ax::mojom::blink::EventFrom> event_from_resetter(