Index: third_party/WebKit/Source/wtf/Assertions.h |
diff --git a/third_party/WebKit/Source/wtf/Assertions.h b/third_party/WebKit/Source/wtf/Assertions.h |
index a6917d62b85b8b8074dd6ce5b85d61a7c405da8a..cab1dbc9709871de7d002f77f111a8cf81e46cd8 100644 |
--- a/third_party/WebKit/Source/wtf/Assertions.h |
+++ b/third_party/WebKit/Source/wtf/Assertions.h |
@@ -48,6 +48,10 @@ |
#include "wtf/build_config.h" |
#include <stdarg.h> |
+#if OS(WIN) |
+#include <windows.h> |
+#endif |
+ |
// Users must test "#if ENABLE(ASSERT)", which helps ensure that code |
// testing this macro has included this header. |
#ifndef ENABLE_ASSERT |
@@ -150,6 +154,18 @@ private: |
#endif |
#endif |
+/* OOM_CRASH() - Specialization of IMMEDIATE_CRASH which will raise a custom exception on Windows to signal this is OOM and not a normal assert. */ |
+#ifndef OOM_CRASH |
+#if OS(WIN) |
+#define OOM_CRASH() do { \ |
+ ::RaiseException(0xE0000008, EXCEPTION_NONCONTINUABLE, 0, nullptr); \ |
+ IMMEDIATE_CRASH(); \ |
+} while (0) |
+#else |
+#define OOM_CRASH() IMMEDIATE_CRASH() |
+#endif |
+#endif |
+ |
/* CRASH() - Raises a fatal error resulting in program termination and triggering either the debugger or the crash reporter. |
Use CRASH() in response to known, unrecoverable errors like out-of-memory. |