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

Unified Diff: third_party/WebKit/Source/core/dom/DOMDataView.cpp

Issue 2339323003: Remove platform/CheckedInt.h, we can use wtf/CheckedNumeric.h instead. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DOMDataView.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMDataView.cpp b/third_party/WebKit/Source/core/dom/DOMDataView.cpp
index 05e92ab6a2e03d2aec3d057e6a01c4600478145e..f61a6e1deb311a9f6e0ff511967104e80251f70f 100644
--- a/third_party/WebKit/Source/core/dom/DOMDataView.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMDataView.cpp
@@ -6,7 +6,7 @@
#include "bindings/core/v8/DOMDataStore.h"
#include "bindings/core/v8/V8ArrayBuffer.h"
-#include "platform/CheckedInt.h"
+#include "wtf/CheckedNumeric.h"
#include "wtf/typed_arrays/ArrayBufferView.h"
namespace blink {
@@ -17,12 +17,9 @@ class DataView final : public ArrayBufferView {
public:
static PassRefPtr<DataView> create(ArrayBuffer* buffer, unsigned byteOffset, unsigned byteLength)
{
- RELEASE_ASSERT(byteOffset <= buffer->byteLength());
- CheckedInt<uint32_t> checkedOffset(byteOffset);
- CheckedInt<uint32_t> checkedLength(byteLength);
- CheckedInt<uint32_t> checkedMax = checkedOffset + checkedLength;
- RELEASE_ASSERT(checkedMax.isValid());
- RELEASE_ASSERT(checkedMax.value() <= buffer->byteLength());
+ CheckedNumeric<uint32_t> checkedMax = byteOffset;
+ checkedMax += byteLength;
+ RELEASE_ASSERT(checkedMax.ValueOrDie() <= buffer->byteLength());
return adoptRef(new DataView(buffer, byteOffset, byteLength));
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698