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

Unified Diff: third_party/WebKit/Source/wtf/CheckedNumeric.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
Index: third_party/WebKit/Source/wtf/CheckedNumeric.h
diff --git a/third_party/WebKit/Source/wtf/NotFound.h b/third_party/WebKit/Source/wtf/CheckedNumeric.h
similarity index 82%
copy from third_party/WebKit/Source/wtf/NotFound.h
copy to third_party/WebKit/Source/wtf/CheckedNumeric.h
index 7c7d0c3cfb4c0ba231534d750da4b56161542463..f7f5dcf1fe7c7712dca05934f61988c14b596547 100644
--- a/third_party/WebKit/Source/wtf/NotFound.h
+++ b/third_party/WebKit/Source/wtf/CheckedNumeric.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,13 +23,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef NotFound_h
-#define NotFound_h
+#ifndef WTF_CheckedNumeric_h
+#define WTF_CheckedNumeric_h
+
+/* See base/numerics/safe_math.h for usage.
+ */
+#include "base/numerics/safe_math.h"
namespace WTF {
-const size_t kNotFound = static_cast<size_t>(-1);
-}
+using base::CheckedNumeric;
+} // namespace WTF
-using WTF::kNotFound;
+using WTF::CheckedNumeric;
-#endif // NotFound_h
+#endif
« no previous file with comments | « third_party/WebKit/Source/wtf/CheckedArithmeticTest.cpp ('k') | third_party/WebKit/Source/wtf/StdLibExtras.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698