Chromium Code Reviews| 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 |