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

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

Issue 1822353002: Revert of 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
« 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 5475d3feb7e47a9e4b1ee0552abfadca7f508e13..efaa3c65142fedce8a99dce73595bc5f6fac15b7 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,7 +153,8 @@
template<typename To, typename From>
inline To safeCast(From value)
{
- return base::checked_cast<To>(value);
+ RELEASE_ASSERT(isInBounds<To>(value));
+ return static_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