[base] Fail CHECK when dereferencing an empty optional

This change promotes the DCHECKs in base::Optional::value() to CHECKs
in order to match std::optional more closely. Furthermore, it also
CHECKs when dereferencing a base::Optional via operator* or operator->.

Bug: 817982
Change-Id: Ib2bfdd3a863e8bade21fa1b6b1c10c7c4d2ca135
Reviewed-on: https://chromium-review.googlesource.com/997335
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550197}

CrOS-Libchrome-Original-Commit: c85bfab56bd24e8309d41d6accc888f952fd3cb2
1 file changed
tree: 9cae39fa67c5e2b82e7f46932abe727fcb56bdcc
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/