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

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: 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
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..90230f42d3519f662ef09cd3abe1a91fcac7f805 100644
--- a/third_party/WebKit/Source/wtf/StdLibExtras.h
+++ b/third_party/WebKit/Source/wtf/StdLibExtras.h
@@ -28,7 +28,7 @@
#include "wtf/Assertions.h"
#include "wtf/CPU.h"
-#include "wtf/CheckedArithmetic.h"
+#include "wtf/CheckedNumeric.h"
#include "wtf/LeakAnnotations.h"
#include <cstddef>
@@ -153,8 +153,8 @@ 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);
+ CheckedNumeric<To> checked(value);
+ return checked.ValueOrDie();
dcheng 2016/03/17 08:25:14 checked_cast is the //base/numerics/safe_conversio
Bret 2016/03/18 20:48:51 Done.
}
// Use the following macros to prevent errors caused by accidental

Powered by Google App Engine
This is Rietveld 408576698