⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 194064 in webkit


Ignore:
Timestamp:
Dec 14, 2015, 3:07:19 PM (11 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r189942. rdar://problem/23886455

Location:
branches/safari-601-branch/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601-branch/Source/WebCore/ChangeLog

    r194049 r194064  
     12015-12-14  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r189942. rdar://problem/23886455
     4
     5    2015-09-17  Tim Horton  <timothy_horton@apple.com>
     6
     7            Block Objective-C exceptions in DictionaryLookup
     8            https://bugs.webkit.org/show_bug.cgi?id=149256
     9
     10            Reviewed by Anders Carlsson.
     11
     12            * editing/mac/DictionaryLookup.mm:
     13            (WebCore::DictionaryLookup::rangeForSelection):
     14            (WebCore::DictionaryLookup::rangeAtHitTestResult):
     15            (WebCore::expandSelectionByCharacters):
     16            (WebCore::DictionaryLookup::stringForPDFSelection):
     17            (WebCore::showPopupOrCreateAnimationController):
     18            (WebCore::DictionaryLookup::hidePopup):
     19            It is possible for Lookup to throw an exception if one of its
     20            related services dies for some reason. This shouldn't take down
     21            our UI process, so block the exceptions.
     22
    1232015-12-14  Babak Shafiei  <bshafiei@apple.com>
    224
  • branches/safari-601-branch/Source/WebCore/editing/mac/DictionaryLookup.mm

    r183286 r194064  
    2929#if PLATFORM(MAC)
    3030
     31#import "BlockExceptions.h"
    3132#import "Document.h"
    3233#import "FocusController.h"
     
    9899    String fullPlainTextString = plainText(makeRange(paragraphStart, paragraphEnd).get());
    99100
     101    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    100102    // Since we already have the range we want, we just need to grab the returned options.
    101103    if (Class luLookupDefinitionModule = getLULookupDefinitionModuleClass())
    102104        [luLookupDefinitionModule tokenRangeForString:fullPlainTextString range:rangeToPass options:options];
     105    END_BLOCK_OBJC_EXCEPTIONS;
    103106
    104107    return selectedRange.release();
     
    141144        return nullptr;
    142145
     146    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     147
    143148    NSRange rangeToPass = NSMakeRange(TextIterator::rangeLength(makeRange(fullCharacterRange->startPosition(), position).get()), 0);
    144149
     
    154159
    155160    return TextIterator::subrange(fullCharacterRange.get(), extractedRange.location, extractedRange.length);
     161
     162    END_BLOCK_OBJC_EXCEPTIONS;
     163    return nullptr;
    156164}
    157165
    158166static void expandSelectionByCharacters(PDFSelection *selection, NSInteger numberOfCharactersToExpand, NSInteger& charactersAddedBeforeStart, NSInteger& charactersAddedAfterEnd)
    159167{
     168    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     169
    160170    size_t originalLength = selection.string.length;
    161171    [selection extendSelectionAtStart:numberOfCharactersToExpand];
     
    165175    [selection extendSelectionAtEnd:numberOfCharactersToExpand];
    166176    charactersAddedAfterEnd = selection.string.length - originalLength - charactersAddedBeforeStart;
     177
     178    END_BLOCK_OBJC_EXCEPTIONS;
    167179}
    168180
    169181NSString *dictionaryLookupForPDFSelection(PDFSelection *selection, NSDictionary **options)
    170182{
     183    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     184
    171185    // Don't do anything if there is no character at the point.
    172186    if (!selection || !selection.string.length)
     
    200214    ASSERT([selection.string isEqualToString:[fullPlainTextString substringWithRange:extractedRange]]);
    201215    return selection.string;
     216
     217    END_BLOCK_OBJC_EXCEPTIONS;
     218    return nil;
    202219}
    203220
Note: See TracChangeset for help on using the changeset viewer.