Remove most remaining CHECK(false)s

In most cases NOTREACHED() is now a better option. Also performs
dead-code removal.

Bug: 40122554
Change-Id: Ia0479bc9b347f8f60a3932ef16c8b99b87f34a71
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6038981
Commit-Queue: Peter Boström <[email protected]>
Commit-Queue: Lei Zhang <[email protected]>
Auto-Submit: Peter Boström <[email protected]>
Owners-Override: Lei Zhang <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1386708}
NOKEYCHECK=True
GitOrigin-RevId: c922632dc6a0ef1916d376a16b91351846283d6f
diff --git a/shared_impl/array_var.cc b/shared_impl/array_var.cc
index 05a6991..daa5e6b 100644
--- a/shared_impl/array_var.cc
+++ b/shared_impl/array_var.cc
@@ -6,8 +6,8 @@
 
 #include <limits>
 
-#include "base/check.h"
 #include "base/memory/ref_counted.h"
+#include "base/notreached.h"
 #include "ppapi/shared_impl/ppapi_globals.h"
 #include "ppapi/shared_impl/var_tracker.h"
 
@@ -60,8 +60,7 @@
 
 uint32_t ArrayVar::GetLength() const {
   if (elements_.size() > std::numeric_limits<uint32_t>::max()) {
-    CHECK(false);
-    return 0;
+    NOTREACHED();
   }
 
   return static_cast<uint32_t>(elements_.size());
diff --git a/shared_impl/private/ppb_x509_certificate_private_shared.cc b/shared_impl/private/ppb_x509_certificate_private_shared.cc
index 5ce5c8a..fc0f22c 100644
--- a/shared_impl/private/ppb_x509_certificate_private_shared.cc
+++ b/shared_impl/private/ppb_x509_certificate_private_shared.cc
@@ -11,7 +11,7 @@
 
 #include <utility>
 
-#include "base/check.h"
+#include "base/notreached.h"
 #include "ppapi/shared_impl/ppapi_globals.h"
 #include "ppapi/shared_impl/var.h"
 #include "ppapi/shared_impl/var_tracker.h"
@@ -74,8 +74,7 @@
   }
 
   // Should not reach here.
-  CHECK(false);
-  return PP_MakeUndefined();
+  NOTREACHED();
 }
 
 //------------------------------------------------------------------------------
@@ -135,8 +134,7 @@
   // A concrete PPB_X509Certificate_Private_Shared should only ever be
   // constructed by passing in PPB_X509Certificate_Fields, in which case it is
   // already initialized.
-  CHECK(false);
-  return false;
+  NOTREACHED();
 }
 
 }  // namespace ppapi