Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: third_party/WebKit/Source/wtf/StdLibExtras.h

Issue 1814563002: wtf/CheckedArithmetic.h delegates to base/numerics/safe_math.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert new check Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/CheckedNumeric.h ('k') | third_party/WebKit/Source/wtf/wtf.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/StdLibExtras.h
diff --git a/third_party/WebKit/Source/wtf/StdLibExtras.h b/third_party/WebKit/Source/wtf/StdLibExtras.h
index efaa3c65142fedce8a99dce73595bc5f6fac15b7..5475d3feb7e47a9e4b1ee0552abfadca7f508e13 100644
--- a/third_party/WebKit/Source/wtf/StdLibExtras.h
+++ b/third_party/WebKit/Source/wtf/StdLibExtras.h
@@ -26,9 +26,9 @@
#ifndef WTF_StdLibExtras_h
#define WTF_StdLibExtras_h
+#include "base/numerics/safe_conversions.h"
#include "wtf/Assertions.h"
#include "wtf/CPU.h"
-#include "wtf/CheckedArithmetic.h"
#include "wtf/LeakAnnotations.h"
#include <cstddef>
@@ -153,8 +153,7 @@ inline TO bitwise_cast(FROM from)
template<typename To, typename From>
inline To safeCast(From value)
{
- RELEASE_ASSERT(isInBounds<To>(value));
- return static_cast<To>(value);
+ return base::checked_cast<To>(value);
}
// Use the following macros to prevent errors caused by accidental
« no previous file with comments | « third_party/WebKit/Source/wtf/CheckedNumeric.h ('k') | third_party/WebKit/Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698