Skip to content

Commit

Permalink
Replace if () NOTREACHED() with CHECK() in ash/public/cpp/external_ar…
Browse files Browse the repository at this point in the history
…c/message_center

Replace simple cases of if (foo) NOTREACHED(); and if (!bar)
NOTREACHED() with CHECK(!foo); and CHECK(bar) in
ash/public/cpp/external_arc/message_center.

This aligns with current guidance:
https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/checks.md#:~:text=Use%20CHECK(bar)%3B%20instead

Most changes were automated with regular expression substitutions.

This CL was uploaded by git cl split.

[email protected]

Change-Id: Ic809949f8a2683d51b7cdccc16fe48fa7f226f97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5826744
Auto-Submit: Adam Rice <[email protected]>
Commit-Queue: Toshiki Kikuchi <[email protected]>
Commit-Queue: Adam Rice <[email protected]>
Reviewed-by: Toshiki Kikuchi <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1349738}
  • Loading branch information
ricea authored and Chromium LUCI CQ committed Sep 2, 2024
1 parent e6019a1 commit 6e895fd
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <utility>

#include "ash/public/cpp/external_arc/message_center/arc_notification_surface_impl.h"
#include "base/check.h"
#include "components/exo/notification_surface.h"

namespace ash {
Expand Down Expand Up @@ -55,9 +56,7 @@ void ArcNotificationSurfaceManagerImpl::AddSurface(
std::pair<std::string, std::unique_ptr<ArcNotificationSurfaceImpl>>(
surface->notification_key(),
std::make_unique<ArcNotificationSurfaceImpl>(surface)));
if (!result.second) {
NOTREACHED();
}
CHECK(result.second);

for (auto& observer : observers_)
observer.OnNotificationSurfaceAdded(result.first->second.get());
Expand Down

0 comments on commit 6e895fd

Please sign in to comment.