Add DUMP_WILL_BE_ NOTREACHED and CHECK_op variants

This makes sure that we have non-fatal versions of dumping for
statements intended to become NOTREACHED_NORETURN or CHECK_ variants so
that we can trivially convert between them without rewriting any
condition.

Bug: 1446114
Change-Id: I3c03281653962b06b2e98aa65c6fec3303d6b200
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4540487
Reviewed-by: Lei Zhang <[email protected]>
Commit-Queue: Peter Boström <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1145444}
diff --git a/base/check.h b/base/check.h
index 4bf8146..02da6306 100644
--- a/base/check.h
+++ b/base/check.h
@@ -84,6 +84,11 @@
   static CheckError DumpWillBeCheck(
       const char* condition,
       const base::Location& location = base::Location::Current());
+  // Takes ownership over (free()s after using) `log_message_str`, for use with
+  // DUMP_WILL_BE_CHECK_op macros.
+  static CheckError DumpWillBeCheckOp(
+      char* log_message_str,
+      const base::Location& location = base::Location::Current());
 
   static CheckError PCheck(
       const char* condition,
@@ -95,6 +100,9 @@
       const char* condition,
       const base::Location& location = base::Location::Current());
 
+  static CheckError DumpWillBeNotReachedNoreturn(
+      const base::Location& location = base::Location::Current());
+
   static CheckError NotImplemented(
       const char* function,
       const base::Location& location = base::Location::Current());