WebKit Bugzilla
Attachment 341876 Details for
Bug 186245
: [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186245-20180603163725.patch (text/plain), 88.12 KB, created by
Darin Adler
on 2018-06-03 16:37:26 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-06-03 16:37:26 PDT
Size:
88.12 KB
patch
obsolete
>Subversion Revision: 232456 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 64b0f12a6de55cb72ed70ddca1a2e5dbed50fad5..e9547b3207bb655eaf6c284068a774e283d71a72 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,205 @@ >+2018-06-03 Darin Adler <darin@apple.com> >+ >+ [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption >+ https://bugs.webkit.org/show_bug.cgi?id=186245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: >+ (convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't >+ make method calls on WebAccessibilityObjectWrapper, a forward-declared class. >+ (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease >+ for the CGPathRef return value instead of Objective-C autorelease. Another option >+ would be to use RetainPtr for the return type instead. >+ >+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: >+ (AXObjectIsTextMarker): Use __bridge for bridging typecast. >+ (AXObjectIsTextMarkerRange): Ditto. >+ (AXTextMarkerRange): Ditto. >+ (AXTextMarkerRangeStart): Ditto. >+ (AXTextMarkerRangeEnd): Ditto. >+ (isTextMarkerIgnored): Ditto. >+ (accessibilityObjectForTextMarker): Ditto. >+ (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto. >+ (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto. >+ (visiblePositionForStartOfTextMarkerRange): Ditto. >+ (visiblePositionForEndOfTextMarkerRange): Ditto. >+ (AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary >+ and @() to make NSNumber. >+ (AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging >+ code so that the typecasts are on function arguments, not local variables, >+ which makes lifetimes clearer. >+ (AXAttributeStringSetElement): Use __bridge for bridging typecast. >+ (WebTransformCGPathToNSBezierPath): >+ (-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging >+ typecast when passing an NSBezierPath through as a void* context argument; >+ silent conversion to void* is not compatible with ARC. >+ (createAccessibilityRoleMap): Use __unsafe_unretained for a table of >+ NSString constants. >+ >+ * bindings/js/ScriptControllerMac.mm: >+ (WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge >+ for bridging typecast. >+ >+ * bridge/objc/objc_class.mm: >+ (JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts >+ to convert a Class into a CFTypeRef. >+ (JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging >+ typecast. >+ (JSC::Bindings::ObjcClass::fieldNamed const): Ditto. >+ * bridge/objc/objc_instance.mm: >+ (ObjcInstance::invokeObjcMethod): Ditto. >+ * bridge/objc/objc_runtime.mm: >+ (JSC::Bindings::ObjcField::valueFromInstance const): Ditto. >+ (JSC::Bindings::ObjcField::setValueToInstance const): Ditto. >+ * bridge/objc/objc_utility.mm: >+ (JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const >+ to make it clearer to the compiler that the code is correct. >+ * crypto/mac/SerializedCryptoKeyWrapMac.mm: >+ (WebCore::createAndStoreMasterKey): Ditto. >+ (WebCore::findMasterKey): Ditto. >+ * editing/cocoa/DataDetection.mm: >+ (WebCore::detectItemAtPositionWithRange): Ditto. >+ * editing/cocoa/EditorCocoa.mm: >+ (WebCore::Editor::fontAttributesForSelectionStart const): Ditto. >+ * editing/cocoa/HTMLConverter.mm: >+ (_font): Ditto. >+ (fileWrapperForElement): Ditto. >+ * fileapi/FileCocoa.mm: >+ (WebCore::File::shouldReplaceFile): Ditto. >+ * loader/archive/cf/LegacyWebArchiveMac.mm: >+ (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto. >+ * page/mac/TextIndicatorWindow.mm: >+ (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto. >+ (createContentCrossfadeAnimation): Ditto. >+ * platform/cocoa/LocalizedStringsCocoa.mm: >+ (WebCore::localizedString): Ditto. >+ * platform/cocoa/SharedBufferCocoa.mm: >+ (WebCore::SharedBuffer::create): Ditto. >+ (WebCore::SharedBuffer::append): Ditto. >+ * platform/graphics/FontPlatformData.h: >+ (WebCore::toCTFont): Ditto. >+ (WebCore::toNSFont): Ditto. >+ * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: >+ (WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto. >+ * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: >+ (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto. >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: >+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto. >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: >+ (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto. >+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: >+ (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto. >+ (WebCore::bufferWasConsumedCallback): Ditto. >+ (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto. >+ * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: >+ (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto. >+ (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto. >+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: >+ (PlatformCALayerCocoa::create): Ditto. >+ (PlatformCALayer::platformCALayer): Ditto. >+ (PlatformCALayerCocoa::superlayer const): Ditto. >+ (PlatformCALayerCocoa::contents const): Ditto. >+ (PlatformCALayerCocoa::setContents): Ditto. >+ * platform/graphics/cocoa/IOSurface.h: Ditto. >+ * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: >+ (TextTrackRepresentationCocoa::update): Ditto. >+ * platform/graphics/cocoa/WebCoreDecompressionSession.mm: >+ (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto. >+ (WebCore::WebCoreDecompressionSession::resetQosTier): Ditto. >+ * platform/graphics/cocoa/WebGLLayer.mm: >+ (-[WebGLLayer display]): Ditto. >+ * platform/graphics/mac/ImageMac.mm: >+ (WebCore::BitmapImage::nsImage): Ditto. >+ (WebCore::BitmapImage::snapshotNSImage): Ditto. >+ * platform/graphics/mac/WebLayer.mm: >+ (-[WebLayer drawInContext:]): Ditto. >+ (-[WebSimpleLayer setNeedsDisplay]): Ditto. >+ (-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto. >+ (-[WebSimpleLayer display]): Ditto. >+ (-[WebSimpleLayer drawInContext:]): Ditto. >+ >+ * platform/mac/CursorMac.mm: >+ (WebCore::cursor): Mark pointer __strong to match the globals it points to. >+ >+ * platform/mac/FileSystemMac.mm: >+ (WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease. >+ >+ * platform/mac/PlatformPasteboardMac.mm: >+ (WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging >+ typecast. >+ * platform/mac/PlatformSpeechSynthesizerMac.mm: >+ (WebCore::speechSynthesisGetVoiceIdentifiers): Ditto. >+ (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto. >+ >+ * platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain >+ and release for NSDictionary and NSSet. >+ * platform/mac/PluginBlacklist.mm: >+ (WebCore::PluginBlacklist::create): Use __bridge for bridging typecast. >+ (WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls. >+ (WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove >+ explciit CFRetain/release pairs. >+ >+ * platform/mac/PublicSuffixMac.mm: >+ (WebCore::isPublicSuffix): Use __bridge for bridging typecast. >+ * platform/mac/RemoteCommandListenerMac.mm: >+ (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto. >+ * platform/mac/SerializedPlatformRepresentationMac.mm: >+ (WebCore::jsValueWithDictionaryInContext): Ditto. >+ * platform/mac/URLMac.mm: >+ (WebCore::URL::URL): Ditto. >+ (WebCore::URL::createCFURL const): Ditto. >+ >+ * platform/mac/WebCoreNSURLExtras.mm: >+ (WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the >+ local variable it eventually points to. >+ (WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast. >+ (WebCore::URLByTruncatingOneCharacterBeforeComponent): Use >+ CFBridgingRelease instead of autorelease, reducing typecasts. >+ (WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto. >+ (WebCore::userVisibleString): Use __bridge for bridging typecast. >+ (WebCore::isUserVisibleURL): Ditto. >+ >+ * platform/mac/WebGLBlacklist.mm: >+ (WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast. >+ * platform/mediastream/mac/AVVideoCaptureSource.mm: >+ (WebCore::AVVideoCaptureSource::setPreset): Ditto. >+ (WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @() >+ instead of NSNumber. >+ * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: >+ (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto. >+ * platform/network/cocoa/ResourceRequestCocoa.mm: >+ (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto. >+ >+ * platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and >+ CFSTR for constant string array commonHeaderFields rather than using >+ NSString * and then relying on implicit bridging conversion. >+ >+ * platform/network/mac/CertificateInfoMac.mm: >+ (WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast. >+ * platform/network/mac/FormDataStreamMac.mm: >+ (WebCore::createHTTPBodyNSInputStream): Ditto. >+ (WebCore::httpBodyFromStream): Ditto. >+ * platform/network/mac/ResourceErrorMac.mm: >+ (WebCore::ResourceError::ResourceError): Ditto. >+ (WebCore::ResourceError::cfError const): Ditto. >+ >+ * rendering/RenderThemeMac.mm: >+ (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]): >+ Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef. >+ (WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast. >+ (WebCore::AttachmentLayout::layOutSubtitle): Ditto. >+ >+ * testing/cocoa/WebArchiveDumpSupport.mm: >+ (WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for >+ bridging typecast. >+ (WebCoreTestSupport::supportedNonImageMIMETypes): Deleted. >+ (WebCoreTestSupport::convertWebResourceDataToString): Use the >+ MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of >+ building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes >+ and using CFArrayContainsValue. This is both much more direct and much more >+ efficient as well. >+ > 2018-06-03 Michael Catanzaro <mcatanzaro@igalia.com> > > REGRESSION(r232338): [GTK] Broke a few layout tests >diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm >index 8b45f0dbaa72ce0bcded214d334b8d5d01672a33..d544d422beff66b9d40277a76e926f75fb9c089f 100644 >--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm >+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm >@@ -245,16 +245,15 @@ static NSArray *convertMathPairsToNSArray(const AccessibilityObject::Accessibili > return array; > } > >- > NSArray *convertToNSArray(const AccessibilityObject::AccessibilityChildrenVector& vector) > { > NSMutableArray *array = [NSMutableArray arrayWithCapacity:vector.size()]; > for (const auto& child : vector) { >- WebAccessibilityObjectWrapper* wrapper = child->wrapper(); >+ auto wrapper = (WebAccessibilityObjectWrapperBase *)child->wrapper(); > ASSERT(wrapper); > if (wrapper) { >- // we want to return the attachment view instead of the object representing the attachment. >- // otherwise, we get palindrome errors in the AX hierarchy >+ // We want to return the attachment view instead of the object representing the attachment, >+ // otherwise, we get palindrome errors in the AX hierarchy. > if (child->isAttachment() && [wrapper attachmentView]) > [array addObject:[wrapper attachmentView]]; > else >@@ -503,7 +502,8 @@ - (CGPathRef)convertPathToScreenSpace:(Path &)path > path.apply([&conversion](const PathElement& pathElement) { > convertPathToScreenSpaceFunction(conversion, pathElement); > }); >- return (CGPathRef)[(id)conversion.path autorelease]; >+ CFAutorelease(conversion.path); >+ return conversion.path; > } > > - (CGPoint)convertPointToScreenSpace:(FloatPoint &)point >diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >index d1a2095a2faef8c24290cd9cc42e9ac967e43097..820fb763e29c566d5d3990a1dd46f620d831fdbf 100644 >--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >@@ -442,36 +442,36 @@ - (id)attachmentView > > #pragma mark SystemInterface wrappers > >-static inline BOOL AXObjectIsTextMarker(id obj) >+static inline BOOL AXObjectIsTextMarker(id object) > { >- return obj != nil && CFGetTypeID(obj) == AXTextMarkerGetTypeID(); >+ return object && CFGetTypeID((__bridge CFTypeRef)object) == AXTextMarkerGetTypeID(); > } > >-static inline BOOL AXObjectIsTextMarkerRange(id obj) >+static inline BOOL AXObjectIsTextMarkerRange(id object) > { >- return obj != nil && CFGetTypeID(obj) == AXTextMarkerRangeGetTypeID(); >+ return object && CFGetTypeID((__bridge CFTypeRef)object) == AXTextMarkerRangeGetTypeID(); > } > > static id AXTextMarkerRange(id startMarker, id endMarker) > { > ASSERT(startMarker != nil); > ASSERT(endMarker != nil); >- ASSERT(CFGetTypeID(startMarker) == AXTextMarkerGetTypeID()); >- ASSERT(CFGetTypeID(endMarker) == AXTextMarkerGetTypeID()); >+ ASSERT(CFGetTypeID((__bridge CFTypeRef)startMarker) == AXTextMarkerGetTypeID()); >+ ASSERT(CFGetTypeID((__bridge CFTypeRef)endMarker) == AXTextMarkerGetTypeID()); > return CFBridgingRelease(AXTextMarkerRangeCreate(kCFAllocatorDefault, (AXTextMarkerRef)startMarker, (AXTextMarkerRef)endMarker)); > } > > static id AXTextMarkerRangeStart(id range) > { > ASSERT(range != nil); >- ASSERT(CFGetTypeID(range) == AXTextMarkerRangeGetTypeID()); >+ ASSERT(CFGetTypeID((__bridge CFTypeRef)range) == AXTextMarkerRangeGetTypeID()); > return CFBridgingRelease(AXTextMarkerRangeCopyStartMarker((AXTextMarkerRangeRef)range)); > } > > static id AXTextMarkerRangeEnd(id range) > { > ASSERT(range != nil); >- ASSERT(CFGetTypeID(range) == AXTextMarkerRangeGetTypeID()); >+ ASSERT(CFGetTypeID((__bridge CFTypeRef)range) == AXTextMarkerRangeGetTypeID()); > return CFBridgingRelease(AXTextMarkerRangeCopyEndMarker((AXTextMarkerRangeRef)range)); > } > >@@ -565,7 +565,7 @@ static bool isTextMarkerIgnored(id textMarker) > return false; > > TextMarkerData textMarkerData; >- if (!getBytesFromAXTextMarker(textMarker, &textMarkerData, sizeof(textMarkerData))) >+ if (!getBytesFromAXTextMarker((__bridge CFTypeRef)textMarker, &textMarkerData, sizeof(textMarkerData))) > return false; > > return textMarkerData.ignored; >@@ -582,7 +582,7 @@ static AccessibilityObject* accessibilityObjectForTextMarker(AXObjectCache* cach > return nullptr; > > TextMarkerData textMarkerData; >- if (!getBytesFromAXTextMarker(textMarker, &textMarkerData, sizeof(textMarkerData))) >+ if (!getBytesFromAXTextMarker((__bridge CFTypeRef)textMarker, &textMarkerData, sizeof(textMarkerData))) > return nullptr; > return cache->accessibilityObjectForTextMarkerData(textMarkerData); > } >@@ -703,7 +703,7 @@ static CharacterOffset characterOffsetForTextMarker(AXObjectCache* cache, CFType > > - (CharacterOffset)characterOffsetForTextMarker:(id)textMarker > { >- return characterOffsetForTextMarker(m_object->axObjectCache(), textMarker); >+ return characterOffsetForTextMarker(m_object->axObjectCache(), (__bridge CFTypeRef)textMarker); > } > > static id textMarkerForVisiblePosition(AXObjectCache* cache, const VisiblePosition& visiblePos) >@@ -750,17 +750,17 @@ static VisiblePosition visiblePositionForTextMarker(AXObjectCache* cache, CFType > > - (VisiblePosition)visiblePositionForTextMarker:(id)textMarker > { >- return visiblePositionForTextMarker(m_object->axObjectCache(), textMarker); >+ return visiblePositionForTextMarker(m_object->axObjectCache(), (__bridge CFTypeRef)textMarker); > } > > static VisiblePosition visiblePositionForStartOfTextMarkerRange(AXObjectCache* cache, id textMarkerRange) > { >- return visiblePositionForTextMarker(cache, AXTextMarkerRangeStart(textMarkerRange)); >+ return visiblePositionForTextMarker(cache, (__bridge CFTypeRef)AXTextMarkerRangeStart(textMarkerRange)); > } > > static VisiblePosition visiblePositionForEndOfTextMarkerRange(AXObjectCache* cache, id textMarkerRange) > { >- return visiblePositionForTextMarker(cache, AXTextMarkerRangeEnd(textMarkerRange)); >+ return visiblePositionForTextMarker(cache, (__bridge CFTypeRef)AXTextMarkerRangeEnd(textMarkerRange)); > } > > static id textMarkerRangeFromMarkers(id textMarker1, id textMarker2) >@@ -784,14 +784,13 @@ static void AXAttributeStringSetFont(NSMutableAttributedString *attrString, NSSt > return; > > if (font) { >- NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: >- static_cast<NSString *>(adoptCF(CTFontCopyPostScriptName(font)).get()), NSAccessibilityFontNameKey, >- static_cast<NSString *>(adoptCF(CTFontCopyFamilyName(font)).get()), NSAccessibilityFontFamilyKey, >- static_cast<NSString *>(adoptCF(CTFontCopyDisplayName(font)).get()), NSAccessibilityVisibleNameKey, >- [NSNumber numberWithFloat:CTFontGetSize(font)], NSAccessibilityFontSizeKey, >- nil]; >- >- [attrString addAttribute:attribute value:dict range:range]; >+ NSDictionary *dictionary = @{ >+ (__bridge NSString *)adoptCF(CTFontCopyPostScriptName(font)).get(): NSAccessibilityFontNameKey, >+ (__bridge NSString *)adoptCF(CTFontCopyFamilyName(font)).get(): NSAccessibilityFontFamilyKey, >+ (__bridge NSString *)adoptCF(CTFontCopyDisplayName(font)).get(): NSAccessibilityVisibleNameKey, >+ @(CTFontGetSize(font)): NSAccessibilityFontSizeKey, >+ }; >+ [attrString addAttribute:attribute value:dictionary range:range]; > } else > [attrString removeAttribute:attribute range:range]; > >@@ -804,9 +803,9 @@ static void AXAttributeStringSetColor(NSMutableAttributedString* attrString, NSS > > if (color) { > CGColorRef cgColor = color.CGColor; >- CGColorRef existingColor = (CGColorRef)[attrString attribute:attribute atIndex:range.location effectiveRange:nil]; >- if (!existingColor || !CGColorEqualToColor(existingColor, cgColor)) >- [attrString addAttribute:attribute value:(id)cgColor range:range]; >+ id existingColor = [attrString attribute:attribute atIndex:range.location effectiveRange:nil]; >+ if (!existingColor || !CGColorEqualToColor((__bridge CGColorRef)existingColor, cgColor)) >+ [attrString addAttribute:attribute value:(__bridge id)cgColor range:range]; > } else > [attrString removeAttribute:attribute range:range]; > } >@@ -997,7 +996,7 @@ static void AXAttributeStringSetElement(NSMutableAttributedString* attrString, N > > AXUIElementRef axElement = NSAccessibilityCreateAXUIElementRef(objectWrapper); > if (axElement) { >- [attrString addAttribute:attribute value:(id)axElement range:range]; >+ [attrString addAttribute:attribute value:(__bridge id)axElement range:range]; > CFRelease(axElement); > } > } else >@@ -1789,9 +1788,9 @@ - (CGPoint)convertPointToScreenSpace:(FloatPoint &)point > } > } > >-static void WebTransformCGPathToNSBezierPath(void *info, const CGPathElement *element) >+static void WebTransformCGPathToNSBezierPath(void* info, const CGPathElement *element) > { >- NSBezierPath *bezierPath = (NSBezierPath *)info; >+ NSBezierPath *bezierPath = (__bridge NSBezierPath *)info; > switch (element->type) { > case kCGPathElementMoveToPoint: > [bezierPath moveToPoint:NSPointFromCGPoint(element->points[0])]; >@@ -1813,7 +1812,7 @@ static void WebTransformCGPathToNSBezierPath(void *info, const CGPathElement *el > - (NSBezierPath *)bezierPathFromPath:(CGPathRef)path > { > NSBezierPath *bezierPath = [NSBezierPath bezierPath]; >- CGPathApply(path, bezierPath, WebTransformCGPathToNSBezierPath); >+ CGPathApply(path, (__bridge void*)bezierPath, WebTransformCGPathToNSBezierPath); > return bezierPath; > } > >@@ -1851,7 +1850,7 @@ static const AccessibilityRoleMap& createAccessibilityRoleMap() > { > struct RoleEntry { > AccessibilityRole value; >- NSString* string; >+ __unsafe_unretained NSString *string; > }; > > static const RoleEntry roles[] = { >diff --git a/Source/WebCore/bindings/js/ScriptControllerMac.mm b/Source/WebCore/bindings/js/ScriptControllerMac.mm >index de7938e9f6a5c2bc0914ef0f2ba9a79d2da2931b..ca4f87189cc2951996c89d138c3566a31c0cc249 100644 >--- a/Source/WebCore/bindings/js/ScriptControllerMac.mm >+++ b/Source/WebCore/bindings/js/ScriptControllerMac.mm >@@ -66,7 +66,7 @@ RefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget( > if (!widgetView) > return nullptr; > >- auto rootObject = createRootObject(widgetView); >+ auto rootObject = createRootObject((__bridge void*)widgetView); > > if ([widgetView respondsToSelector:@selector(createPluginBindingsInstance:)]) > return [widgetView createPluginBindingsInstance:WTFMove(rootObject)]; >diff --git a/Source/WebCore/bridge/objc/objc_class.mm b/Source/WebCore/bridge/objc/objc_class.mm >index 4ee4650c9815a231c983669d743041ee5d60ec6e..dd9216a796d1162c50ce49e223a4cab7e01ce679 100644 >--- a/Source/WebCore/bridge/objc/objc_class.mm >+++ b/Source/WebCore/bridge/objc/objc_class.mm >@@ -50,10 +50,10 @@ ObjcClass* ObjcClass::classForIsA(ClassStructPtr isa) > { > _createClassesByIsAIfNecessary(); > >- ObjcClass* aClass = reinterpret_cast<ObjcClass*>(const_cast<void*>(CFDictionaryGetValue(classesByIsA, isa))); >+ ObjcClass* aClass = reinterpret_cast<ObjcClass*>(const_cast<void*>(CFDictionaryGetValue(classesByIsA, (__bridge CFTypeRef)isa))); > if (!aClass) { > aClass = new ObjcClass(isa); >- CFDictionaryAddValue(classesByIsA, isa, aClass); >+ CFDictionaryAddValue(classesByIsA, (__bridge CFTypeRef)isa, aClass); > } > > return aClass; >@@ -133,7 +133,7 @@ Method* ObjcClass::methodNamed(PropertyName propertyName, Instance*) const > if ([thisClass respondsToSelector:@selector(webScriptNameForSelector:)]) > mappedName = [thisClass webScriptNameForSelector:objcMethodSelector]; > >- if ((mappedName && [mappedName isEqual:(NSString*)methodName.get()]) || strcmp(objcMethodSelectorName, buffer.data()) == 0) { >+ if ((mappedName && [mappedName isEqual:(__bridge NSString*)methodName.get()]) || strcmp(objcMethodSelectorName, buffer.data()) == 0) { > auto method = std::make_unique<ObjcMethod>(thisClass, objcMethodSelector); > methodPtr = method.get(); > m_methodCache.add(name.impl(), WTFMove(method)); >@@ -189,8 +189,8 @@ Field* ObjcClass::fieldNamed(PropertyName propertyName, Instance* instance) cons > if ([thisClass respondsToSelector:@selector(webScriptNameForKey:)]) > mappedName = [thisClass webScriptNameForKey:UTF8KeyName]; > >- if ((mappedName && [mappedName isEqual:(NSString*)fieldName.get()]) || [keyName isEqual:(NSString*)fieldName.get()]) { >- auto newField = std::make_unique<ObjcField>((CFStringRef)keyName); >+ if ((mappedName && [mappedName isEqual:(__bridge NSString *)fieldName.get()]) || [keyName isEqual:(__bridge NSString *)fieldName.get()]) { >+ auto newField = std::make_unique<ObjcField>((__bridge CFStringRef)keyName); > field = newField.get(); > m_fieldCache.add(name.impl(), WTFMove(newField)); > break; >@@ -220,7 +220,7 @@ Field* ObjcClass::fieldNamed(PropertyName propertyName, Instance* instance) cons > if ([thisClass respondsToSelector:@selector(webScriptNameForKey:)]) > mappedName = [thisClass webScriptNameForKey:objcIvarName]; > >- if ((mappedName && [mappedName isEqual:(NSString*)fieldName.get()]) || strcmp(objcIvarName, jsName.data()) == 0) { >+ if ((mappedName && [mappedName isEqual:(__bridge NSString *)fieldName.get()]) || strcmp(objcIvarName, jsName.data()) == 0) { > auto newField = std::make_unique<ObjcField>(objcIVar); > field = newField.get(); > m_fieldCache.add(name.impl(), WTFMove(newField)); >diff --git a/Source/WebCore/bridge/objc/objc_instance.mm b/Source/WebCore/bridge/objc/objc_instance.mm >index d8fab76570a7dad61aa8ec9bf5df4ca6fa5bdffd..68e57312dac0a7aa943583c89818e8e8a36f0317 100644 >--- a/Source/WebCore/bridge/objc/objc_instance.mm >+++ b/Source/WebCore/bridge/objc/objc_instance.mm >@@ -241,7 +241,7 @@ @try { > > // Invoke invokeUndefinedMethodFromWebScript:withArguments:, pass JavaScript function > // name as first (actually at 2) argument and array of args as second. >- NSString* jsName = (NSString* )method->javaScriptName(); >+ NSString* jsName = (__bridge NSString *)method->javaScriptName(); > [invocation setArgument:&jsName atIndex:2]; > > NSMutableArray* objcArgs = [NSMutableArray array]; >diff --git a/Source/WebCore/bridge/objc/objc_runtime.mm b/Source/WebCore/bridge/objc/objc_runtime.mm >index 163c1da63a98b3d198eb0a1759a1902de37f5ab5..87d0387a69a7537d2f9ed6bd6c5322b472501f1e 100644 >--- a/Source/WebCore/bridge/objc/objc_runtime.mm >+++ b/Source/WebCore/bridge/objc/objc_runtime.mm >@@ -104,7 +104,7 @@ JSValue ObjcField::valueFromInstance(ExecState* exec, const Instance* instance) > JSLock::DropAllLocks dropAllLocks(exec); // Can't put this inside the @try scope because it unwinds incorrectly. > > @try { >- if (id objcValue = [targetObject valueForKey:(NSString *)_name.get()]) >+ if (id objcValue = [targetObject valueForKey:(__bridge NSString *)_name.get()]) > result = convertObjcValueToValue(exec, &objcValue, ObjcObjectType, instance->rootObject()); > { > JSLockHolder lock(exec); >@@ -139,7 +139,7 @@ bool ObjcField::setValueToInstance(ExecState* exec, const Instance* instance, JS > JSLock::DropAllLocks dropAllLocks(exec); // Can't put this inside the @try scope because it unwinds incorrectly. > > @try { >- [targetObject setValue:value forKey:(NSString *)_name.get()]; >+ [targetObject setValue:value forKey:(__bridge NSString *)_name.get()]; > { > JSLockHolder lock(exec); > ObjcInstance::moveGlobalExceptionToExecState(exec); >diff --git a/Source/WebCore/bridge/objc/objc_utility.mm b/Source/WebCore/bridge/objc/objc_utility.mm >index 7c5d7998eedfe47af7c0b7bd9413490c0a11b625..12d052d224894c3c7bbc9a67f275bbe68d348ce6 100644 >--- a/Source/WebCore/bridge/objc/objc_utility.mm >+++ b/Source/WebCore/bridge/objc/objc_utility.mm >@@ -180,14 +180,14 @@ JSValue convertObjcValueToValue(ExecState* exec, void* buffer, ObjcValueType typ > > switch (type) { > case ObjcObjectType: { >- id obj = *(id*)buffer; >+ id obj = *(const id*)buffer; > if ([obj isKindOfClass:[NSString class]]) > return convertNSStringToString(exec, (NSString *)obj); > if ([obj isKindOfClass:webUndefinedClass()]) > return jsUndefined(); >- if ((CFBooleanRef)obj == kCFBooleanTrue) >+ if ((__bridge CFBooleanRef)obj == kCFBooleanTrue) > return jsBoolean(true); >- if ((CFBooleanRef)obj == kCFBooleanFalse) >+ if ((__bridge CFBooleanRef)obj == kCFBooleanFalse) > return jsBoolean(false); > if ([obj isKindOfClass:[NSNumber class]]) > return jsNumber([obj doubleValue]); >diff --git a/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm b/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm >index 17caee3f3e144d6496897ca0997ecd59f3bc97c1..a517f922e048d14177c4f6f8c436231308814969 100644 >--- a/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm >+++ b/Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm >@@ -103,7 +103,7 @@ static bool createAndStoreMasterKey(Vector<uint8_t>& masterKeyData) > > #if USE(KEYCHAIN_ACCESS_CONTROL_LISTS) > SecAccessRef accessRef; >- status = SecAccessCreate((CFStringRef)localizedItemName, nullptr, &accessRef); >+ status = SecAccessCreate((__bridge CFStringRef)localizedItemName, nullptr, &accessRef); > if (status) { > WTFLogAlways("Cannot create a security access object for storing WebCrypto master key, error %d", (int)status); > return false; >@@ -121,7 +121,7 @@ static bool createAndStoreMasterKey(Vector<uint8_t>& masterKeyData) > } > RetainPtr<SecTrustedApplicationRef> trustedApp = adoptCF(trustedAppRef); > >- status = SecACLSetContents(acl, (CFArrayRef)@[ (id)trustedApp.get() ], (CFStringRef)localizedItemName, kSecKeychainPromptRequirePassphase); >+ status = SecACLSetContents(acl, (__bridge CFArrayRef)@[ (__bridge id)trustedApp.get() ], (__bridge CFStringRef)localizedItemName, kSecKeychainPromptRequirePassphase); > if (status) { > WTFLogAlways("Cannot set ACL for WebCrypto master key, error %d", (int)status); > return false; >@@ -136,7 +136,7 @@ static bool createAndStoreMasterKey(Vector<uint8_t>& masterKeyData) > (id)kSecClass : (id)kSecClassGenericPassword, > (id)kSecAttrSynchronizable : @NO, > #if USE(KEYCHAIN_ACCESS_CONTROL_LISTS) >- (id)kSecAttrAccess : (id)access.get(), >+ (id)kSecAttrAccess : (__bridge id)access.get(), > #endif > (id)kSecAttrComment : webCryptoMasterKeyKeychainComment(), > (id)kSecAttrLabel : localizedItemName, >@@ -171,7 +171,7 @@ static bool findMasterKey(Vector<uint8_t>& masterKeyData) > } > RetainPtr<CFDataRef> keyData = adoptCF(keyDataRef); > >- Vector<uint8_t> base64EncodedMasterKeyData = vectorFromNSData((NSData *)keyData.get()); >+ Vector<uint8_t> base64EncodedMasterKeyData = vectorFromNSData((__bridge NSData *)keyData.get()); > return base64Decode((const char*)base64EncodedMasterKeyData.data(), base64EncodedMasterKeyData.size(), masterKeyData); > } > >diff --git a/Source/WebCore/editing/cocoa/DataDetection.mm b/Source/WebCore/editing/cocoa/DataDetection.mm >index ad4955b380ed1ad276d215d20169cbf44c6f5785..4e87535976a00efdeaab21cb370524d75624e2bd 100644 >--- a/Source/WebCore/editing/cocoa/DataDetection.mm >+++ b/Source/WebCore/editing/cocoa/DataDetection.mm >@@ -103,7 +103,7 @@ static RetainPtr<DDActionContext> detectItemAtPositionWithRange(VisiblePosition > return nullptr; > > RetainPtr<DDActionContext> actionContext = adoptNS([allocDDActionContextInstance() init]); >- [actionContext setAllResults:@[ (id)mainResult ]]; >+ [actionContext setAllResults:@[ (__bridge id)mainResult ]]; > [actionContext setMainResult:mainResult]; > > Vector<FloatQuad> quads; >diff --git a/Source/WebCore/editing/cocoa/EditorCocoa.mm b/Source/WebCore/editing/cocoa/EditorCocoa.mm >index 31d7b2ec298451a92b8fe7aa8bc5d2255942ca92..063d7231aac15016d38b9a24eb43b886637535d2 100644 >--- a/Source/WebCore/editing/cocoa/EditorCocoa.mm >+++ b/Source/WebCore/editing/cocoa/EditorCocoa.mm >@@ -89,7 +89,7 @@ RetainPtr<NSDictionary> Editor::fontAttributesForSelectionStart() const > RetainPtr<NSMutableDictionary> attributes = adoptNS([[NSMutableDictionary alloc] init]); > > if (auto ctFont = style->fontCascade().primaryFont().getCTFont()) >- [attributes setObject:(id)ctFont forKey:NSFontAttributeName]; >+ [attributes setObject:(__bridge id)ctFont forKey:NSFontAttributeName]; > > // FIXME: Why would we not want to retrieve these attributes on iOS? > #if PLATFORM(MAC) >diff --git a/Source/WebCore/editing/cocoa/HTMLConverter.mm b/Source/WebCore/editing/cocoa/HTMLConverter.mm >index 9f3efa0a6b23efd6c131499101d3e344b99c05ad..214465287d13e521f8bb5120c31ab19630f70749 100644 >--- a/Source/WebCore/editing/cocoa/HTMLConverter.mm >+++ b/Source/WebCore/editing/cocoa/HTMLConverter.mm >@@ -1031,7 +1031,7 @@ static PlatformFont *_font(Element& element) > auto* renderer = element.renderer(); > if (!renderer) > return nil; >- return (PlatformFont *)renderer->style().fontCascade().primaryFont().getCTFont(); >+ return (__bridge PlatformFont *)renderer->style().fontCascade().primaryFont().getCTFont(); > } > > #define UIFloatIsZero(number) (fabs(number - 0) < FLT_EPSILON) >@@ -2447,7 +2447,7 @@ static RetainPtr<NSFileWrapper> fileWrapperForElement(HTMLImageElement& element) > if (is<RenderImage>(renderer)) { > auto* image = downcast<RenderImage>(*renderer).cachedImage(); > if (image && !image->errorOccurred()) { >- RetainPtr<NSFileWrapper> wrapper = adoptNS([[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)image->imageForRenderer(renderer)->tiffRepresentation()]); >+ RetainPtr<NSFileWrapper> wrapper = adoptNS([[NSFileWrapper alloc] initRegularFileWithContents:(__bridge NSData *)image->imageForRenderer(renderer)->tiffRepresentation()]); > [wrapper setPreferredFilename:@"image.tiff"]; > return wrapper; > } >diff --git a/Source/WebCore/fileapi/FileCocoa.mm b/Source/WebCore/fileapi/FileCocoa.mm >index caa21d5b892f8f363f274008d08339a50f45bd88..44cccb8af5350c9fc8d301aa576cb25e321fa7b2 100644 >--- a/Source/WebCore/fileapi/FileCocoa.mm >+++ b/Source/WebCore/fileapi/FileCocoa.mm >@@ -54,7 +54,7 @@ bool File::shouldReplaceFile(const String& path) > return false; > } > >- return UTTypeConformsTo((CFStringRef)uti, kUTTypePackage); >+ return UTTypeConformsTo((__bridge CFStringRef)uti, kUTTypePackage); > } > > void File::computeNameAndContentTypeForReplacedFile(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType) >diff --git a/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm b/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm >index 7b0525a0bf83bbccb36794f0ec66f61d5658c9e6..2d5b29c80af7b1be0871bcaf92963e385add2b29 100644 >--- a/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm >+++ b/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm >@@ -45,7 +45,7 @@ ResourceResponse LegacyWebArchive::createResourceResponseFromMacArchivedData(CFD > > NSURLResponse *response = nil; > #if USE(SECURE_ARCHIVER_API) >- auto unarchiver = secureUnarchiverFromData((NSData *)responseData); >+ auto unarchiver = secureUnarchiverFromData((__bridge NSData *)responseData); > @try { > response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:LegacyWebArchiveResourceResponseKey]; > #else >diff --git a/Source/WebCore/page/mac/TextIndicatorWindow.mm b/Source/WebCore/page/mac/TextIndicatorWindow.mm >index cd1a56ee84974f8037b1cea4cdcfe8c1daa0e78c..2bb2761c46507968e40807467c1b9a6ab1f6de69 100644 >--- a/Source/WebCore/page/mac/TextIndicatorWindow.mm >+++ b/Source/WebCore/page/mac/TextIndicatorWindow.mm >@@ -228,7 +228,7 @@ - (instancetype)initWithFrame:(NSRect)frame textIndicator:(TextIndicator&)textIn > [textLayer setBorderColor:borderColor.get()]; > [textLayer setBorderWidth:borderWidth]; > [textLayer setDelegate:[WebActionDisablingCALayerDelegate shared]]; >- [textLayer setContents:(id)contentsImage.get()]; >+ [textLayer setContents:(__bridge id)contentsImage.get()]; > > RetainPtr<CAShapeLayer> maskLayer = adoptNS([[CAShapeLayer alloc] init]); > [maskLayer setPath:translatedPath.platformPath()]; >@@ -266,7 +266,7 @@ static RetainPtr<CABasicAnimation> createContentCrossfadeAnimation(CFTimeInterva > { > RetainPtr<CABasicAnimation> crossfadeAnimation = [CABasicAnimation animationWithKeyPath:@"contents"]; > RetainPtr<CGImageRef> contentsImage = textIndicator.contentImage()->nativeImage(); >- [crossfadeAnimation setToValue:(id)contentsImage.get()]; >+ [crossfadeAnimation setToValue:(__bridge id)contentsImage.get()]; > [crossfadeAnimation setFillMode:kCAFillModeForwards]; > [crossfadeAnimation setRemovedOnCompletion:NO]; > [crossfadeAnimation setDuration:duration]; >diff --git a/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm b/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm >index a36b8fb3614d5d4142c10bef2a2062955d6a681e..2c8323bb733e2253cf820c9456f65e6dd750206f 100644 >--- a/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm >+++ b/Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm >@@ -50,7 +50,7 @@ NSString *localizedNSString(NSString *key) > String localizedString(const char* key) > { > RetainPtr<CFStringRef> keyString = adoptCF(CFStringCreateWithCStringNoCopy(0, key, kCFStringEncodingUTF8, kCFAllocatorNull)); >- return localizedNSString((NSString *)keyString.get()); >+ return localizedNSString((__bridge NSString *)keyString.get()); > } > > String copyImageUnknownFileLabel() >diff --git a/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm b/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm >index 594d11087d52b8d4025016ef335d7b9118112c51..c9694d23cec8dee56f66fbc0e3277130010251ff 100644 >--- a/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm >+++ b/Source/WebCore/platform/cocoa/SharedBufferCocoa.mm >@@ -85,12 +85,12 @@ namespace WebCore { > > Ref<SharedBuffer> SharedBuffer::create(NSData *nsData) > { >- return adoptRef(*new SharedBuffer((CFDataRef)nsData)); >+ return adoptRef(*new SharedBuffer((__bridge CFDataRef)nsData)); > } > > void SharedBuffer::append(NSData *nsData) > { >- return append((CFDataRef)nsData); >+ return append((__bridge CFDataRef)nsData); > } > > RetainPtr<NSData> SharedBuffer::createNSData() const >diff --git a/Source/WebCore/platform/graphics/FontPlatformData.h b/Source/WebCore/platform/graphics/FontPlatformData.h >index c37654a6019d6fe686e84d8fd0eed0eb82ce7691..11dd54c9171b476514eb816eb21dc2722dee4a3f 100644 >--- a/Source/WebCore/platform/graphics/FontPlatformData.h >+++ b/Source/WebCore/platform/graphics/FontPlatformData.h >@@ -278,12 +278,12 @@ private: > // NSFonts and CTFontRefs are toll-free-bridged. > inline CTFontRef toCTFont(NSFont *font) > { >- return (CTFontRef)font; >+ return (__bridge CTFontRef)font; > } > > inline NSFont *toNSFont(CTFontRef font) > { >- return (NSFont *)font; >+ return (__bridge NSFont *)font; > } > > #endif >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm b/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm >index 4ddfb9c823d6eca263fb922179f1721e3a7f964b..e82f8a8931603f0e46140c7ba32a8aa0e9620097 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm >@@ -108,7 +108,7 @@ bool assetTrackMeetsHardwareDecodeRequirements(AVAssetTrack *track, const Vector > { > Vector<FourCC> codecs; > for (NSUInteger i = 0, count = track.formatDescriptions.count; i < count; ++i) { >- CMFormatDescriptionRef description = (CMFormatDescriptionRef)track.formatDescriptions[i]; >+ CMFormatDescriptionRef description = (__bridge CMFormatDescriptionRef)track.formatDescriptions[i]; > if (PAL::CMFormatDescriptionGetMediaType(description) == kCMMediaType_Video) > codecs.append(FourCC(PAL::CMFormatDescriptionGetMediaSubType(description))); > } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm >index 53bb05040bb79131da8f795ac76aea4570634e2b..b3b6bb516daea9b91a600c30165e2a62acce2d29 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm >@@ -440,14 +440,14 @@ bool ImageDecoderAVFObjC::storeSampleBuffer(CMSampleBufferRef sampleBuffer) > } > > if (!m_rotationPool) { >- auto pixelAttributes = (CFDictionaryRef)@{ >- (NSString *)kCVPixelBufferWidthKey: @(m_size.value().width()), >- (NSString *)kCVPixelBufferHeightKey: @(m_size.value().height()), >- (NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA), >- (NSString *)kCVPixelBufferCGImageCompatibilityKey: @YES, >+ auto pixelAttributes = @{ >+ (__bridge NSString *)kCVPixelBufferWidthKey: @(m_size.value().width()), >+ (__bridge NSString *)kCVPixelBufferHeightKey: @(m_size.value().height()), >+ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA), >+ (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: @YES, > }; > CVPixelBufferPoolRef rawPool = nullptr; >- CVPixelBufferPoolCreate(kCFAllocatorDefault, nullptr, pixelAttributes, &rawPool); >+ CVPixelBufferPoolCreate(kCFAllocatorDefault, nullptr, (__bridge CFDictionaryRef)pixelAttributes, &rawPool); > m_rotationPool = adoptCF(rawPool); > } > >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >index b9d725d0706f00fe892a9674d4d2ff47d6a47283..ad61d2edf1055356551fecffb840f71660f157fe 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >@@ -559,8 +559,8 @@ bool MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage() > ASSERT(m_lastPixelBuffer); > > if (!m_rgbConformer) { >- NSDictionary *attributes = @{ (NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) }; >- m_rgbConformer = std::make_unique<PixelBufferConformerCV>((CFDictionaryRef)attributes); >+ NSDictionary *attributes = @{ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) }; >+ m_rgbConformer = std::make_unique<PixelBufferConformerCV>((__bridge CFDictionaryRef)attributes); > } > > m_lastImage = m_rgbConformer->createImageFromPixelBuffer(m_lastPixelBuffer.get()); >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm >index 9d12ce606bb0fba532eebcdd4b1110377688c3ed..7f7d03fcad9b05ccbb973359949783851d571225 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm >@@ -1056,7 +1056,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage() > return; > > if (!m_imagePainter.pixelBufferConformer) >- m_imagePainter.pixelBufferConformer = std::make_unique<PixelBufferConformerCV>((CFDictionaryRef)@{ (NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) }); >+ m_imagePainter.pixelBufferConformer = std::make_unique<PixelBufferConformerCV>((__bridge CFDictionaryRef)@{ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) }); > > ASSERT(m_imagePainter.pixelBufferConformer); > if (!m_imagePainter.pixelBufferConformer) >@@ -1178,7 +1178,6 @@ WTFLogChannel& MediaPlayerPrivateMediaStreamAVFObjC::logChannel() const > } > #endif > >- > } > > #endif >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >index 54cfb8eab733e2e53f493b28666057d604c25299..541601823fb73013bb79f7684763b7dea17cae44 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >@@ -457,7 +457,7 @@ protected: > , m_isText([track hasMediaCharacteristic:AVMediaCharacteristicLegible]) > { > NSArray* formatDescriptions = [track formatDescriptions]; >- CMFormatDescriptionRef description = [formatDescriptions count] ? (CMFormatDescriptionRef)[formatDescriptions objectAtIndex:0] : 0; >+ CMFormatDescriptionRef description = [formatDescriptions count] ? (__bridge CMFormatDescriptionRef)[formatDescriptions objectAtIndex:0] : 0; > if (description) { > FourCharCode codec = CMFormatDescriptionGetMediaSubType(description); > m_codec = AtomicString(reinterpret_cast<LChar*>(&codec), 4); >@@ -488,7 +488,7 @@ static void bufferWasConsumedCallback(CMNotificationCenterRef, const void*, CFSt > return; > > ASSERT(CFGetTypeID(payload) == CFDictionaryGetTypeID()); >- auto context = (WebBufferConsumedContext *)[(NSDictionary *)payload valueForKey:kBufferConsumedContext]; >+ WebBufferConsumedContext *context = [(__bridge NSDictionary *)payload valueForKey:kBufferConsumedContext]; > if (!context) > return; > >@@ -1099,7 +1099,7 @@ void SourceBufferPrivateAVFObjC::enqueueSample(Ref<MediaSample>&& sample, const > CMSampleBufferRef rawSampleCopy; > CMSampleBufferCreateCopy(kCFAllocatorDefault, platformSample.sample.cmSampleBuffer, &rawSampleCopy); > auto sampleCopy = adoptCF(rawSampleCopy); >- CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, @{kBufferConsumedContext: context.get()}, kCMAttachmentMode_ShouldNotPropagate); >+ CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{kBufferConsumedContext: context.get()}, kCMAttachmentMode_ShouldNotPropagate); > [m_displayLayer enqueueSampleBuffer:sampleCopy.get()]; > } else > [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer]; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm >index 1f71d4304ee6ad3417816e2f817aecce108f4b3b..cc05b2a4b572ee56b92cda9e0175af1f22b4c927 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm >@@ -89,7 +89,7 @@ void VideoFullscreenLayerManagerObjC::setVideoLayer(PlatformLayer *videoLayer, I > void VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage(NativeImagePtr image) > { > if (m_videoInlineLayer) >- [m_videoInlineLayer setContents:(id)image.get()]; >+ [m_videoInlineLayer setContents:(__bridge id)image.get()]; > } > > void VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer(PlatformLayer *videoFullscreenLayer, WTF::Function<void()>&& completionHandler, NativeImagePtr currentImage) >@@ -108,7 +108,7 @@ void VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer(PlatformLayer *vid > CAContext *oldContext = [m_videoLayer context]; > > if (m_videoInlineLayer) >- [m_videoInlineLayer setContents:(id)currentImage.get()]; >+ [m_videoInlineLayer setContents:(__bridge id)currentImage.get()]; > > if (m_videoFullscreenLayer) { > [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0]; >diff --git a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >index 25cf28acce9deff65d7caffbdbdebd9e12e5c7ad..ca1c45f13219c6a97599c1d1e9e7fd4ca0e11d96 100644 >--- a/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >+++ b/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm >@@ -75,7 +75,7 @@ Ref<PlatformCALayer> PlatformCALayerCocoa::create(LayerType layerType, PlatformC > > Ref<PlatformCALayer> PlatformCALayerCocoa::create(void* platformLayer, PlatformCALayerClient* owner) > { >- return adoptRef(*new PlatformCALayerCocoa(static_cast<PlatformLayer*>(platformLayer), owner)); >+ return adoptRef(*new PlatformCALayerCocoa((__bridge CALayer *)platformLayer, owner)); > } > > static NSString * const platformCALayerPointer = @"WKPlatformCALayer"; >@@ -87,7 +87,7 @@ PlatformCALayer* PlatformCALayer::platformCALayer(void* platformLayer) > // Pointer to PlatformCALayer is kept in a key of the CALayer > PlatformCALayer* platformCALayer = nil; > BEGIN_BLOCK_OBJC_EXCEPTIONS >- platformCALayer = static_cast<PlatformCALayer*>([[static_cast<CALayer*>(platformLayer) valueForKey:platformCALayerPointer] pointerValue]); >+ platformCALayer = static_cast<PlatformCALayer*>([[(__bridge CALayer *)platformLayer valueForKey:platformCALayerPointer] pointerValue]); > END_BLOCK_OBJC_EXCEPTIONS > return platformCALayer; > } >@@ -416,7 +416,7 @@ void PlatformCALayerCocoa::copyContentsFromLayer(PlatformCALayer* layer) > > PlatformCALayer* PlatformCALayerCocoa::superlayer() const > { >- return platformCALayer([m_layer superlayer]); >+ return platformCALayer((__bridge void*)[m_layer superlayer]); > } > > void PlatformCALayerCocoa::removeFromSuperlayer() >@@ -741,13 +741,13 @@ void PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText(bool supportsSubpi > > CFTypeRef PlatformCALayerCocoa::contents() const > { >- return [m_layer contents]; >+ return (__bridge CFTypeRef)[m_layer contents]; > } > > void PlatformCALayerCocoa::setContents(CFTypeRef value) > { > BEGIN_BLOCK_OBJC_EXCEPTIONS >- [m_layer setContents:static_cast<id>(const_cast<void*>(value))]; >+ [m_layer setContents:(__bridge id)value]; > END_BLOCK_OBJC_EXCEPTIONS > } > >diff --git a/Source/WebCore/platform/graphics/cocoa/IOSurface.h b/Source/WebCore/platform/graphics/cocoa/IOSurface.h >index f68220ed6e428917d7afac287f5b1690df8668fd..2d1f273eb8ab4a198b6aa1356650398c435de75d 100644 >--- a/Source/WebCore/platform/graphics/cocoa/IOSurface.h >+++ b/Source/WebCore/platform/graphics/cocoa/IOSurface.h >@@ -102,7 +102,9 @@ public: > WEBCORE_EXPORT RetainPtr<CGImageRef> createImage(); > WEBCORE_EXPORT static RetainPtr<CGImageRef> sinkIntoImage(std::unique_ptr<IOSurface>); > >- id asLayerContents() const { return reinterpret_cast<id>(m_surface.get()); } >+#ifdef __OBJC__ >+ id asLayerContents() const { return (__bridge id)m_surface.get(); } >+#endif > IOSurfaceRef surface() const { return m_surface.get(); } > WEBCORE_EXPORT GraphicsContext& ensureGraphicsContext(); > WEBCORE_EXPORT CGContextRef ensurePlatformContext(); >diff --git a/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm b/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm >index 679e5acae431cf6e7620471ca58c72fe7b3da575..8595456269bb0dd69f2797a641d0649fb4fef0c1 100644 >--- a/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm >@@ -129,7 +129,7 @@ TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa() > void TextTrackRepresentationCocoa::update() > { > if (auto representation = m_client.createTextTrackRepresentationImage()) >- [m_layer.get() setContents:(id)representation->nativeImage().get()]; >+ [m_layer.get() setContents:(__bridge id)representation->nativeImage().get()]; > } > > void TextTrackRepresentationCocoa::setContentScale(float scale) >diff --git a/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm b/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm >index 3abcbdcd8f291ac9c5e60ac64fff2945e1f91eef..21138992926988aa8a94cecce36f2a2690459e96 100644 >--- a/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm >+++ b/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm >@@ -219,17 +219,17 @@ void WebCoreDecompressionSession::ensureDecompressionSessionForSample(CMSampleBu > > if (!m_decompressionSession) { > CMVideoFormatDescriptionRef videoFormatDescription = CMSampleBufferGetFormatDescription(sample); >- NSDictionary* videoDecoderSpecification = @{ (NSString *)kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder: @YES }; >+ NSDictionary* videoDecoderSpecification = @{ (__bridge NSString *)kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder: @YES }; > > NSDictionary *attributes; > if (m_mode == OpenGL) { > attributes = nil; > } else { > ASSERT(m_mode == RGB); >- attributes = @{(NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA)}; >+ attributes = @{ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) }; > } > VTDecompressionSessionRef decompressionSessionOut = nullptr; >- if (noErr == VTDecompressionSessionCreate(kCFAllocatorDefault, videoFormatDescription, (CFDictionaryRef)videoDecoderSpecification, (CFDictionaryRef)attributes, nullptr, &decompressionSessionOut)) { >+ if (noErr == VTDecompressionSessionCreate(kCFAllocatorDefault, videoFormatDescription, (__bridge CFDictionaryRef)videoDecoderSpecification, (__bridge CFDictionaryRef)attributes, nullptr, &decompressionSessionOut)) { > m_decompressionSession = adoptCF(decompressionSessionOut); > CFArrayRef rawSuggestedQualityOfServiceTiers = nullptr; > VTSessionCopyProperty(decompressionSessionOut, kVTDecompressionPropertyKey_SuggestedQualityOfServiceTiers, kCFAllocatorDefault, &rawSuggestedQualityOfServiceTiers); >@@ -562,7 +562,7 @@ void WebCoreDecompressionSession::resetQosTier() > return; > > auto tier = (CFDictionaryRef)CFArrayGetValueAtIndex(m_qosTiers.get(), m_currentQosTier); >- LOG(Media, "WebCoreDecompressionSession::resetQosTier(%p) - currentQosTier(%ld), tier(%@)", this, m_currentQosTier, [(NSDictionary *)tier description]); >+ LOG(Media, "WebCoreDecompressionSession::resetQosTier(%p) - currentQosTier(%ld), tier(%@)", this, m_currentQosTier, [(__bridge NSDictionary *)tier description]); > > VTSessionSetProperties(m_decompressionSession.get(), tier); > m_framesSinceLastQosCheck = 0; >diff --git a/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm b/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm >index fa77dc425bc79caa5e82bff7e8e6744cd092867c..3ed7e41e7c68846f3fbc172ce6ba989ff87f57eb 100644 >--- a/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm >+++ b/Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm >@@ -141,7 +141,7 @@ - (void)display > #endif > > _context->markLayerComposited(); >- PlatformCALayer* layer = PlatformCALayer::platformCALayer(self); >+ PlatformCALayer* layer = PlatformCALayer::platformCALayer((__bridge void*)self); > if (layer && layer->owner()) > layer->owner()->platformCALayerLayerDidDisplay(layer); > } >diff --git a/Source/WebCore/platform/graphics/mac/ImageMac.mm b/Source/WebCore/platform/graphics/mac/ImageMac.mm >index 9f67575d047ebaf829b416706f8d0957ffa88810..5ca9e7d4c3364025558a6dce7744150ce19f53f3 100644 >--- a/Source/WebCore/platform/graphics/mac/ImageMac.mm >+++ b/Source/WebCore/platform/graphics/mac/ImageMac.mm >@@ -118,7 +118,7 @@ NSImage* BitmapImage::nsImage() > if (!data) > return nullptr; > >- m_nsImage = adoptNS([[NSImage alloc] initWithData:(NSData*)data]); >+ m_nsImage = adoptNS([[NSImage alloc] initWithData:(__bridge NSData *)data]); > return m_nsImage.get(); > } > >@@ -132,7 +132,7 @@ RetainPtr<NSImage> BitmapImage::snapshotNSImage() > if (!data) > return nullptr; > >- return adoptNS([[NSImage alloc] initWithData:(NSData*)data.get()]); >+ return adoptNS([[NSImage alloc] initWithData:(__bridge NSData *)data.get()]); > } > #endif > >diff --git a/Source/WebCore/platform/graphics/mac/WebLayer.mm b/Source/WebCore/platform/graphics/mac/WebLayer.mm >index 98338abba3aef9cca174c7e6cda7d5da2933ff40..d6929050642e39a211d7a0aebf97dca0a27c6799 100644 >--- a/Source/WebCore/platform/graphics/mac/WebLayer.mm >+++ b/Source/WebCore/platform/graphics/mac/WebLayer.mm >@@ -51,7 +51,7 @@ @implementation WebLayer > > - (void)drawInContext:(CGContextRef)context > { >- PlatformCALayer* layer = PlatformCALayer::platformCALayer(self); >+ PlatformCALayer* layer = PlatformCALayer::platformCALayer((__bridge void*)self); > if (layer) { > PlatformCALayer::RepaintRectList rectsToPaint = PlatformCALayer::collectRectsToPaint(context, layer); > PlatformCALayer::drawLayerContents(context, layer, rectsToPaint, self.isRenderingInContext ? GraphicsLayerPaintSnapshotting : GraphicsLayerPaintNormal); >@@ -81,14 +81,14 @@ - (id<CAAction>)actionForKey:(NSString *)key > > - (void)setNeedsDisplay > { >- PlatformCALayer* layer = PlatformCALayer::platformCALayer(self); >+ PlatformCALayer* layer = PlatformCALayer::platformCALayer((__bridge void*)self); > if (layer && layer->owner() && layer->owner()->platformCALayerDrawsContent()) > [super setNeedsDisplay]; > } > > - (void)setNeedsDisplayInRect:(CGRect)dirtyRect > { >- PlatformCALayer* platformLayer = PlatformCALayer::platformCALayer(self); >+ PlatformCALayer* platformLayer = PlatformCALayer::platformCALayer((__bridge void*)self); > if (!platformLayer) { > [super setNeedsDisplayInRect:dirtyRect]; > return; >@@ -115,7 +115,7 @@ - (void)display > #endif > ASSERT(isMainThread()); > [super display]; >- PlatformCALayer* layer = PlatformCALayer::platformCALayer(self); >+ PlatformCALayer* layer = PlatformCALayer::platformCALayer((__bridge void*)self); > if (layer && layer->owner()) > layer->owner()->platformCALayerLayerDidDisplay(layer); > } >@@ -127,7 +127,7 @@ - (void)drawInContext:(CGContextRef)context > WebThreadLock(); > #endif > ASSERT(isMainThread()); >- PlatformCALayer* layer = PlatformCALayer::platformCALayer(self); >+ PlatformCALayer* layer = PlatformCALayer::platformCALayer((__bridge void*)self); > if (layer && layer->owner()) { > GraphicsContext graphicsContext(context); > graphicsContext.setIsCALayerContext(true); >diff --git a/Source/WebCore/platform/mac/CursorMac.mm b/Source/WebCore/platform/mac/CursorMac.mm >index 39d42d608ebe11511f1e17d76299e1d1c7238011..7fed9408c7b03e639329ef99f65e98484ca1c8b0 100644 >--- a/Source/WebCore/platform/mac/CursorMac.mm >+++ b/Source/WebCore/platform/mac/CursorMac.mm >@@ -125,7 +125,7 @@ static Class coreCursorClass() > > static NSCursor *cursor(const char *name) > { >- NSCursor **slot = 0; >+ __strong NSCursor **slot = nullptr; > > if (!strcmp(name, "BusyButClickable")) > slot = &busyButClickableNSCursor; >diff --git a/Source/WebCore/platform/mac/FileSystemMac.mm b/Source/WebCore/platform/mac/FileSystemMac.mm >index 640dfc12b6b3797b9f01c854e6e56a32e006534c..071d0c9117794e6038d98aad56fe96ff8f481533 100644 >--- a/Source/WebCore/platform/mac/FileSystemMac.mm >+++ b/Source/WebCore/platform/mac/FileSystemMac.mm >@@ -66,8 +66,8 @@ void FileSystem::setMetadataURL(const String& path, const String& metadataURLStr > if (!referrer.isNull()) > [whereFromAttribute addObject:referrer]; > >- MDItemSetAttribute(item.get(), kMDItemWhereFroms, whereFromAttribute.get()); >- MDItemSetAttribute(item.get(), kMDItemDownloadedDate, @[ [NSDate date] ]); >+ MDItemSetAttribute(item.get(), kMDItemWhereFroms, (__bridge CFArrayRef)whereFromAttribute.get()); >+ MDItemSetAttribute(item.get(), kMDItemDownloadedDate, (__bridge CFArrayRef)@[ [NSDate date] ]); > }); > } > >diff --git a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm >index d4b1f060c73b3b919eb439a1a002da8626668e2b..2f0e5243cd7a3445d4dad2a11e61a98b34cdfce4 100644 >--- a/Source/WebCore/platform/mac/PlatformPasteboardMac.mm >+++ b/Source/WebCore/platform/mac/PlatformPasteboardMac.mm >@@ -59,7 +59,7 @@ RefPtr<SharedBuffer> PlatformPasteboard::bufferForType(const String& pasteboardT > NSData *data = [m_pasteboard.get() dataForType:pasteboardType]; > if (!data) > return nullptr; >- return SharedBuffer::create([[data copy] autorelease]); >+ return SharedBuffer::create(adoptNS([data copy]).get()); > } > > int PlatformPasteboard::numberOfFiles() const >diff --git a/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm b/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm >index 3f00ff950a8acaa9cb20e762afc7a5dbc023915d..ad5debea59824e0f09030eaacefa5c81036e745e 100644 >--- a/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm >+++ b/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm >@@ -219,7 +219,7 @@ static NSArray *speechSynthesisGetVoiceIdentifiers() > // Get all the voices offered by TTS. > // By default speech only returns "premium" voices, which does not include all the > // international voices. This allows us to offer speech synthesis for all supported languages. >- return [(NSArray *)CopySpeechSynthesisVoicesForMode((CFArrayRef)@[ @"VoiceGroupDefault", @"VoiceGroupCompact" ]) autorelease]; >+ return CFBridgingRelease(CopySpeechSynthesisVoicesForMode((__bridge CFArrayRef)@[ @"VoiceGroupDefault", @"VoiceGroupCompact" ])); > } > > static NSString *speechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale *userLocale) >@@ -227,7 +227,7 @@ static NSString *speechSynthesisGetDefaultVoiceIdentifierForLocale(NSLocale *use > if (!userLocale) > return nil; > >- return (NSString *)GetIdentifierStringForPreferredVoiceInListWithLocale((CFArrayRef)speechSynthesisGetVoiceIdentifiers(), (CFLocaleRef)userLocale); >+ return (__bridge NSString *)GetIdentifierStringForPreferredVoiceInListWithLocale((__bridge CFArrayRef)speechSynthesisGetVoiceIdentifiers(), (__bridge CFLocaleRef)userLocale); > } > > void PlatformSpeechSynthesizer::initializeVoiceList() >diff --git a/Source/WebCore/platform/mac/PluginBlacklist.h b/Source/WebCore/platform/mac/PluginBlacklist.h >index 85365fb7c842b54dafe498152ee74da2fbb09db8..0f72509747d4c6bb7edb23580fbad02929dd0977 100644 >--- a/Source/WebCore/platform/mac/PluginBlacklist.h >+++ b/Source/WebCore/platform/mac/PluginBlacklist.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012-2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -28,8 +28,7 @@ > #if PLATFORM(MAC) > > #include <memory> >-#include <string> >-#include <vector> >+#include <wtf/RetainPtr.h> > > OBJC_CLASS NSArray; > OBJC_CLASS NSDictionary; >@@ -60,10 +59,10 @@ public: > private: > PluginBlacklist(NSDictionary *bundleIDToMinimumSecureVersion, NSDictionary *bundleIDToMinimumCompatibleVersion, NSDictionary *bundleIDToBlockedVersions, NSSet *bundleIDsWithAvailableUpdates); > >- NSDictionary *m_bundleIDToMinimumSecureVersion; >- NSDictionary *m_bundleIDToMinimumCompatibleVersion; >- NSDictionary *m_bundleIDToBlockedVersions; >- NSSet *m_bundleIDsWithAvailableUpdates; >+ RetainPtr<NSDictionary> m_bundleIDToMinimumSecureVersion; >+ RetainPtr<NSDictionary> m_bundleIDToMinimumCompatibleVersion; >+ RetainPtr<NSDictionary> m_bundleIDToBlockedVersions; >+ RetainPtr<NSSet> m_bundleIDsWithAvailableUpdates; > }; > > } >diff --git a/Source/WebCore/platform/mac/PluginBlacklist.mm b/Source/WebCore/platform/mac/PluginBlacklist.mm >index cf19a5cc0f2f1495eb455005c319078ad9febfbd..e2934b8be9a13c476081a13557981c7d68855361 100644 >--- a/Source/WebCore/platform/mac/PluginBlacklist.mm >+++ b/Source/WebCore/platform/mac/PluginBlacklist.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012-2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -79,7 +79,7 @@ std::unique_ptr<PluginBlacklist> PluginBlacklist::create(NSDictionary *propertyL > NSMutableDictionary *bundleIDToBlockedVersions = [NSMutableDictionary dictionary]; > NSMutableSet *bundleIDsWithAvailableUpdates = [NSMutableSet set]; > >- for (NSString *osVersionComponent in splitOSVersion((NSString *)osVersion)) { >+ for (NSString *osVersionComponent in splitOSVersion((__bridge NSString *)osVersion)) { > NSDictionary *bundleIDs = [dictionary objectForKey:osVersionComponent]; > if (!bundleIDs) > continue; >@@ -119,10 +119,6 @@ std::unique_ptr<PluginBlacklist> PluginBlacklist::create(NSDictionary *propertyL > > PluginBlacklist::~PluginBlacklist() > { >- CFRelease(m_bundleIDToMinimumSecureVersion); >- CFRelease(m_bundleIDToMinimumCompatibleVersion); >- CFRelease(m_bundleIDToBlockedVersions); >- CFRelease(m_bundleIDsWithAvailableUpdates); > } > > NSArray *PluginBlacklist::splitOSVersion(NSString *osVersion) >@@ -173,20 +169,11 @@ bool PluginBlacklist::isUpdateAvailable(NSString *bundleIdentifier) const > } > > PluginBlacklist::PluginBlacklist(NSDictionary *bundleIDToMinimumSecureVersion, NSDictionary *bundleIDToMinimumCompatibleVersion, NSDictionary *bundleIDToBlockedVersions, NSSet *bundleIDsWithAvailableUpdates) >- : m_bundleIDToMinimumSecureVersion([bundleIDToMinimumSecureVersion copy]) >- , m_bundleIDToMinimumCompatibleVersion([bundleIDToMinimumCompatibleVersion copy]) >- , m_bundleIDToBlockedVersions([bundleIDToBlockedVersions copy]) >- , m_bundleIDsWithAvailableUpdates([bundleIDsWithAvailableUpdates copy]) >+ : m_bundleIDToMinimumSecureVersion(adoptNS([bundleIDToMinimumSecureVersion copy])) >+ , m_bundleIDToMinimumCompatibleVersion(adoptNS([bundleIDToMinimumCompatibleVersion copy])) >+ , m_bundleIDToBlockedVersions(adoptNS([bundleIDToBlockedVersions copy])) >+ , m_bundleIDsWithAvailableUpdates(adoptNS([bundleIDsWithAvailableUpdates copy])) > { >- // This ensures that the dictionaries do not get destroyed under Objective-C grabage collection. >- CFRetain(m_bundleIDToMinimumSecureVersion); >- [m_bundleIDToMinimumSecureVersion release]; >- CFRetain(m_bundleIDToMinimumCompatibleVersion); >- [m_bundleIDToMinimumCompatibleVersion release]; >- CFRetain(m_bundleIDToBlockedVersions); >- [m_bundleIDToBlockedVersions release]; >- CFRetain(m_bundleIDsWithAvailableUpdates); >- [m_bundleIDsWithAvailableUpdates release]; > } > > } >diff --git a/Source/WebCore/platform/mac/PublicSuffixMac.mm b/Source/WebCore/platform/mac/PublicSuffixMac.mm >index b3889fb655606651bdffc19161e8ed3edb08a230..2303817f3b214fac54fe0f4e26d049333b510435 100644 >--- a/Source/WebCore/platform/mac/PublicSuffixMac.mm >+++ b/Source/WebCore/platform/mac/PublicSuffixMac.mm >@@ -38,7 +38,7 @@ bool isPublicSuffix(const String& domain) > { > // Explicitly cast the domain to a NSString before calling decodeHostName() so we get a NSString back instead of a String. > NSString *host = decodeHostName((NSString *)domain); >- return host && _CFHostIsDomainTopLevel((CFStringRef)host); >+ return host && _CFHostIsDomainTopLevel((__bridge CFStringRef)host); > } > > String topPrivatelyControlledDomain(const String& domain) >diff --git a/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm b/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm >index 9c6c9db859e86dba4fc21518d3b73b26f268cf30..3d7472222c23e0b10a927cad18b3c6f4b15e9366 100644 >--- a/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm >+++ b/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm >@@ -143,7 +143,7 @@ RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient& > if (!weakThis) > return; > weakThis->m_client.didReceiveRemoteControlCommand(platformCommand, &argument); >- completion(static_cast<CFArrayRef>(@[@(status)])); >+ completion((__bridge CFArrayRef)@[@(status)]); > }); > #endif // USE(MEDIAREMOTE) > } >diff --git a/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm b/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm >index 977b6087dcf2bb6b1312c391fe31ba845897f7ba..ded7ec0c7989c024b50e7ef941a95cab34b4b61b 100644 >--- a/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm >+++ b/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm >@@ -190,7 +190,7 @@ static JSValue *jsValueWithDictionaryInContext(NSDictionary *dictionary, JSConte > if (!value) > continue; > >- JSStringRef name = JSStringCreateWithCFString((CFStringRef)key); >+ JSStringRef name = JSStringCreateWithCFString((__bridge CFStringRef)key); > JSObjectSetProperty([context JSGlobalContextRef], resultObject, name, [value JSValueRef], 0, &exception); > JSStringRelease(name); > if (exception) >diff --git a/Source/WebCore/platform/mac/URLMac.mm b/Source/WebCore/platform/mac/URLMac.mm >index 9bb256040e418783da7b3483dccbed50f5b262e3..bb57c5c05afecccf3d3c211bcf6c2707b1683b30 100644 >--- a/Source/WebCore/platform/mac/URLMac.mm >+++ b/Source/WebCore/platform/mac/URLMac.mm >@@ -47,14 +47,14 @@ URL::URL(NSURL *url) > > // FIXME: Why is it OK to ignore base URL here? > CString urlBytes; >- getURLBytes(reinterpret_cast<CFURLRef>(url), urlBytes); >+ getURLBytes((__bridge CFURLRef)url, urlBytes); > URLParser parser(urlBytes.data()); > *this = parser.result(); > } > > URL::operator NSURL *() const > { >- // Creating a toll-free bridged CFURL, because a real NSURL would not preserve the original string. >+ // Creating a toll-free bridged CFURL, because creation with NSURL methods would not preserve the original string. > // We'll need fidelity when round-tripping via CFURLGetBytes(). > return (NSURL *)createCFURL().autorelease(); > } >@@ -66,7 +66,7 @@ RetainPtr<CFURLRef> URL::createCFURL() const > > if (isEmpty()) { > // We use the toll-free bridge between NSURL and CFURL to create a CFURLRef supporting both empty and null values. >- return reinterpret_cast<CFURLRef>(adoptNS([[NSURL alloc] initWithString:@""]).get()); >+ return (__bridge CFURLRef)adoptNS([[NSURL alloc] initWithString:@""]).get(); > } > > RetainPtr<CFURLRef> cfURL; >diff --git a/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm b/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >index 8df855412896a70cefafec41085be4c481e13974..a88ed537cc2073b0d9976a733aa0b31241bf93e9 100644 >--- a/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >+++ b/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >@@ -622,7 +622,7 @@ static void collectRangesThatNeedMapping(NSString *string, NSRange range, void * > if (!error && !needsMapping) > return; > >- NSMutableArray **array = (NSMutableArray **)context; >+ __strong NSMutableArray **array = (__strong NSMutableArray **)context; > if (!*array) > *array = [[NSMutableArray alloc] init]; > >@@ -795,7 +795,7 @@ static NSString *mapHostNames(NSString *string, BOOL encode) > static NSString *stringByTrimmingWhitespace(NSString *string) > { > NSMutableString *trimmed = [[string mutableCopy] autorelease]; >- CFStringTrimWhitespace((CFMutableStringRef)trimmed); >+ CFStringTrimWhitespace((__bridge CFMutableStringRef)trimmed); > return trimmed; > } > >@@ -807,7 +807,7 @@ NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFURLComponentType > CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)URL, component, NULL); > if (fragRg.location == kCFNotFound) > return URL; >- >+ > Vector<UInt8, URL_BYTES_BUFFER_LENGTH> urlBytes(URL_BYTES_BUFFER_LENGTH); > CFIndex numBytes = CFURLGetBytes((CFURLRef)URL, urlBytes.data(), urlBytes.size()); > if (numBytes == -1) { >@@ -816,11 +816,11 @@ NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFURLComponentType > CFURLGetBytes((CFURLRef)URL, urlBytes.data(), numBytes); > } > >- NSURL *result = (NSURL *)CFURLCreateWithBytes(NULL, urlBytes.data(), fragRg.location - 1, kCFStringEncodingUTF8, NULL); >+ CFURLRef result = CFURLCreateWithBytes(NULL, urlBytes.data(), fragRg.location - 1, kCFStringEncodingUTF8, NULL); > if (!result) >- result = (NSURL *)CFURLCreateWithBytes(NULL, urlBytes.data(), fragRg.location - 1, kCFStringEncodingISOLatin1, NULL); >+ result = CFURLCreateWithBytes(NULL, urlBytes.data(), fragRg.location - 1, kCFStringEncodingISOLatin1, NULL); > >- return result ? [result autorelease] : URL; >+ return result ? CFBridgingRelease(result) : URL; > } > > static NSURL *URLByRemovingResourceSpecifier(NSURL *URL) >@@ -1009,11 +1009,11 @@ static NSURL *URLByRemovingComponentAndSubsequentCharacter(NSURL *URL, CFURLComp > > memmove(urlBytes + range.location, urlBytes + range.location + range.length, numBytes - range.location + range.length); > >- NSURL *result = (NSURL *)CFURLCreateWithBytes(NULL, urlBytes, numBytes - range.length, kCFStringEncodingUTF8, NULL); >+ CFURLRef result = CFURLCreateWithBytes(NULL, urlBytes, numBytes - range.length, kCFStringEncodingUTF8, NULL); > if (!result) >- result = (NSURL *)CFURLCreateWithBytes(NULL, urlBytes, numBytes - range.length, kCFStringEncodingISOLatin1, NULL); >+ result = CFURLCreateWithBytes(NULL, urlBytes, numBytes - range.length, kCFStringEncodingISOLatin1, NULL); > >- return result ? [result autorelease] : URL; >+ return result ? CFBridgingRelease(result) : URL; > } > > NSURL *URLByRemovingUserInfo(NSURL *URL) >@@ -1170,7 +1170,7 @@ NSString *userVisibleString(NSURL *URL) > } > > result = [result precomposedStringWithCanonicalMapping]; >- return CFBridgingRelease(createStringWithEscapedUnsafeCharacters((CFStringRef)result)); >+ return CFBridgingRelease(createStringWithEscapedUnsafeCharacters((__bridge CFStringRef)result)); > } > > BOOL isUserVisibleURL(NSString *string) >@@ -1180,7 +1180,7 @@ BOOL isUserVisibleURL(NSString *string) > > char static_buffer[1024]; > const char *p; >- BOOL success = CFStringGetCString((CFStringRef)string, static_buffer, 1023, kCFStringEncodingUTF8); >+ BOOL success = CFStringGetCString((__bridge CFStringRef)string, static_buffer, 1023, kCFStringEncodingUTF8); > p = success ? static_buffer : [string UTF8String]; > > int length = strlen(p); >diff --git a/Source/WebCore/platform/mac/WebGLBlacklist.mm b/Source/WebCore/platform/mac/WebGLBlacklist.mm >index bb7e331ccedfd61133305e83b3ea62f9ae4a524f..6fadcd35d49854f4230a9c2c5faf68c87fb54735 100644 >--- a/Source/WebCore/platform/mac/WebGLBlacklist.mm >+++ b/Source/WebCore/platform/mac/WebGLBlacklist.mm >@@ -170,7 +170,7 @@ std::unique_ptr<WebGLBlacklist> WebGLBlacklist::create(NSDictionary *propertyLis > { > CFDictionaryRef systemVersionDictionary = _CFCopySystemVersionDictionary(); > CFStringRef osBuild = static_cast<CFStringRef>(CFDictionaryGetValue(systemVersionDictionary, _kCFSystemVersionBuildVersionKey)); >- OSBuildInfo buildInfo = buildInfoFromOSBuildString((NSString *)osBuild); >+ OSBuildInfo buildInfo = buildInfoFromOSBuildString((__bridge NSString *)osBuild); > CFRelease(systemVersionDictionary); > > if (!buildInfo.major) >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >index 0f54eb5422ffbbb293a82b8c2e75f8cfb02119e8..9e37fb90af4fe8f9d3199114697ba8d920bccb59 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >@@ -285,7 +285,7 @@ bool AVVideoCaptureSource::setPreset(NSString *preset) > @try { > session().sessionPreset = preset; > #if PLATFORM(MAC) >- auto settingsDictionary = @{ (NSString*)kCVPixelBufferPixelFormatTypeKey: @(videoCaptureFormat), (NSString*)kCVPixelBufferWidthKey: @(size.width()), (NSString*)kCVPixelBufferHeightKey: @(size.height()), }; >+ auto settingsDictionary = @{ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(videoCaptureFormat), (__bridge NSString *)kCVPixelBufferWidthKey: @(size.width()), (__bridge NSString *)kCVPixelBufferHeightKey: @(size.height()), }; > [m_videoOutput setVideoSettings:settingsDictionary]; > #endif > } @catch(NSException *exception) { >@@ -405,8 +405,8 @@ bool AVVideoCaptureSource::setupCaptureSession() > if (m_pendingPreset) { > #if PLATFORM(MAC) > auto size = sizeForPreset(m_pendingPreset.get()); >- [settingsDictionary.get() setObject:[NSNumber numberWithInt:size.width()] forKey:(NSString*)kCVPixelBufferWidthKey]; >- [settingsDictionary.get() setObject:[NSNumber numberWithInt:size.height()] forKey:(NSString*)kCVPixelBufferHeightKey]; >+ [settingsDictionary setObject:@(size.width()) forKey:(__bridge NSString *)kCVPixelBufferWidthKey]; >+ [settingsDictionary setObject:@(size.height()) forKey:(__bridge NSString *)kCVPixelBufferHeightKey]; > #endif > } > >diff --git a/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm b/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm >index 272e66825894b0909b644c78377aecb0dfb1e5f8..2ad4d0133e96752b1137cadeeb811356dcb337ac 100644 >--- a/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm >+++ b/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm >@@ -72,7 +72,7 @@ RetainPtr<CMSampleBufferRef> MockRealtimeVideoSourceMac::CMSampleBufferFromPixel > return nullptr; > > if (!m_pixelBufferConformer) >- m_pixelBufferConformer = std::make_unique<PixelBufferConformerCV>((CFDictionaryRef)@{ (NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8Planar) }); >+ m_pixelBufferConformer = std::make_unique<PixelBufferConformerCV>((__bridge CFDictionaryRef)@{ (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8Planar) }); > > auto convertedPixelBuffer = m_pixelBufferConformer->convert(pixelBuffer); > >diff --git a/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm b/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm >index b650b011d1cf1b8f074e11c626fc87ae55be99cc..eea777d6f132c7256376b9959cd77ad2e7fb2949 100644 >--- a/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm >+++ b/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm >@@ -243,7 +243,7 @@ void ResourceRequest::doUpdatePlatformHTTPBody() > > if (NSInputStream *bodyStream = [nsRequest HTTPBodyStream]) { > // For streams, provide a Content-Length to avoid using chunked encoding, and to get accurate total length in callbacks. >- NSString *lengthString = [bodyStream propertyForKey:(NSString *)formDataStreamLengthPropertyName()]; >+ NSString *lengthString = [bodyStream propertyForKey:(__bridge NSString *)formDataStreamLengthPropertyName()]; > if (lengthString) { > [nsRequest setValue:lengthString forHTTPHeaderField:@"Content-Length"]; > // Since resource request is already marked updated, we need to keep it up to date too. >diff --git a/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm b/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm >index d68bef39478fac9fcebb76397c576efe37e2da45..3d8f396d807c92a12565c9bacde15be722a6f91c 100644 >--- a/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm >+++ b/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm >@@ -111,8 +111,8 @@ CertificateInfo ResourceResponse::platformCertificateInfo() const > #endif > } > >-static NSString* const commonHeaderFields[] = { >- @"Age", @"Cache-Control", @"Content-Type", @"Date", @"Etag", @"Expires", @"Last-Modified", @"Pragma" >+static CFStringRef const commonHeaderFields[] = { >+ CFSTR("Age"), CFSTR("Cache-Control"), CFSTR("Content-Type"), CFSTR("Date"), CFSTR("Etag"), CFSTR("Expires"), CFSTR("Last-Modified"), CFSTR("Pragma") > }; > > NSURLResponse *ResourceResponse::nsURLResponse() const >diff --git a/Source/WebCore/platform/network/mac/CertificateInfoMac.mm b/Source/WebCore/platform/network/mac/CertificateInfoMac.mm >index ffc99be49923713a048cf2b73ff6436a51ec8ff6..8b2aebaba5df350c7f154a5e6c5f5f04b95e0eda 100644 >--- a/Source/WebCore/platform/network/mac/CertificateInfoMac.mm >+++ b/Source/WebCore/platform/network/mac/CertificateInfoMac.mm >@@ -108,7 +108,7 @@ void CertificateInfo::dump() const > NSLog(@" Entries: %ld\n", entries); > for (CFIndex i = 0; i < entries; ++i) { > RetainPtr<CFStringRef> summary = adoptCF(SecCertificateCopySubjectSummary(SecTrustGetCertificateAtIndex(trust(), i))); >- NSLog(@" %@", (NSString *)summary.get()); >+ NSLog(@" %@", (__bridge NSString *)summary.get()); > } > > return; >@@ -121,7 +121,7 @@ void CertificateInfo::dump() const > NSLog(@" Entries: %ld\n", entries); > for (CFIndex i = 0; i < entries; ++i) { > RetainPtr<CFStringRef> summary = adoptCF(SecCertificateCopySubjectSummary(checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(m_certificateChain.get(), i)))); >- NSLog(@" %@", (NSString *)summary.get()); >+ NSLog(@" %@", (__bridge NSString *)summary.get()); > } > > return; >diff --git a/Source/WebCore/platform/network/mac/FormDataStreamMac.mm b/Source/WebCore/platform/network/mac/FormDataStreamMac.mm >index d9caf40010d45d28d9108ac45bea9a6708196a21..7a748d92f204fb93a195c52a82ccf9766af0f243 100644 >--- a/Source/WebCore/platform/network/mac/FormDataStreamMac.mm >+++ b/Source/WebCore/platform/network/mac/FormDataStreamMac.mm >@@ -41,12 +41,12 @@ void setHTTPBody(NSMutableURLRequest *request, FormData* formData) > > RetainPtr<NSInputStream> createHTTPBodyNSInputStream(FormData& formData) > { >- return reinterpret_cast<NSInputStream *>(createHTTPBodyCFReadStream(formData).get()); >+ return (__bridge NSInputStream *)createHTTPBodyCFReadStream(formData).get(); > } > > FormData* httpBodyFromStream(NSInputStream *stream) > { >- return httpBodyFromStream(reinterpret_cast<CFReadStreamRef>(stream)); >+ return httpBodyFromStream((__bridge CFReadStreamRef)stream); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/network/mac/ResourceErrorMac.mm b/Source/WebCore/platform/network/mac/ResourceErrorMac.mm >index a27a9b18afe430501efe7005aabdfdf699d5613e..899b54989482bd84b63a70412002aeff09900463 100644 >--- a/Source/WebCore/platform/network/mac/ResourceErrorMac.mm >+++ b/Source/WebCore/platform/network/mac/ResourceErrorMac.mm >@@ -118,7 +118,7 @@ ResourceError::ResourceError(NSError *nsError) > } > > ResourceError::ResourceError(CFErrorRef cfError) >- : ResourceError((NSError *)cfError) >+ : ResourceError((__bridge NSError *)cfError) > { > } > >@@ -201,7 +201,7 @@ ResourceError::operator NSError *() const > > CFErrorRef ResourceError::cfError() const > { >- return (CFErrorRef)nsError(); >+ return (__bridge CFErrorRef)nsError(); > } > > ResourceError::operator CFErrorRef() const >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 7b8a79f622afd472db9eb18c2e1d6637a550b047..c66c628cd2945a5b77017ca3df9807ab67ae3ea2 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -157,7 +157,7 @@ - (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView > { > // FIXME: This is a workaround for <rdar://problem/11385461>. When that bug is resolved, we should remove this code. > CFMutableDictionaryRef coreUIDrawOptions = CFDictionaryCreateMutableCopy(NULL, 0, [super _coreUIDrawOptionsWithFrame:cellFrame inView:controlView includeFocus:includeFocus]); >- CFDictionarySetValue(coreUIDrawOptions, @"borders only", kCFBooleanTrue); >+ CFDictionarySetValue(coreUIDrawOptions, CFSTR("borders only"), kCFBooleanTrue); > CFAutorelease(coreUIDrawOptions); > return coreUIDrawOptions; > } >@@ -2230,8 +2230,8 @@ void AttachmentLayout::layOutTitle(const RenderAttachment& attachment) > return; > > NSDictionary *textAttributes = @{ >- (id)kCTFontAttributeName: (id)font.get(), >- (id)kCTForegroundColorAttributeName: (NSColor *)cachedCGColor(titleTextColorForAttachment(attachment)) >+ (__bridge id)kCTFontAttributeName: (__bridge id)font.get(), >+ (__bridge id)kCTForegroundColorAttributeName: (__bridge NSColor *)cachedCGColor(titleTextColorForAttachment(attachment)) > }; > RetainPtr<NSAttributedString> attributedTitle = adoptNS([[NSAttributedString alloc] initWithString:title attributes:textAttributes]); > RetainPtr<CTFramesetterRef> titleFramesetter = adoptCF(CTFramesetterCreateWithAttributedString((CFAttributedStringRef)attributedTitle.get())); >@@ -2288,8 +2288,8 @@ void AttachmentLayout::layOutSubtitle(const RenderAttachment& attachment) > CFStringRef language = 0; // By not specifying a language we use the system language. > RetainPtr<CTFontRef> font = adoptCF(CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, attachmentSubtitleFontSize, language)); > NSDictionary *textAttributes = @{ >- (id)kCTFontAttributeName: (id)font.get(), >- (id)kCTForegroundColorAttributeName: (NSColor *)cachedCGColor(subtitleColor) >+ (__bridge id)kCTFontAttributeName: (__bridge id)font.get(), >+ (__bridge id)kCTForegroundColorAttributeName: (__bridge NSColor *)cachedCGColor(subtitleColor) > }; > RetainPtr<NSAttributedString> attributedSubtitleText = adoptNS([[NSAttributedString alloc] initWithString:subtitleText attributes:textAttributes]); > subtitleLine = adoptCF(CTLineCreateWithAttributedString((CFAttributedStringRef)attributedSubtitleText.get())); >diff --git a/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm b/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm >index 7459669d1cffeceaae6be682aeba12ca67ec8ef4..30ebf748c305941bb566c2def95454f0ac77f876 100644 >--- a/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm >+++ b/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm >@@ -44,7 +44,7 @@ static CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseDa > { > NSURLResponse *response; > #if USE(SECURE_ARCHIVER_API) >- auto unarchiver = secureUnarchiverFromData((NSData *)responseData); >+ auto unarchiver = secureUnarchiverFromData((__bridge NSData *)responseData); > @try { > response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m > #else >@@ -60,7 +60,7 @@ static CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseDa > } > > if (![response isKindOfClass:[NSHTTPURLResponse class]]) >- return CFURLResponseCreate(kCFAllocatorDefault, (CFURLRef)response.URL, (CFStringRef)response.MIMEType, response.expectedContentLength, (CFStringRef)response.textEncodingName, kCFURLCacheStorageAllowed); >+ return CFURLResponseCreate(kCFAllocatorDefault, (__bridge CFURLRef)response.URL, (__bridge CFStringRef)response.MIMEType, response.expectedContentLength, (__bridge CFStringRef)response.textEncodingName, kCFURLCacheStorageAllowed); > > NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; > >@@ -69,17 +69,9 @@ static CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseDa > > NSDictionary *headerFields = httpResponse.allHeaderFields; > for (NSString *headerField in [headerFields keyEnumerator]) >- CFHTTPMessageSetHeaderFieldValue(httpMessage.get(), (CFStringRef)headerField, (CFStringRef)[headerFields objectForKey:headerField]); >+ CFHTTPMessageSetHeaderFieldValue(httpMessage.get(), (__bridge CFStringRef)headerField, (__bridge CFStringRef)[headerFields objectForKey:headerField]); > >- return CFURLResponseCreateWithHTTPResponse(kCFAllocatorDefault, (CFURLRef)response.URL, httpMessage.get(), kCFURLCacheStorageAllowed); >-} >- >-static CFArrayRef supportedNonImageMIMETypes() >-{ >- auto array = adoptNS([[NSMutableArray alloc] init]); >- for (auto& mimeType : MIMETypeRegistry::getSupportedNonImageMIMETypes()) >- [array addObject:mimeType]; >- return (CFArrayRef)array.autorelease(); >+ return CFURLResponseCreateWithHTTPResponse(kCFAllocatorDefault, (__bridge CFURLRef)response.URL, httpMessage.get(), kCFURLCacheStorageAllowed); > } > > static void convertMIMEType(CFMutableStringRef mimeType) >@@ -95,8 +87,7 @@ static void convertWebResourceDataToString(CFMutableDictionaryRef resource) > CFStringLowercase(mimeType, CFLocaleGetSystem()); > convertMIMEType(mimeType); > >- CFArrayRef supportedMIMETypes = supportedNonImageMIMETypes(); >- if (CFStringHasPrefix(mimeType, CFSTR("text/")) || CFArrayContainsValue(supportedMIMETypes, CFRangeMake(0, CFArrayGetCount(supportedMIMETypes)), mimeType)) { >+ if (CFStringHasPrefix(mimeType, CFSTR("text/")) || MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) { > CFStringRef textEncodingName = static_cast<CFStringRef>(CFDictionaryGetValue(resource, CFSTR("WebResourceTextEncodingName"))); > CFStringEncoding stringEncoding; > if (textEncodingName && CFStringGetLength(textEncodingName))
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 186245
:
341871
|
341876
|
341879
|
341880
|
341882
|
341888