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

Unified Diff: cc/resources/shared_bitmap.h

Issue 221523003: cc: Remove all usage of GetArea() from production code in cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: getarea: 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
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/shared_bitmap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/shared_bitmap.h
diff --git a/cc/resources/shared_bitmap.h b/cc/resources/shared_bitmap.h
index d62ffccaa82911796893590fe602d7c1e1941b7a..762547d5cbe2b66dc4dd5bf5f398840465fccaae 100644
--- a/cc/resources/shared_bitmap.h
+++ b/cc/resources/shared_bitmap.h
@@ -21,7 +21,7 @@ class CC_EXPORT SharedBitmap {
public:
SharedBitmap(base::SharedMemory* memory,
const SharedBitmapId& id,
- const base::Callback<void(SharedBitmap*)>& free_callback);
+ const base::Callback<void(SharedBitmap* bitmap)>& free_callback);
~SharedBitmap();
@@ -40,14 +40,22 @@ class CC_EXPORT SharedBitmap {
SharedBitmapId id() { return id_; }
// Returns true if the size is valid and false otherwise.
- static bool GetSizeInBytes(const gfx::Size& size, size_t* size_in_bytes);
+ static bool SizeInBytes(const gfx::Size& size, size_t* size_in_bytes);
+ // Dies with a CRASH() if the size can not be represented as a positive number
+ // of bytes.
+ static size_t CheckedSizeInBytes(const gfx::Size& size);
+ // Returns the size in bytes but may overflow or return 0. Only do this for
+ // sizes that have already been checked.
+ static size_t UncheckedSizeInBytes(const gfx::Size& size);
+ // Returns true if the size is valid and false otherwise.
+ static bool VerifySizeInBytes(const gfx::Size& size);
static SharedBitmapId GenerateId();
private:
base::SharedMemory* memory_;
SharedBitmapId id_;
- base::Callback<void(SharedBitmap*)> free_callback_;
+ base::Callback<void(SharedBitmap* bitmap)> free_callback_;
DISALLOW_COPY_AND_ASSIGN(SharedBitmap);
};
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/resources/shared_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698