[dawn] Replace CHECK() with DAWN_CHECK()

Avoid collisions with other libraries.

Change-Id: If9250be60c754d68ae648e9092f78f02c25ee388
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/151621
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/CPPLINT.cfg b/CPPLINT.cfg
index c19a658..c10f532 100644
--- a/CPPLINT.cfg
+++ b/CPPLINT.cfg
@@ -1,6 +1,6 @@
 set noparent
 
-# Dawn has something called CHECK, but it doesn't have everything Chromium has (like CHECK_GE).
+# Dawn has something called DAWN_CHECK, but it doesn't have everything Chromium has (like CHECK_GE).
 filter=-readability/check
 
 # This set of removals is set to match the set of
diff --git a/src/dawn/common/Assert.h b/src/dawn/common/Assert.h
index a8a2e98..f641a0b 100644
--- a/src/dawn/common/Assert.h
+++ b/src/dawn/common/Assert.h
@@ -91,14 +91,10 @@
         DAWN_ASSERT(DAWN_ASSERT_LOOP_CONDITION && "Unreachable code hit"); \
         DAWN_BUILTIN_UNREACHABLE();                                        \
     } while (DAWN_ASSERT_LOOP_CONDITION)
-// Release-mode assert (similar to Chromium CHECK).
+// Release-mode assert (similar to Chromium DAWN_CHECK).
 // First does a debug-mode assert for better a better debugging experience, then hard-aborts.
 #define DAWN_CHECK(condition) DAWN_CHECK_CALLSITE_HELPER(__FILE__, __func__, __LINE__, condition)
 
-#if !defined(DAWN_SKIP_ASSERT_SHORTHANDS)
-#define CHECK DAWN_CHECK
-#endif
-
 namespace dawn {
 
 void BreakPoint();
diff --git a/src/dawn/common/Mutex.cpp b/src/dawn/common/Mutex.cpp
index cf7c719..ec0bb07 100644
--- a/src/dawn/common/Mutex.cpp
+++ b/src/dawn/common/Mutex.cpp
@@ -43,7 +43,7 @@
     return mOwner.load(std::memory_order_acquire) == std::this_thread::get_id();
 #else
     // This is not supported.
-    CHECK(false);
+    DAWN_CHECK(false);
 #endif
 }
 }  // namespace dawn
diff --git a/src/dawn/native/Queue.cpp b/src/dawn/native/Queue.cpp
index ac79c9a..08b1373 100644
--- a/src/dawn/native/Queue.cpp
+++ b/src/dawn/native/Queue.cpp
@@ -316,7 +316,7 @@
 
 SystemEventReceiver QueueBase::InsertWorkDoneEvent() {
     // TODO(crbug.com/dawn/2058): Implement this in all backends and remove this default impl
-    CHECK(false);
+    DAWN_CHECK(false);
 }
 
 void QueueBase::TrackTask(std::unique_ptr<TrackTaskCallback> task, ExecutionSerial serial) {
diff --git a/src/dawn/native/SystemEvent.cpp b/src/dawn/native/SystemEvent.cpp
index 274da64..163f399 100644
--- a/src/dawn/native/SystemEvent.cpp
+++ b/src/dawn/native/SystemEvent.cpp
@@ -118,7 +118,7 @@
 #elif DAWN_PLATFORM_IS(POSIX)
     close(AsFD(*this));
 #else
-    CHECK(false);  // Not implemented.
+    DAWN_CHECK(false);  // Not implemented.
 #endif
 
     value = kInvalid;
@@ -151,10 +151,10 @@
     // Send one byte to signal the receiver
     char zero[1] = {0};
     int status = write(AsFD(mPrimitive), zero, 1);
-    CHECK(status >= 0);
+    DAWN_CHECK(status >= 0);
 #else
     // Not implemented for this platform.
-    CHECK(false);
+    DAWN_CHECK(false);
 #endif
 
     mPrimitive.Close();
@@ -165,7 +165,7 @@
 bool WaitAnySystemEvent(size_t count, TrackedFutureWaitInfo* futures, Nanoseconds timeout) {
 #if DAWN_PLATFORM_IS(WINDOWS)
     // TODO(crbug.com/dawn/2054): Implement this.
-    CHECK(false);
+    DAWN_CHECK(false);
 #elif DAWN_PLATFORM_IS(POSIX)
     std::vector<pollfd> pollfds(count);
     for (size_t i = 0; i < count; ++i) {
@@ -175,7 +175,7 @@
 
     int status = poll(pollfds.data(), pollfds.size(), ToMilliseconds(timeout));
 
-    CHECK(status >= 0);
+    DAWN_CHECK(status >= 0);
     if (status == 0) {
         return false;
     }
@@ -183,7 +183,7 @@
     for (size_t i = 0; i < count; ++i) {
         int revents = pollfds[i].revents;
         static constexpr int kAllowedEvents = POLLIN | POLLHUP;
-        CHECK((revents & kAllowedEvents) == revents);
+        DAWN_CHECK((revents & kAllowedEvents) == revents);
     }
 
     for (size_t i = 0; i < count; ++i) {
@@ -193,7 +193,7 @@
 
     return true;
 #else
-    CHECK(false);  // Not implemented.
+    DAWN_CHECK(false);  // Not implemented.
 #endif
 }
 
@@ -204,7 +204,7 @@
 #elif DAWN_PLATFORM_IS(POSIX)
     int pipeFds[2];
     int status = pipe(pipeFds);
-    CHECK(status >= 0);
+    DAWN_CHECK(status >= 0);
 
     SystemEventReceiver receiver;
     receiver.mPrimitive = SystemEventPrimitive{pipeFds[0]};
@@ -215,7 +215,7 @@
     return std::make_pair(std::move(sender), std::move(receiver));
 #else
     // Not implemented for this platform.
-    CHECK(false);
+    DAWN_CHECK(false);
 #endif
 }