WebKit Bugzilla
Attachment 341531 Details for
Bug 184554
: Implement checked cast for DDResultRef once DDResultGetCFTypeID() is available
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v3
bug-184554-20180529155526.patch (text/plain), 2.45 KB, created by
David Kilzer (:ddkilzer)
on 2018-05-29 15:55:27 PDT
(
hide
)
Description:
Patch v3
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-05-29 15:55:27 PDT
Size:
2.45 KB
patch
obsolete
>Subversion Revision: 232275 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d2339631a072c293b9b9e8fd6aa59e95c5c81dc3..c72d9d894e027a44c815ffe961d245e85c9ac8bb 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-29 David Kilzer <ddkilzer@apple.com> >+ >+ Implement checked cast for DDResultRef once DDResultGetCFTypeID() is available >+ <https://webkit.org/b/184554> >+ <rdar://problem/36241894> >+ >+ Reviewed by Brent Fulgham. >+ >+ * editing/cocoa/DataDetection.mm: >+ (WebCore::detectItemAtPositionWithRange): Implement checked cast >+ for DDResultRef. >+ > 2018-05-23 David Kilzer <ddkilzer@apple.com> > > [iOS] Add assert to catch improper use of WebCore::Timer in UI Process >diff --git a/Source/WebCore/editing/cocoa/DataDetection.mm b/Source/WebCore/editing/cocoa/DataDetection.mm >index f4456169bfd6c685fa929e0b7be6c5ece7fe64e5..ad4955b380ed1ad276d215d20169cbf44c6f5785 100644 >--- a/Source/WebCore/editing/cocoa/DataDetection.mm >+++ b/Source/WebCore/editing/cocoa/DataDetection.mm >@@ -50,10 +50,18 @@ > #import "VisibleUnits.h" > #import <pal/spi/ios/DataDetectorsUISPI.h> > #import <pal/spi/mac/DataDetectorsSPI.h> >+#import <wtf/cf/TypeCastsCF.h> > #import <wtf/text/StringBuilder.h> > > #import "DataDetectorsCoreSoftLink.h" > >+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+template <> >+struct WTF::CFTypeTrait<DDResultRef> { >+ static inline CFTypeID typeID(void) { return DDResultGetCFTypeID(); } >+}; >+#endif >+ > namespace WebCore { > > using namespace HTMLNames; >@@ -78,8 +86,11 @@ static RetainPtr<DDActionContext> detectItemAtPositionWithRange(VisiblePosition > RefPtr<Range> mainResultRange; > CFIndex resultCount = CFArrayGetCount(results.get()); > for (CFIndex i = 0; i < resultCount; i++) { >- // FIXME: <rdar://problem/36241894> Implement checked cast for DDResultRef once DDResultGetTypeID() is available >+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >+ DDResultRef result = checked_cf_cast<DDResultRef>(CFArrayGetValueAtIndex(results.get(), i)); >+#else > DDResultRef result = static_cast<DDResultRef>(const_cast<CF_BRIDGED_TYPE(id) void*>(CFArrayGetValueAtIndex(results.get(), i))); >+#endif > CFRange resultRangeInContext = DDResultGetRange(result); > if (hitLocation >= resultRangeInContext.location && (hitLocation - resultRangeInContext.location) < resultRangeInContext.length) { > mainResult = result;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184554
:
337828
|
341530
| 341531