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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.cpp

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
Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index 7761a918c9f1a013da669214ce55aa0ec69f0449..8e2c9bd2964f75c130dd2e0565b70a89f7861510 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -36,7 +36,6 @@
#include "platform/TraceEvent.h"
#include "platform/graphics/BitmapImage.h"
#include "public/platform/Platform.h"
-#include "wtf/CheckedNumeric.h"
#include "wtf/CurrentTime.h"
#include "wtf/StdLibExtras.h"
@@ -382,9 +381,9 @@
if (!image || image != m_image)
return;
- CheckedNumeric<intptr_t> signedDecodedSize(decodedSize());
- signedDecodedSize += delta;
- setDecodedSize(safeCast<size_t>(signedDecodedSize.ValueOrDie()));
+ // TODO(bsep): Crash on underflow, which is possible if an error causes
+ // decodedSize to be 0.
+ setDecodedSize(decodedSize() + delta);
}
void ImageResource::didDraw(const blink::Image* image)
« no previous file with comments | « third_party/WebKit/Source/core/dom/CharacterData.cpp ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698