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

Unified Diff: chrome/common/common_param_traits.cc

Issue 518030: Merge 35371 - Fix up rowbytes vs. width desynchronization, and fix failure to... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 10 years, 12 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/common_param_traits.cc
===================================================================
--- chrome/common/common_param_traits.cc (revision 35475)
+++ chrome/common/common_param_traits.cc (working copy)
@@ -27,24 +27,20 @@
// The height of the bitmap in pixels.
uint32 fHeight;
- // The number of bytes between subsequent rows of the bitmap.
- uint32 fRowBytes;
-
void InitSkBitmapDataForTransfer(const SkBitmap& bitmap) {
fConfig = bitmap.config();
fWidth = bitmap.width();
fHeight = bitmap.height();
- fRowBytes = bitmap.rowBytes();
}
// Returns whether |bitmap| successfully initialized.
bool InitSkBitmapFromData(SkBitmap* bitmap, const char* pixels,
size_t total_pixels) const {
if (total_pixels) {
- bitmap->setConfig(fConfig, fWidth, fHeight, fRowBytes);
+ bitmap->setConfig(fConfig, fWidth, fHeight, 0);
if (!bitmap->allocPixels())
return false;
- if (total_pixels > bitmap->getSize())
+ if (total_pixels != bitmap->getSize())
return false;
memcpy(bitmap->getPixels(), pixels, total_pixels);
}
@@ -205,15 +201,17 @@
ReadParam(m, iter, &icon_count);
if (!result)
return false;
- for (size_t i = 0; i < icon_count && result; ++i) {
+ for (size_t i = 0; i < icon_count; ++i) {
param_type::IconInfo icon_info;
result =
ReadParam(m, iter, &icon_info.url) &&
ReadParam(m, iter, &icon_info.width) &&
ReadParam(m, iter, &icon_info.height);
+ if (!result)
+ return false;
r->icons.push_back(icon_info);
}
- return result;
+ return true;
}
void ParamTraits<webkit_glue::WebApplicationInfo>::Log(
Property changes on: chrome/common/common_param_traits.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698