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

Unified Diff: cc/resources/texture_mailbox.h

Issue 220093002: cc: Prevent integer overflow with software TextureMailbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: cc/resources/texture_mailbox.h
diff --git a/cc/resources/texture_mailbox.h b/cc/resources/texture_mailbox.h
index e29004268f4b875eeecfbfee18ad28b336570a27..2bc1fd604e798cfb1be4d5f8af8d4bf7d66509d6 100644
--- a/cc/resources/texture_mailbox.h
+++ b/cc/resources/texture_mailbox.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/memory/shared_memory.h"
+#include "base/numerics/safe_math.h"
#include "cc/base/cc_export.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
#include "ui/gfx/size.h"
@@ -45,7 +46,9 @@ class CC_EXPORT TextureMailbox {
base::SharedMemory* shared_memory() const { return shared_memory_; }
gfx::Size shared_memory_size() const { return shared_memory_size_; }
- size_t shared_memory_size_in_bytes() const;
+
+ size_t SharedMemorySizeInBytes() const;
+ base::CheckedNumeric<size_t> CheckedSharedMemorySizeInBytes() const;
private:
gpu::MailboxHolder mailbox_holder_;

Powered by Google App Engine
This is Rietveld 408576698