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

Unified Diff: webkit/glue/webcursor.cc

Issue 5686001: Ensure that custom cursors set by windowless flash plugins get marshaled corr... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | webkit/glue/webcursor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webcursor.cc
===================================================================
--- webkit/glue/webcursor.cc (revision 68604)
+++ webkit/glue/webcursor.cc (working copy)
@@ -89,26 +89,27 @@
size_y > kMaxCursorDimension)
return false;
- if (type == WebCursorInfo::TypeCustom && (size_x == 0 || size_y == 0))
- return false;
+ if (type == WebCursorInfo::TypeCustom) {
+ type_ = type;
+ if (size_x > 0 && size_y > 0) {
+ // The * 4 is because the expected format is an array of RGBA pixel
+ // values.
+ if (size_x * size_y * 4 > data_len)
+ return false;
- // The * 4 is because the expected format is an array of RGBA pixel values.
- if (size_x * size_y * 4 > data_len)
- return false;
+ hotspot_.set_x(hotspot_x);
+ hotspot_.set_y(hotspot_y);
+ custom_size_.set_width(size_x);
+ custom_size_.set_height(size_y);
+ ClampHotspot();
- type_ = type;
- hotspot_.set_x(hotspot_x);
- hotspot_.set_y(hotspot_y);
- custom_size_.set_width(size_x);
- custom_size_.set_height(size_y);
- ClampHotspot();
-
- custom_data_.clear();
- if (data_len > 0) {
- custom_data_.resize(data_len);
- memcpy(&custom_data_[0], data, data_len);
+ custom_data_.clear();
+ if (data_len > 0) {
+ custom_data_.resize(data_len);
+ memcpy(&custom_data_[0], data, data_len);
+ }
+ }
}
-
return DeserializePlatformData(pickle, iter);
}
« no previous file with comments | « no previous file | webkit/glue/webcursor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698