diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-16 23:58:27 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-16 23:58:27 +0000 |
commit | b5ab398db97d13c76d332c6567c23a575858f8c4 (patch) | |
tree | 54a5771b49afbb92470d92b82bcac1a78d10f2f8 /app/clipboard | |
parent | 77bd2cefb7f0f8f437b47b3d6a3dd458b8d4fe2e (diff) | |
download | chromium_src-b5ab398db97d13c76d332c6567c23a575858f8c4.zip chromium_src-b5ab398db97d13c76d332c6567c23a575858f8c4.tar.gz chromium_src-b5ab398db97d13c76d332c6567c23a575858f8c4.tar.bz2 |
Make SharedMemory use uint32 instead of size_t. This removes the remaining size_t's from the IPC code.
Review URL: http://codereview.chromium.org/581001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/clipboard')
-rw-r--r-- | app/clipboard/clipboard.cc | 8 | ||||
-rw-r--r-- | app/clipboard/clipboard_unittest.cc | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/clipboard/clipboard.cc b/app/clipboard/clipboard.cc index 54a7d90..9ac742d 100644 --- a/app/clipboard/clipboard.cc +++ b/app/clipboard/clipboard.cc @@ -20,13 +20,13 @@ namespace { // the bitmap data or -1 if the data is invalid. // returns: true if the bitmap size is valid, false otherwise. bool IsBitmapSafe(const Clipboard::ObjectMapParams& params, - size_t* bitmap_bytes) { + uint32* bitmap_bytes) { *bitmap_bytes = -1; if (params[1].size() != sizeof(gfx::Size)) return false; const gfx::Size* size = reinterpret_cast<const gfx::Size*>(&(params[1].front())); - size_t total_size = size->width(); + uint32 total_size = size->width(); // Using INT_MAX not SIZE_T_MAX to put a reasonable bound on things. if (INT_MAX / size->width() <= size->height()) return false; @@ -42,7 +42,7 @@ bool IsBitmapSafe(const Clipboard::ObjectMapParams& params, // Returns true if the clipboard data makes sense and it's safe to access the // bitmap. bool ValidatePlainBitmap(const Clipboard::ObjectMapParams& params) { - size_t bitmap_bytes = -1; + uint32 bitmap_bytes = -1; if (!IsBitmapSafe(params, &bitmap_bytes)) return false; if (bitmap_bytes != params[0].size()) @@ -56,7 +56,7 @@ bool ValidatePlainBitmap(const Clipboard::ObjectMapParams& params) { bool ValidateAndMapSharedBitmap(const Clipboard::ObjectMapParams& params, base::SharedMemory* bitmap_data) { using base::SharedMemory; - size_t bitmap_bytes = -1; + uint32 bitmap_bytes = -1; if (!IsBitmapSafe(params, &bitmap_bytes)) return false; diff --git a/app/clipboard/clipboard_unittest.cc b/app/clipboard/clipboard_unittest.cc index 8a2bd62..034e3a3 100644 --- a/app/clipboard/clipboard_unittest.cc +++ b/app/clipboard/clipboard_unittest.cc @@ -220,7 +220,7 @@ TEST_F(ClipboardTest, SharedBitmapTest) { 0x91E9F63A, 0xC31EA14F, 0x69AB32DF, 0x643A3FD1, }; gfx::Size fake_bitmap_size(3, 4); - size_t bytes = sizeof(fake_bitmap); + uint32 bytes = sizeof(fake_bitmap); // Create shared memory region. base::SharedMemory shared_buf; |