Changeset 170308 in webkit


Ignore:
Timestamp:
Jun 23, 2014 12:02:23 PM (10 years ago)
Author:
Simon Fraser
Message:

Catch Obj-C exceptions thrown by _linenPatternImage
https://bugs.webkit.org/show_bug.cgi?id=134202

Reviewed by Geoffrey Garen.

Catch Objective-C exceptions thrown by _linenPatternImage and
-[NSImage CGImageForProposedRect:context:hints:].

  • platform/mac/ScrollbarThemeMac.mm:

(WebCore::linenBackgroundColor):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r170307 r170308  
     12014-06-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Catch Obj-C exceptions thrown by _linenPatternImage
     4        https://bugs.webkit.org/show_bug.cgi?id=134202
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Catch Objective-C exceptions thrown by _linenPatternImage and
     9        -[NSImage CGImageForProposedRect:context:hints:].
     10
     11        * platform/mac/ScrollbarThemeMac.mm:
     12        (WebCore::linenBackgroundColor):
     13
    1142014-06-23  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm

    r169124 r170308  
    521521static RetainPtr<CGColorRef> linenBackgroundColor()
    522522{
    523     NSImage *image = [NSColor _linenPatternImage];
    524     CGImageRef cgImage = [image CGImageForProposedRect:NULL context:NULL hints:nil];
     523    NSImage *image = nil;
     524    CGImageRef cgImage = nullptr;
     525    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     526    image = [NSColor _linenPatternImage];
     527    cgImage = [image CGImageForProposedRect:NULL context:NULL hints:nil];
     528    END_BLOCK_OBJC_EXCEPTIONS;
     529   
     530    if (!cgImage)
     531        return nullptr;
    525532
    526533    RetainPtr<CGPatternRef> pattern = adoptCF(wkCGPatternCreateWithImageAndTransform(cgImage, CGAffineTransformIdentity, wkPatternTilingNoDistortion));
Note: See TracChangeset for help on using the changeset viewer.