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

Unified Diff: ui/gfx/geometry/size.h

Issue 1371753004: ui/gfx: Make gfx::Size::GetArea use checked math. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | ui/gfx/geometry/size.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/size.h
diff --git a/ui/gfx/geometry/size.h b/ui/gfx/geometry/size.h
index 754978672e9054cf482f078872f62fd1bf697aae..27face1d9c7ce4e5840715eff0b92794763f2938 100644
--- a/ui/gfx/geometry/size.h
+++ b/ui/gfx/geometry/size.h
@@ -47,6 +47,7 @@ class GFX_EXPORT Size {
void set_width(int width) { width_ = width < 0 ? 0 : width; }
void set_height(int height) { height_ = height < 0 ? 0 : height; }
+ // This call will CHECK if the area of this size would overflow int.
int GetArea() const;
void SetSize(int width, int height) {
« no previous file with comments | « no previous file | ui/gfx/geometry/size.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698