diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:25:07 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:25:07 +0000 |
commit | c9567302bad6b2c15bc683c99b698fad5660e6aa (patch) | |
tree | aa5bd4f2ff5677e5145ba48883efb44c9147cb08 /webkit/glue/webcursor_mac.mm | |
parent | 188e615fff61d8b86dabdea3ee56224bd9162649 (diff) | |
download | chromium_src-c9567302bad6b2c15bc683c99b698fad5660e6aa.zip chromium_src-c9567302bad6b2c15bc683c99b698fad5660e6aa.tar.gz chromium_src-c9567302bad6b2c15bc683c99b698fad5660e6aa.tar.bz2 |
Fix custom cursors on Mac. Null and 0 turn out not to be opposites.
I also added an assertion to webcursor_mac.mm that is probably a bit
redundant with the one in AppKit, but this way the assertion is more
visible to someone reading this file.
BUG=16346
TEST=load a page that uses a custom css cursor.
R=pinkerton
Review URL: http://codereview.chromium.org/155320
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webcursor_mac.mm')
-rw-r--r-- | webkit/glue/webcursor_mac.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/glue/webcursor_mac.mm b/webkit/glue/webcursor_mac.mm index 0b06df8..da42479 100644 --- a/webkit/glue/webcursor_mac.mm +++ b/webkit/glue/webcursor_mac.mm @@ -49,6 +49,10 @@ CGImageRef CreateCGImageFromCustomData(const std::vector<char>& custom_data, NSCursor* CreateCustomCursor(const std::vector<char>& custom_data, const gfx::Size& custom_size, const gfx::Point& hotspot) { + // CG throws a cocoa exception if we try to create an empty image, which + // results in an infinite loop. This CHECK ensures that we crash instead. + CHECK(!custom_data.empty()); + scoped_cftyperef<CGImageRef> cg_image( CreateCGImageFromCustomData(custom_data, custom_size)); |