[Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2018 20:58:14 +0000 (20:58 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2018 20:58:14 +0000 (20:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186314

Reviewed by Anders Carlsson.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::overrideSystemProxies): Ditto.
(WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage): Ditto.
(IPC::readFromMachPort): Ditto.

* Platform/mac/StringUtilities.mm:
(WebKit::formattedPhoneNumberString): Use __bridge for cast and
CFBridgingRelease instead of an explicit autorelease.

* Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
(initializeMethods): Use auto instead of an explicit type so that we get
the correct type for the result of protocol_copyProtocolList.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
bridging cast to void* because that's needed to call _Block_signature
under ARC and harmless outside ARC.

* Shared/API/c/cf/WKStringCF.mm:
(WKStringCreateWithCFString): Use __bridge for cast.
* Shared/API/c/cf/WKURLCF.mm:
(WKURLCreateWithCFURL): Ditto.
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::initializeConnection): Ditto.
* Shared/Cocoa/DataDetectionResult.mm:
(WebKit::DataDetectionResult::encode const): Ditto.
(WebKit::DataDetectionResult::decode): Ditto.
* Shared/Cocoa/WKNSError.mm:
(-[WKNSError _web_createTarget]): Ditto.
* Shared/Cocoa/WKNSURLExtras.mm:
(-[NSURL _web_originalDataAsWTFString]): Ditto.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer): Removed balanced calls to both
adoptOSObject and xpc_retain and instead rely on the assignment
operator just added to OSObjectPtr.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler): Use __bridge for cast.
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
* Shared/cf/ArgumentCodersCF.cpp:
(IPC::decode): Ditto.
* Shared/mac/ArgumentCodersMac.mm:
(IPC::isSerializableValue): Ditto.
(IPC::encode): Ditto.
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
when we need a CFString.
(IPC::decodeNSError): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformEncode const): Ditto.
(WebKit::WebHitTestResultData::platformDecode): Ditto.
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextIsPlugInUpdateAvailable): Ditto.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController certificateChain]): Ditto.
(didStartProvisionalLoadForFrame): Ditto.
(didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
(didFailProvisionalLoadWithErrorForFrame): Ditto.
(didCommitLoadForFrame): Ditto.
(didFinishLoadForFrame): Ditto.
(didFailLoadWithErrorForFrame): Ditto.
(canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
(didReceiveAuthenticationChallengeInFrame): Ditto.
(didStartProgress): Ditto.
(didChangeProgress): Ditto.
(didFinishProgress): Ditto.
(didChangeBackForwardList): Ditto.
(processDidCrash): Ditto.
(setUpPageLoaderClient): Ditto.
(setUpPagePolicyClient): Ditto.
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
(createWKArray): Ditto.
(-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
(-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
* UIProcess/API/Cocoa/WKConnection.mm:
(didReceiveMessage): Ditto.
(didClose): Ditto.
(setUpClient): Ditto.
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didCreateConnection): Ditto.
(getInjectedBundleInitializationUserData): Ditto.
(setUpInjectedBundleClient): Ditto.
(-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
(-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView _didTakeSnapshot:]): Ditto.

* UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.

* UIProcess/Authentication/mac/WebCredentialMac.mm:
(WebKit::chain): Use __bridge for cast.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
Use CFBridgingRelease instead of adoptNS.
(WebKit::privateBrowsingSession): Use __bridge for cast.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Ditto.
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]): Ditto.
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
(didCreatePage): Ditto.
(willDestroyPage): Ditto.
(setUpBundleClient): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didStartProvisionalLoadForFrame): Ditto.
(didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
(didFinishLoadForFrame): Ditto.
(globalObjectIsAvailableForFrame): Ditto.
(didRemoveFrameFromHierarchy): Ditto.
(didCommitLoadForFrame): Ditto.
(didFinishDocumentLoadForFrame): Ditto.
(didFailProvisionalLoadWithErrorForFrame): Ditto.
(didFailLoadWithErrorForFrame): Ditto.
(didSameDocumentNavigationForFrame): Ditto.
(didLayoutForFrame): Ditto.
(didReachLayoutMilestone): Ditto.
(didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
(didHandleOnloadEventsForFrame): Ditto.
(userAgentForURL): Ditto.
(setUpPageLoaderClient): Ditto.
(willSendRequestForFrame): Ditto.
(didInitiateLoadForResource): Ditto.
(didFinishLoadForResource): Ditto.
(didFailLoadForResource): Ditto.
(setUpResourceLoadClient): Ditto.
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::initialize): Ditto.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::popUpContextMenu): Ditto.

* WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
an #ifdef __OBJC__ and use __bridge for cast.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
(WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setTopOverhangImage): Ditto.
(WebKit::WebPage::setBottomOverhangImage): Ditto.

Source/WTF:

* wtf/BlockPtr.h: Put Block_copy/release calls into #if since they are
not needed under ARC.

* wtf/OSObjectPtr.h: Added constructor and assignment operator so we can
work with OS objects without adopting them.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232520 268f45cc-cd09-0410-ab3c-d52691b4dbfc

49 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/BlockPtr.h
Source/WTF/wtf/OSObjectPtr.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm
Source/WebKit/Platform/IPC/mac/ConnectionMac.mm
Source/WebKit/Platform/mac/StringUtilities.mm
Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectInterface.mm
Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm
Source/WebKit/Shared/API/c/cf/WKStringCF.mm
Source/WebKit/Shared/API/c/cf/WKURLCF.mm
Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm
Source/WebKit/Shared/Cocoa/DataDetectionResult.mm
Source/WebKit/Shared/Cocoa/WKNSError.mm
Source/WebKit/Shared/Cocoa/WKNSURLExtras.mm
Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h
Source/WebKit/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm
Source/WebKit/Shared/cf/ArgumentCodersCF.cpp
Source/WebKit/Shared/mac/ArgumentCodersMac.mm
Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
Source/WebKit/Shared/mac/WebHitTestResultData.mm
Source/WebKit/UIProcess/API/C/mac/WKContextPrivateMac.mm
Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm
Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextGroup.mm
Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm
Source/WebKit/UIProcess/API/Cocoa/WKProcessGroup.mm
Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm
Source/WebKit/UIProcess/API/Cocoa/_WKUserContentFilter.mm
Source/WebKit/UIProcess/Authentication/mac/WebCredentialMac.mm
Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm
Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm
Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm
Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

index 6a541f0..ea34cfa 100644 (file)
@@ -1,5 +1,18 @@
 2018-06-05  Darin Adler  <darin@apple.com>
 
+        [Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
+        https://bugs.webkit.org/show_bug.cgi?id=186314
+
+        Reviewed by Anders Carlsson.
+
+        * wtf/BlockPtr.h: Put Block_copy/release calls into #if since they are
+        not needed under ARC.
+
+        * wtf/OSObjectPtr.h: Added constructor and assignment operator so we can
+        work with OS objects without adopting them.
+
+2018-06-05  Darin Adler  <darin@apple.com>
+
         [Cocoa] Improve some soft linking compatibility with ARC
         https://bugs.webkit.org/show_bug.cgi?id=186309
 
index ae9e7fb..1258fdd 100644 (file)
@@ -97,8 +97,12 @@ public:
 
         new (&block->f) F { std::move(function) };
 
+#if defined(__OBJC__) && __has_feature(objc_arc)
+        BlockPtr blockPtr { (__bridge_transfer BlockType)block };
+#else
         BlockPtr blockPtr;
         blockPtr.m_block = reinterpret_cast<BlockType>(block);
+#endif
 
         return blockPtr;
     }
@@ -109,12 +113,20 @@ public:
     }
 
     BlockPtr(BlockType block)
+#if defined(__OBJC__) && __has_feature(objc_arc)
+        : m_block(block)
+#else
         : m_block(Block_copy(block))
+#endif
     {
     }
 
     BlockPtr(const BlockPtr& other)
+#if defined(__OBJC__) && __has_feature(objc_arc)
+        : m_block(other.m_block)
+#else
         : m_block(Block_copy(other.m_block))
+#endif
     {
     }
     
@@ -125,16 +137,22 @@ public:
     
     ~BlockPtr()
     {
+#if !defined(__OBJC__) || !__has_feature(objc_arc)
         Block_release(m_block);
+#endif
     }
 
     BlockPtr& operator=(const BlockPtr& other)
     {
+#if defined(__OBJC__) && __has_feature(objc_arc)
+        m_block = other.m_block;
+#else
         if (this != &other) {
             Block_release(m_block);
             m_block = Block_copy(other.m_block);
         }
-        
+#endif
+
         return *this;
     }
 
@@ -142,7 +160,9 @@ public:
     {
         ASSERT(this != &other);
 
+#if !defined(__OBJC__) || !__has_feature(objc_arc)
         Block_release(m_block);
+#endif
         m_block = std::exchange(other.m_block, nullptr);
 
         return *this;
@@ -174,4 +194,3 @@ inline BlockPtr<R (Args...)> makeBlockPtr(R (^block)(Args...))
 
 using WTF::BlockPtr;
 using WTF::makeBlockPtr;
-
index 7219948..21a8fe9 100644 (file)
@@ -85,6 +85,13 @@ public:
         other.m_ptr = nullptr;
     }
 
+    OSObjectPtr(T ptr)
+        : m_ptr(ptr)
+    {
+        if (m_ptr)
+            retainOSObject(m_ptr);
+    }
+
     OSObjectPtr& operator=(const OSObjectPtr& other)
     {
         OSObjectPtr ptr = other;
@@ -108,6 +115,13 @@ public:
         return *this;
     }
 
+    OSObjectPtr& operator=(T other)
+    {
+        OSObjectPtr ptr = other;
+        swap(ptr);
+        return *this;
+    }
+
     void swap(OSObjectPtr& other)
     {
         std::swap(m_ptr, other.m_ptr);
index d636609..ca0aeef 100644 (file)
@@ -1,3 +1,183 @@
+2018-06-05  Darin Adler  <darin@apple.com>
+
+        [Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
+        https://bugs.webkit.org/show_bug.cgi?id=186314
+
+        Reviewed by Anders Carlsson.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
+        * NetworkProcess/mac/NetworkProcessMac.mm:
+        (WebKit::overrideSystemProxies): Ditto.
+        (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
+        * Platform/IPC/mac/ConnectionMac.mm:
+        (IPC::Connection::sendMessage): Ditto.
+        (IPC::readFromMachPort): Ditto.
+
+        * Platform/mac/StringUtilities.mm:
+        (WebKit::formattedPhoneNumberString): Use __bridge for cast and
+        CFBridgingRelease instead of an explicit autorelease.
+
+        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
+        (initializeMethods): Use auto instead of an explicit type so that we get
+        the correct type for the result of protocol_copyProtocolList.
+
+        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
+        (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
+        bridging cast to void* because that's needed to call _Block_signature
+        under ARC and harmless outside ARC.
+
+        * Shared/API/c/cf/WKStringCF.mm:
+        (WKStringCreateWithCFString): Use __bridge for cast.
+        * Shared/API/c/cf/WKURLCF.mm:
+        (WKURLCreateWithCFURL): Ditto.
+        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
+        (WebKit::AuthenticationManager::initializeConnection): Ditto.
+        * Shared/Cocoa/DataDetectionResult.mm:
+        (WebKit::DataDetectionResult::encode const): Ditto.
+        (WebKit::DataDetectionResult::decode): Ditto.
+        * Shared/Cocoa/WKNSError.mm:
+        (-[WKNSError _web_createTarget]): Ditto.
+        * Shared/Cocoa/WKNSURLExtras.mm:
+        (-[NSURL _web_originalDataAsWTFString]): Ditto.
+
+        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
+        (WebKit::XPCServiceInitializer): Removed balanced calls to both
+        adoptOSObject and xpc_retain and instead rely on the assignment
+        operator just added to OSObjectPtr.
+
+        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
+        (WebKit::XPCServiceEventHandler): Use __bridge for cast.
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
+        * Shared/cf/ArgumentCodersCF.cpp:
+        (IPC::decode): Ditto.
+        * Shared/mac/ArgumentCodersMac.mm:
+        (IPC::isSerializableValue): Ditto.
+        (IPC::encode): Ditto.
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
+        when we need a CFString.
+        (IPC::decodeNSError): Ditto.
+        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
+        (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
+        (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
+        (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
+        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
+        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
+        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
+        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
+        * Shared/mac/WebHitTestResultData.mm:
+        (WebKit::WebHitTestResultData::platformEncode const): Ditto.
+        (WebKit::WebHitTestResultData::platformDecode): Ditto.
+        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
+        (WKContextIsPlugInUpdateAvailable): Ditto.
+        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
+        (-[WKBrowsingContextController certificateChain]): Ditto.
+        (didStartProvisionalLoadForFrame): Ditto.
+        (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
+        (didFailProvisionalLoadWithErrorForFrame): Ditto.
+        (didCommitLoadForFrame): Ditto.
+        (didFinishLoadForFrame): Ditto.
+        (didFailLoadWithErrorForFrame): Ditto.
+        (canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
+        (didReceiveAuthenticationChallengeInFrame): Ditto.
+        (didStartProgress): Ditto.
+        (didChangeProgress): Ditto.
+        (didFinishProgress): Ditto.
+        (didChangeBackForwardList): Ditto.
+        (processDidCrash): Ditto.
+        (setUpPageLoaderClient): Ditto.
+        (setUpPagePolicyClient): Ditto.
+        * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
+        (createWKArray): Ditto.
+        (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
+        (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
+        * UIProcess/API/Cocoa/WKConnection.mm:
+        (didReceiveMessage): Ditto.
+        (didClose): Ditto.
+        (setUpClient): Ditto.
+        * UIProcess/API/Cocoa/WKProcessGroup.mm:
+        (didCreateConnection): Ditto.
+        (getInjectedBundleInitializationUserData): Ditto.
+        (setUpInjectedBundleClient): Ditto.
+        (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
+        (-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
+        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
+        (-[_WKThumbnailView _didTakeSnapshot:]): Ditto.
+
+        * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.
+
+        * UIProcess/Authentication/mac/WebCredentialMac.mm:
+        (WebKit::chain): Use __bridge for cast.
+
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
+        Use CFBridgingRelease instead of adoptNS.
+        (WebKit::privateBrowsingSession): Use __bridge for cast.
+
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
+        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+        (WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
+        (WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
+        * UIProcess/mac/ViewGestureControllerMac.mm:
+        (WebKit::ViewGestureController::beginSwipeGesture): Ditto.
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController enterFullScreen:]): Ditto.
+        * UIProcess/mac/WebPopupMenuProxyMac.mm:
+        (WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
+        (didCreatePage): Ditto.
+        (willDestroyPage): Ditto.
+        (setUpBundleClient): Ditto.
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        (didStartProvisionalLoadForFrame): Ditto.
+        (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
+        (didFinishLoadForFrame): Ditto.
+        (globalObjectIsAvailableForFrame): Ditto.
+        (didRemoveFrameFromHierarchy): Ditto.
+        (didCommitLoadForFrame): Ditto.
+        (didFinishDocumentLoadForFrame): Ditto.
+        (didFailProvisionalLoadWithErrorForFrame): Ditto.
+        (didFailLoadWithErrorForFrame): Ditto.
+        (didSameDocumentNavigationForFrame): Ditto.
+        (didLayoutForFrame): Ditto.
+        (didReachLayoutMilestone): Ditto.
+        (didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
+        (didHandleOnloadEventsForFrame): Ditto.
+        (userAgentForURL): Ditto.
+        (setUpPageLoaderClient): Ditto.
+        (willSendRequestForFrame): Ditto.
+        (didInitiateLoadForResource): Ditto.
+        (didFinishLoadForResource): Ditto.
+        (didFailLoadForResource): Ditto.
+        (setUpResourceLoadClient): Ditto.
+        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
+        (WebKit::InjectedBundle::initialize): Ditto.
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        (WebKit::NetscapePlugin::popUpContextMenu): Ditto.
+
+        * WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
+        an #ifdef __OBJC__ and use __bridge for cast.
+
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.
+
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
+        (WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
+        (WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::setTopOverhangImage): Ditto.
+        (WebKit::WebPage::setBottomOverhangImage): Ditto.
+
 2018-06-05  Youenn Fablet  <youenn@apple.com>
 
         ServiceWorker registration should store any script fetched through importScripts
index 66b306d..d4ea9ac 100644 (file)
@@ -677,7 +677,7 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkSessionCreationParameters&& para
     configuration.URLCache = nil;
 
     if (auto& data = globalSourceApplicationAuditTokenData())
-        configuration._sourceApplicationAuditTokenData = (NSData *)data.get();
+        configuration._sourceApplicationAuditTokenData = (__bridge NSData *)data.get();
 
     auto& sourceApplicationBundleIdentifier = globalSourceApplicationBundleIdentifier();
     if (!sourceApplicationBundleIdentifier.isEmpty()) {
index 5fd40da..c2e0868 100644 (file)
@@ -97,7 +97,7 @@ static void overrideSystemProxies(const String& httpProxy, const String& httpsPr
     }
 
     if ([proxySettings count] > 0)
-        _CFNetworkSetOverrideSystemProxySettings((CFDictionaryRef)proxySettings);
+        _CFNetworkSetOverrideSystemProxySettings((__bridge CFDictionaryRef)proxySettings);
 }
 
 void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters& parameters)
@@ -115,7 +115,7 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
 
 void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host)
 {
-    [NSURLRequest setAllowsSpecificHTTPSCertificate:(NSArray *)certificateInfo.certificateChain() forHost:(NSString *)host];
+    [NSURLRequest setAllowsSpecificHTTPSCertificate:(__bridge NSArray *)certificateInfo.certificateChain() forHost:(NSString *)host];
 }
 
 void NetworkProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
index 1f7b7b7..9c7afce 100644 (file)
@@ -268,7 +268,7 @@ bool Connection::sendMessage(std::unique_ptr<MachMessage> message)
         return false;
 
     default:
-        WebKit::setCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x, message '%s::%s'", kr, message->messageReceiverName().data(), message->messageName().data()]);
+        WebKit::setCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x, message '%s::%s'", kr, message->messageReceiverName().data(), message->messageName().data()]);
         CRASH();
     }
 }
@@ -501,7 +501,7 @@ static mach_msg_header_t* readFromMachPort(mach_port_t machPort, ReceiveBuffer&
 
     if (kr != MACH_MSG_SUCCESS) {
 #if !ASSERT_DISABLED
-        WebKit::setCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg, receive port is %x", kr, machPort]);
+        WebKit::setCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg, receive port is %x", kr, machPort]);
 #endif
         ASSERT_NOT_REACHED();
         return nullptr;
index 46de560..5c96793 100644 (file)
@@ -62,7 +62,7 @@ NSString *formattedPhoneNumberString(NSString *originalPhoneNumber)
 {
     NSString *countryCode = [[[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] lowercaseString];
 
-    RetainPtr<CFPhoneNumberRef> phoneNumber = adoptCF(CFPhoneNumberCreate(kCFAllocatorDefault, (CFStringRef)originalPhoneNumber, (CFStringRef)countryCode));
+    RetainPtr<CFPhoneNumberRef> phoneNumber = adoptCF(CFPhoneNumberCreate(kCFAllocatorDefault, (__bridge CFStringRef)originalPhoneNumber, (__bridge CFStringRef)countryCode));
     if (!phoneNumber)
         return originalPhoneNumber;
 
@@ -70,7 +70,7 @@ NSString *formattedPhoneNumberString(NSString *originalPhoneNumber)
     if (!phoneNumberString)
         phoneNumberString = CFPhoneNumberCopyUnformattedRepresentation(phoneNumber.get());
 
-    return [(NSString *)phoneNumberString autorelease];
+    return CFBridgingRelease(phoneNumberString);
 }
 
 #else
index bc1c4b9..c137140 100644 (file)
@@ -162,14 +162,12 @@ static void initializeMethods(_WKRemoteObjectInterface *interface, Protocol *pro
 static void initializeMethods(_WKRemoteObjectInterface *interface, Protocol *protocol)
 {
     unsigned conformingProtocolCount;
-    Protocol** conformingProtocols = protocol_copyProtocolList(interface->_protocol, &conformingProtocolCount);
+    auto conformingProtocols = protocol_copyProtocolList(interface->_protocol, &conformingProtocolCount);
 
     for (unsigned i = 0; i < conformingProtocolCount; ++i) {
-        Protocol* conformingProtocol = conformingProtocols[i];
-
+        auto conformingProtocol = conformingProtocols[i];
         if (conformingProtocol == @protocol(NSObject))
             continue;
-
         initializeMethods(interface, conformingProtocol);
     }
 
index 3fc7318..39216b3 100644 (file)
@@ -147,7 +147,7 @@ static uint64_t generateReplyIdentifier()
         if (!replyBlock)
             [NSException raise:NSInvalidArgumentException format:@"A NULL reply block was passed into a message. (%s)", sel_getName(invocation.selector)];
 
-        const char* replyBlockSignature = _Block_signature(replyBlock);
+        const char* replyBlockSignature = _Block_signature((__bridge void*)replyBlock);
 
         if (strcmp([NSMethodSignature signatureWithObjCTypes:replyBlockSignature].methodReturnType, "v"))
             [NSException raise:NSInvalidArgumentException format:@"Return value of block argument must be 'void'. (%s)", sel_getName(invocation.selector)];
index 24be387..61d1d47 100644 (file)
@@ -50,7 +50,7 @@ WKStringRef WKStringCreateWithCFString(CFStringRef cfString)
 {
 #if WK_API_ENABLED
     // Since WKNSString is an internal class with no subclasses, we can do a simple equality check.
-    if (object_getClass((NSString *)cfString) == wkNSStringClass())
+    if (object_getClass((__bridge NSString *)cfString) == wkNSStringClass())
         return toAPI(static_cast<API::String*>(&[(WKNSString *)[(NSString *)cfString retain] _apiObject]));
 #endif
     String string(cfString);
index 1a9c5fd..ee627b3 100644 (file)
@@ -54,7 +54,7 @@ WKURLRef WKURLCreateWithCFURL(CFURLRef cfURL)
 
 #if WK_API_ENABLED
     // Since WKNSURL is an internal class with no subclasses, we can do a simple equality check.
-    if (object_getClass((NSURL *)cfURL) == wkNSURLClass())
+    if (object_getClass((__bridge NSURL *)cfURL) == wkNSURLClass())
         return toAPI(static_cast<API::URL*>(&[(WKNSURL *)[(NSURL *)cfURL retain] _apiObject]));
 #endif
 
index 60c0803..a2cf7ea 100644 (file)
@@ -83,7 +83,7 @@ void AuthenticationManager::initializeConnection(IPC::Connection* connection)
                 auto certificate = adoptCF(SecCertificateCreateWithData(nullptr, cfData.get()));
                 if (!certificate)
                     return;
-                [certificates addObject:(id)certificate.get()];
+                [certificates addObject:(__bridge id)certificate.get()];
             }
         }
 
index 457d7a0..af42146 100644 (file)
@@ -43,7 +43,7 @@ void DataDetectionResult::encode(IPC::Encoder& encoder) const
 {
     auto archiver = secureArchiver();
     [archiver encodeObject:results.get() forKey:@"dataDetectorResults"];
-    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
+    IPC::encode(encoder, (__bridge CFDataRef)archiver.get().encodedData);
 }
 
 bool DataDetectionResult::decode(IPC::Decoder& decoder, DataDetectionResult& result)
@@ -52,7 +52,7 @@ bool DataDetectionResult::decode(IPC::Decoder& decoder, DataDetectionResult& res
     if (!IPC::decode(decoder, data))
         return false;
 
-    auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
+    auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get());
     @try {
         result.results = [unarchiver decodeObjectOfClasses:[NSSet setWithArray:@[ [NSArray class], getDDScannerResultClass()] ] forKey:@"dataDetectorResults"];
     } @catch (NSException *exception) {
index 820594e..94204de 100644 (file)
@@ -34,7 +34,7 @@
 
 - (NSObject *)_web_createTarget
 {
-    return [(NSError *)static_cast<API::Error*>(&self._apiObject)->platformError().cfError() copy];
+    return [(__bridge NSError *)static_cast<API::Error*>(&self._apiObject)->platformError().cfError() copy];
 }
 
 #pragma mark NSCopying protocol implementation
index 895afe9..1a8363e 100644 (file)
@@ -50,7 +50,7 @@ using namespace WebCore;
 - (String)_web_originalDataAsWTFString
 {
     CString originalData;
-    getURLBytes((CFURLRef)self, originalData);
+    getURLBytes((__bridge CFURLRef)self, originalData);
     return String::fromUTF8(originalData);
 }
 
index 75828fd..209e20a 100644 (file)
@@ -83,7 +83,7 @@ void XPCServiceInitializer(OSObjectPtr<xpc_connection_t> connection, xpc_object_
 
     ChildProcessInitializationParameters parameters;
     if (priorityBoostMessage)
-        parameters.priorityBoostMessage = adoptOSObject(xpc_retain(priorityBoostMessage));
+        parameters.priorityBoostMessage = priorityBoostMessage;
 
     if (!delegate.getConnectionIdentifier(parameters.connectionIdentifier))
         exit(EXIT_FAILURE);
index 46687f1..5919a32 100644 (file)
@@ -59,7 +59,7 @@ static void XPCServiceEventHandler(xpc_connection_t peer)
                 typedef void (*InitializerFunction)(xpc_connection_t, xpc_object_t, xpc_object_t);
                 InitializerFunction initializerFunctionPtr = reinterpret_cast<InitializerFunction>(CFBundleGetFunctionPointerForName(webKitBundle, entryPointFunctionName));
                 if (!initializerFunctionPtr) {
-                    NSLog(@"Unable to find entry point in WebKit.framework with name: %@", (NSString *)entryPointFunctionName);
+                    NSLog(@"Unable to find entry point in WebKit.framework with name: %@", (__bridge NSString *)entryPointFunctionName);
                     exit(EXIT_FAILURE);
                 }
 
index 3dd5afc..b9a6afe 100644 (file)
@@ -411,7 +411,7 @@ void RemoteLayerBackingStore::applyBackingStoreToLayer(CALayer *layer, LayerCont
             break;
         case LayerContentsType::CAMachPort:
             ASSERT(m_frontBufferSendRight);
-            layer.contents = (id)adoptCF(CAMachPortCreate(m_frontBufferSendRight.leakSendRight())).get();
+            layer.contents = (__bridge id)adoptCF(CAMachPortCreate(m_frontBufferSendRight.leakSendRight())).get();
             break;
         }
         return;
@@ -419,7 +419,7 @@ void RemoteLayerBackingStore::applyBackingStoreToLayer(CALayer *layer, LayerCont
 #endif
 
     ASSERT(!acceleratesDrawing());
-    layer.contents = (id)m_frontBuffer.bitmap->makeCGImageCopy().get();
+    layer.contents = (__bridge id)m_frontBuffer.bitmap->makeCGImageCopy().get();
 }
 
 RetainPtr<CGContextRef> RemoteLayerBackingStore::takeFrontContextPendingFlush()
index f50b082..b430e6c 100644 (file)
@@ -624,7 +624,7 @@ bool decode(Decoder& decoder, RetainPtr<CFURLRef>& result)
     if (urlBytes.isEmpty()) {
         // CFURL can't hold an empty URL, unlike NSURL.
         // FIXME: This discards base URL, which seems incorrect.
-        result = reinterpret_cast<CFURLRef>([NSURL URLWithString:@""]);
+        result = (__bridge CFURLRef)[NSURL URLWithString:@""];
         return true;
     }
 #endif
index 3170eee..d15c904 100644 (file)
@@ -243,7 +243,7 @@ static inline bool isSerializableValue(id value)
 #else
     auto fontClass = [UIFont class];
 #endif
-    return ![value isKindOfClass:fontClass] || isSerializableFont(reinterpret_cast<CTFontRef>(value));
+    return ![value isKindOfClass:fontClass] || isSerializableFont((__bridge CTFontRef)value);
 }
 
 static inline RetainPtr<NSDictionary> filterUnserializableValues(NSDictionary *dictionary)
@@ -425,7 +425,7 @@ bool decode(Decoder& decoder, RetainPtr<NSFont>& result)
 
 void encode(Encoder& encoder, NSNumber *number)
 {
-    encode(encoder, (CFNumberRef)number);
+    encode(encoder, (__bridge CFNumberRef)number);
 }
 
 bool decode(Decoder& decoder, RetainPtr<NSNumber>& result)
@@ -440,7 +440,7 @@ bool decode(Decoder& decoder, RetainPtr<NSNumber>& result)
 
 void encode(Encoder& encoder, NSString *string)
 {
-    encode(encoder, (CFStringRef)string);
+    encode(encoder, (__bridge CFStringRef)string);
 }
 
 bool decode(Decoder& decoder, RetainPtr<NSString>& result)
@@ -492,7 +492,7 @@ bool decode(Decoder& decoder, RetainPtr<NSArray>& result)
 
 void encode(Encoder& encoder, NSDate *date)
 {
-    encode(encoder, (CFDateRef)date);
+    encode(encoder, (__bridge CFDateRef)date);
 }
 
 bool decode(Decoder& decoder, RetainPtr<NSDate>& result)
@@ -507,7 +507,7 @@ bool decode(Decoder& decoder, RetainPtr<NSDate>& result)
 
 void encode(Encoder& encoder, NSData *data)
 {
-    encode(encoder, (CFDataRef)data);
+    encode(encoder, (__bridge CFDataRef)data);
 }
 
 bool decode(Decoder& decoder, RetainPtr<NSData>& result)
@@ -522,7 +522,7 @@ bool decode(Decoder& decoder, RetainPtr<NSData>& result)
 
 void encode(Encoder& encoder, NSURL *URL)
 {
-    encode(encoder, (CFURLRef)URL);
+    encode(encoder, (__bridge CFURLRef)URL);
 }
 
 bool decode(Decoder& decoder, RetainPtr<NSURL>& result)
index a0a400f..3985cdc 100644 (file)
@@ -321,14 +321,14 @@ static void encodeNSError(Encoder& encoder, NSError *nsError)
 
     [userInfo enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL*) {
         if ([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSURL class]] || [value isKindOfClass:[NSNumber class]])
-            CFDictionarySetValue(filteredUserInfo.get(), key, value);
+            CFDictionarySetValue(filteredUserInfo.get(), (__bridge CFTypeRef)key, (__bridge CFTypeRef)value);
     }];
 
     if (NSArray *clientIdentityAndCertificates = [userInfo objectForKey:@"NSErrorClientCertificateChainKey"]) {
         ASSERT([clientIdentityAndCertificates isKindOfClass:[NSArray class]]);
         ASSERT(^{
             for (id object in clientIdentityAndCertificates) {
-                if (CFGetTypeID(object) != SecIdentityGetTypeID() && CFGetTypeID(object) != SecCertificateGetTypeID())
+                if (CFGetTypeID((__bridge CFTypeRef)object) != SecIdentityGetTypeID() && CFGetTypeID((__bridge CFTypeRef)object) != SecCertificateGetTypeID())
                     return false;
             }
             return true;
@@ -337,7 +337,7 @@ static void encodeNSError(Encoder& encoder, NSError *nsError)
         // Turn SecIdentity members into SecCertificate to strip out private key information.
         id clientCertificates = [NSMutableArray arrayWithCapacity:clientIdentityAndCertificates.count];
         for (id object in clientIdentityAndCertificates) {
-            if (CFGetTypeID(object) != SecIdentityGetTypeID()) {
+            if (CFGetTypeID((__bridge CFTypeRef)object) != SecIdentityGetTypeID()) {
                 [clientCertificates addObject:object];
                 continue;
             }
@@ -351,27 +351,27 @@ static void encodeNSError(Encoder& encoder, NSError *nsError)
                 clientCertificates = nil;
                 break;
             }
-            [clientCertificates addObject:(id)certificate];
+            [clientCertificates addObject:(__bridge id)certificate];
         }
-        CFDictionarySetValue(filteredUserInfo.get(), @"NSErrorClientCertificateChainKey", clientCertificates);
+        CFDictionarySetValue(filteredUserInfo.get(), CFSTR("NSErrorClientCertificateChainKey"), (__bridge CFTypeRef)clientCertificates);
     }
 
     id peerCertificateChain = [userInfo objectForKey:@"NSErrorPeerCertificateChainKey"];
     if (!peerCertificateChain) {
-        if (SecTrustRef peerTrust = (SecTrustRef)[userInfo objectForKey:NSURLErrorFailingURLPeerTrustErrorKey]) {
+        if (SecTrustRef peerTrust = (__bridge SecTrustRef)[userInfo objectForKey:NSURLErrorFailingURLPeerTrustErrorKey]) {
             CFIndex count = SecTrustGetCertificateCount(peerTrust);
             peerCertificateChain = [NSMutableArray arrayWithCapacity:count];
             for (CFIndex i = 0; i < count; ++i)
-                [peerCertificateChain addObject:(id)SecTrustGetCertificateAtIndex(peerTrust, i)];
+                [peerCertificateChain addObject:(__bridge id)SecTrustGetCertificateAtIndex(peerTrust, i)];
         }
     }
     ASSERT(!peerCertificateChain || [peerCertificateChain isKindOfClass:[NSArray class]]);
     if (peerCertificateChain)
-        CFDictionarySetValue(filteredUserInfo.get(), @"NSErrorPeerCertificateChainKey", peerCertificateChain);
+        CFDictionarySetValue(filteredUserInfo.get(), CFSTR("NSErrorPeerCertificateChainKey"), (__bridge CFTypeRef)peerCertificateChain);
 
 #if HAVE(SEC_TRUST_SERIALIZATION)
-    if (SecTrustRef peerTrust = (SecTrustRef)[userInfo objectForKey:NSURLErrorFailingURLPeerTrustErrorKey])
-        CFDictionarySetValue(filteredUserInfo.get(), NSURLErrorFailingURLPeerTrustErrorKey, peerTrust);
+    if (SecTrustRef peerTrust = (__bridge SecTrustRef)[userInfo objectForKey:NSURLErrorFailingURLPeerTrustErrorKey])
+        CFDictionarySetValue(filteredUserInfo.get(), (__bridge CFStringRef)NSURLErrorFailingURLPeerTrustErrorKey, peerTrust);
 #endif
 
     IPC::encode(encoder, filteredUserInfo.get());
@@ -413,11 +413,11 @@ static bool decodeNSError(Decoder& decoder, RetainPtr<NSError>& nsError)
             return false;
 
         auto mutableUserInfo = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, CFDictionaryGetCount(userInfo.get()) + 1, userInfo.get()));
-        CFDictionarySetValue(mutableUserInfo.get(), NSUnderlyingErrorKey, underlyingNSError.get());
+        CFDictionarySetValue(mutableUserInfo.get(), (__bridge CFStringRef)NSUnderlyingErrorKey, (__bridge CFTypeRef)underlyingNSError.get());
         userInfo = WTFMove(mutableUserInfo);
     }
 
-    nsError = adoptNS([[NSError alloc] initWithDomain:domain code:code userInfo:(NSDictionary *)userInfo.get()]);
+    nsError = adoptNS([[NSError alloc] initWithDomain:domain code:code userInfo:(__bridge NSDictionary *)userInfo.get()]);
     return true;
 }
 
@@ -435,7 +435,7 @@ void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder& encoder, const
 {
     auto archiver = secureArchiver();
     [archiver encodeObject:space.nsSpace() forKey:@"protectionSpace"];
-    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
+    IPC::encode(encoder, (__bridge CFDataRef)archiver.get().encodedData);
 }
 
 bool ArgumentCoder<ProtectionSpace>::decodePlatformData(Decoder& decoder, ProtectionSpace& space)
@@ -444,7 +444,7 @@ bool ArgumentCoder<ProtectionSpace>::decodePlatformData(Decoder& decoder, Protec
     if (!IPC::decode(decoder, data))
         return false;
 
-    auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
+    auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get());
     @try {
         if (RetainPtr<NSURLProtectionSpace> nsSpace = [unarchiver decodeObjectOfClass:[NSURLProtectionSpace class] forKey:@"protectionSpace"])
             space = ProtectionSpace(nsSpace.get());
@@ -467,7 +467,7 @@ void ArgumentCoder<Credential>::encodePlatformData(Encoder& encoder, const Crede
 
         if (NSArray *certificates = nsCredential.certificates) {
             encoder << true;
-            IPC::encode(encoder, reinterpret_cast<CFArrayRef>(certificates));
+            IPC::encode(encoder, (__bridge CFArrayRef)certificates);
         } else
             encoder << false;
 
@@ -479,7 +479,7 @@ void ArgumentCoder<Credential>::encodePlatformData(Encoder& encoder, const Crede
 
     auto archiver = secureArchiver();
     [archiver encodeObject:nsCredential forKey:@"credential"];
-    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
+    IPC::encode(encoder, (__bridge CFArrayRef)archiver.get().encodedData);
 }
 
 bool ArgumentCoder<Credential>::decodePlatformData(Decoder& decoder, Credential& credential)
@@ -507,7 +507,7 @@ bool ArgumentCoder<Credential>::decodePlatformData(Decoder& decoder, Credential&
         if (!decoder.decode(persistence))
             return false;
 
-        credential = Credential(adoptNS([[NSURLCredential alloc] initWithIdentity:identity.get() certificates:(NSArray *)certificates.get() persistence:(NSURLCredentialPersistence)persistence]).get());
+        credential = Credential(adoptNS([[NSURLCredential alloc] initWithIdentity:identity.get() certificates:(__bridge NSArray *)certificates.get() persistence:(NSURLCredentialPersistence)persistence]).get());
         return true;
     }
 
@@ -515,7 +515,7 @@ bool ArgumentCoder<Credential>::decodePlatformData(Decoder& decoder, Credential&
     if (!IPC::decode(decoder, data))
         return false;
 
-    auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
+    auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get());
     @try {
         if (RetainPtr<NSURLCredential> nsCredential = [unarchiver decodeObjectOfClass:[NSURLCredential class] forKey:@"credential"])
             credential = Credential(nsCredential.get());
@@ -574,11 +574,12 @@ std::optional<KeypressCommand> ArgumentCoder<KeypressCommand>::decode(Decoder& d
 }
 
 #if ENABLE(CONTENT_FILTERING)
+
 void ArgumentCoder<ContentFilterUnblockHandler>::encode(Encoder& encoder, const ContentFilterUnblockHandler& contentFilterUnblockHandler)
 {
     auto archiver = secureArchiver();
     contentFilterUnblockHandler.encode(archiver.get());
-    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
+    IPC::encode(encoder, (__bridge CFDataRef)archiver.get().encodedData);
 }
 
 bool ArgumentCoder<ContentFilterUnblockHandler>::decode(Decoder& decoder, ContentFilterUnblockHandler& contentFilterUnblockHandler)
@@ -587,13 +588,14 @@ bool ArgumentCoder<ContentFilterUnblockHandler>::decode(Decoder& decoder, Conten
     if (!IPC::decode(decoder, data))
         return false;
 
-    auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
+    auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get());
     if (!ContentFilterUnblockHandler::decode(unarchiver.get(), contentFilterUnblockHandler))
         return false;
 
     [unarchiver finishDecoding];
     return true;
 }
+
 #endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
@@ -611,7 +613,7 @@ void ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData(Encoder& enco
     if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
         [archiver encodeObject:target.avOutputContext() forKey:deviceContextKey()];
 
-    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
+    IPC::encode(encoder, (__bridge CFDataRef)archiver.get().encodedData);
 }
 
 bool ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData(Decoder& decoder, MediaPlaybackTargetContext& target)
@@ -623,7 +625,7 @@ bool ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData(Decoder& deco
     if (!IPC::decode(decoder, data))
         return false;
 
-    auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
+    auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get());
 
     AVOutputContext *context = nil;
     @try {
@@ -638,6 +640,7 @@ bool ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData(Decoder& deco
     [unarchiver finishDecoding];
     return true;
 }
+
 #endif
 
 } // namespace IPC
index 1dc0049..588c5e5 100644 (file)
@@ -48,7 +48,7 @@ void WebHitTestResultData::platformEncode(IPC::Encoder& encoder) const
     auto archiver = secureArchiver();
     [archiver encodeObject:detectedDataActionContext.get() forKey:@"actionContext"];
 
-    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
+    IPC::encode(encoder, (__bridge CFDataRef)archiver.get().encodedData);
 
     encoder << detectedDataBoundingBox;
     encoder << detectedDataOriginatingPageOverlay;
@@ -73,7 +73,7 @@ bool WebHitTestResultData::platformDecode(IPC::Decoder& decoder, WebHitTestResul
     if (!IPC::decode(decoder, data))
         return false;
 
-    auto unarchiver = secureUnarchiverFromData((NSData *)data.get());
+    auto unarchiver = secureUnarchiverFromData((__bridge NSData *)data.get());
     @try {
         hitTestResultData.detectedDataActionContext = [unarchiver decodeObjectOfClass:getDDActionContextClass() forKey:@"actionContext"];
     } @catch (NSException *exception) {
index 7f93c1e..1d811ac 100644 (file)
@@ -49,7 +49,7 @@ bool WKContextIsPlugInUpdateAvailable(WKContextRef contextRef, WKStringRef plugI
 #if PLATFORM(IOS)
     return false;
 #else
-    return WebCore::PluginBlacklist::isPluginUpdateAvailable((NSString *)adoptCF(WKStringCopyCFString(kCFAllocatorDefault, plugInBundleIdentifierRef)).get());
+    return WebCore::PluginBlacklist::isPluginUpdateAvailable((__bridge NSString *)adoptCF(WKStringCopyCFString(kCFAllocatorDefault, plugInBundleIdentifierRef)).get());
 #endif
 }
 
index bb6be7e..10d0115 100644 (file)
@@ -296,7 +296,7 @@ static HashMap<WebPageProxy*, WKBrowsingContextController *>& browsingContextCon
 - (NSArray *)certificateChain
 {
     if (WebFrameProxy* mainFrame = _page->mainFrame())
-        return mainFrame->certificateInfo() ? (NSArray *)mainFrame->certificateInfo()->certificateInfo().certificateChain() : nil;
+        return mainFrame->certificateInfo() ? (__bridge NSArray *)mainFrame->certificateInfo()->certificateInfo().certificateChain() : nil;
 
     return nil;
 }
@@ -328,7 +328,7 @@ static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WK
     if (!WKFrameIsMainFrame(frame))
         return;
 
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidStartProvisionalLoad:)])
@@ -340,7 +340,7 @@ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, W
     if (!WKFrameIsMainFrame(frame))
         return;
 
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidReceiveServerRedirectForProvisionalLoad:)])
@@ -352,7 +352,7 @@ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef f
     if (!WKFrameIsMainFrame(frame))
         return;
 
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextController:didFailProvisionalLoadWithError:)])
@@ -364,7 +364,7 @@ static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
     if (!WKFrameIsMainFrame(frame))
         return;
 
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidCommitLoad:)])
@@ -376,7 +376,7 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
     if (!WKFrameIsMainFrame(frame))
         return;
 
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidFinishLoad:)])
@@ -388,7 +388,7 @@ static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErr
     if (!WKFrameIsMainFrame(frame))
         return;
 
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextController:didFailLoadWithError:)])
@@ -397,7 +397,7 @@ static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErr
 
 static bool canAuthenticateAgainstProtectionSpaceInFrame(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextController:canAuthenticateAgainstProtectionSpace:)])
@@ -408,7 +408,7 @@ static bool canAuthenticateAgainstProtectionSpaceInFrame(WKPageRef page, WKFrame
 
 static void didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextController:didReceiveAuthenticationChallenge:)])
@@ -417,7 +417,7 @@ static void didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef
 
 static void didStartProgress(WKPageRef page, const void* clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidStartProgress:)])
@@ -426,7 +426,7 @@ static void didStartProgress(WKPageRef page, const void* clientInfo)
 
 static void didChangeProgress(WKPageRef page, const void* clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextController:estimatedProgressChangedTo:)])
@@ -435,7 +435,7 @@ static void didChangeProgress(WKPageRef page, const void* clientInfo)
 
 static void didFinishProgress(WKPageRef page, const void* clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidFinishProgress:)])
@@ -444,7 +444,7 @@ static void didFinishProgress(WKPageRef page, const void* clientInfo)
 
 static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if (![loadDelegate respondsToSelector:@selector(browsingContextControllerDidChangeBackForwardList:addedItem:removedItems:)])
@@ -457,7 +457,7 @@ static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef ad
 
 static void processDidCrash(WKPageRef page, const void* clientInfo)
 {
-    WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     auto loadDelegate = browsingContext->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerWebProcessDidCrash:)])
@@ -470,7 +470,7 @@ static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext,
     memset(&loaderClient, 0, sizeof(loaderClient));
 
     loaderClient.base.version = 4;
-    loaderClient.base.clientInfo = browsingContext;
+    loaderClient.base.clientInfo = (__bridge void*)browsingContext;
     loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
     loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
     loaderClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
@@ -520,11 +520,11 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
     memset(&policyClient, 0, sizeof(policyClient));
 
     policyClient.base.version = 2;
-    policyClient.base.clientInfo = browsingContext;
+    policyClient.base.clientInfo = (__bridge void*)browsingContext;
 
     policyClient.decidePolicyForNavigationAction = [](WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef originalRequest, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
     {
-        WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+        auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
         auto policyDelegate = browsingContext->_policyDelegate.get();
 
         if ([policyDelegate respondsToSelector:@selector(browsingContextController:decidePolicyForNavigationAction:decisionHandler:)]) {
@@ -549,7 +549,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 
     policyClient.decidePolicyForNewWindowAction = [](WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
     {
-        WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+        auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
         auto policyDelegate = browsingContext->_policyDelegate.get();
 
         if ([policyDelegate respondsToSelector:@selector(browsingContextController:decidePolicyForNewWindowAction:decisionHandler:)]) {
@@ -569,7 +569,7 @@ static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext,
 
     policyClient.decidePolicyForResponse = [](WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, bool canShowMIMEType, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
     {
-        WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
+        auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
         auto policyDelegate = browsingContext->_policyDelegate.get();
 
         if ([policyDelegate respondsToSelector:@selector(browsingContextController:decidePolicyForResponseAction:decisionHandler:)]) {
index a70f1d4..96df0d6 100644 (file)
@@ -124,7 +124,7 @@ static WKRetainPtr<WKArrayRef> createWKArray(NSArray *array)
 
     for (id entry in array) {
         if ([entry isKindOfClass:[NSString class]])
-            strings.uncheckedAppend(adoptRef(toImpl(WKStringCreateWithCFString((CFStringRef)entry))));
+            strings.uncheckedAppend(adoptRef(toImpl(WKStringCreateWithCFString((__bridge CFStringRef)entry))));
     }
 
     return toAPI(&API::Array::create(WTFMove(strings)).leakRef());
@@ -135,8 +135,8 @@ static WKRetainPtr<WKArrayRef> createWKArray(NSArray *array)
     if (!source)
         CRASH();
 
-    WKRetainPtr<WKStringRef> wkSource = adoptWK(WKStringCreateWithCFString((CFStringRef)source));
-    WKRetainPtr<WKURLRef> wkBaseURL = adoptWK(WKURLCreateWithCFURL((CFURLRef)baseURL));
+    WKRetainPtr<WKStringRef> wkSource = adoptWK(WKStringCreateWithCFString((__bridge CFStringRef)source));
+    WKRetainPtr<WKURLRef> wkBaseURL = adoptWK(WKURLCreateWithCFURL((__bridge CFURLRef)baseURL));
     auto wkWhitelist = createWKArray(whitelist);
     auto wkBlacklist = createWKArray(blacklist);
     WKUserContentInjectedFrames injectedFrames = mainFrameOnly ? kWKInjectInTopFrameOnly : kWKInjectInAllFrames;
@@ -154,8 +154,8 @@ static WKRetainPtr<WKArrayRef> createWKArray(NSArray *array)
     if (!source)
         CRASH();
 
-    WKRetainPtr<WKStringRef> wkSource = adoptWK(WKStringCreateWithCFString((CFStringRef)source));
-    WKRetainPtr<WKURLRef> wkBaseURL = adoptWK(WKURLCreateWithCFURL((CFURLRef)baseURL));
+    WKRetainPtr<WKStringRef> wkSource = adoptWK(WKStringCreateWithCFString((__bridge CFStringRef)source));
+    WKRetainPtr<WKURLRef> wkBaseURL = adoptWK(WKURLCreateWithCFURL((__bridge CFURLRef)baseURL));
     auto wkWhitelist = createWKArray(whitelist);
     auto wkBlacklist = createWKArray(blacklist);
     WKUserContentInjectedFrames injectedFrames = mainFrameOnly ? kWKInjectInTopFrameOnly : kWKInjectInAllFrames;
index 21d316f..ce23d0e 100644 (file)
@@ -51,7 +51,7 @@ using namespace WebKit;
 
 static void didReceiveMessage(WKConnectionRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
 {
-    WKConnection *connection = (WKConnection *)clientInfo;
+    auto connection = (__bridge WKConnection *)clientInfo;
     auto delegate = connection->_delegate.get();
 
     if ([delegate respondsToSelector:@selector(connection:didReceiveMessageWithName:body:)]) {
@@ -63,7 +63,7 @@ static void didReceiveMessage(WKConnectionRef, WKStringRef messageName, WKTypeRe
 
 static void didClose(WKConnectionRef, const void* clientInfo)
 {
-    WKConnection *connection = (WKConnection *)clientInfo;
+    auto connection = (__bridge WKConnection *)clientInfo;
     auto delegate = connection->_delegate.get();
 
     if ([delegate respondsToSelector:@selector(connectionDidClose:)])
@@ -76,7 +76,7 @@ static void setUpClient(WKConnection *wrapper, WebConnection& connection)
     memset(&client, 0, sizeof(client));
 
     client.base.version = 0;
-    client.base.clientInfo = wrapper;
+    client.base.clientInfo = (__bridge void*)wrapper;
     client.didReceiveMessage = didReceiveMessage;
     client.didClose = didClose;
 
index fb5859a..530ce08 100644 (file)
@@ -66,7 +66,7 @@ using namespace WebKit;
 
 static void didCreateConnection(WKContextRef, WKConnectionRef connectionRef, const void* clientInfo)
 {
-    WKProcessGroup *processGroup = (WKProcessGroup *)clientInfo;
+    auto processGroup = (__bridge WKProcessGroup *)clientInfo;
     auto delegate = processGroup->_delegate.get();
 
     if ([delegate respondsToSelector:@selector(processGroup:didCreateConnectionToWebProcessPlugIn:)])
@@ -87,7 +87,7 @@ static void setUpConnectionClient(WKProcessGroup *processGroup, WKContextRef con
 
 static WKTypeRef getInjectedBundleInitializationUserData(WKContextRef, const void* clientInfo)
 {
-    WKProcessGroup *processGroup = (WKProcessGroup *)clientInfo;
+    auto processGroup = (__bridge WKProcessGroup *)clientInfo;
     auto delegate = processGroup->_delegate.get();
 
     if ([delegate respondsToSelector:@selector(processGroupWillCreateConnectionToWebProcessPlugIn:)]) {
@@ -105,7 +105,7 @@ static void setUpInjectedBundleClient(WKProcessGroup *processGroup, WKContextRef
     memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
 
     injectedBundleClient.base.version = 1;
-    injectedBundleClient.base.clientInfo = processGroup;
+    injectedBundleClient.base.clientInfo = (__bridge void*)processGroup;
     injectedBundleClient.getInjectedBundleInitializationUserData = getInjectedBundleInitializationUserData;
 
     WKContextSetInjectedBundleClient(contextRef, &injectedBundleClient.base);
@@ -223,7 +223,7 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
 
 - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host
 {
-    _processPool->allowSpecificHTTPSCertificateForHost(WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).ptr(), host);
+    _processPool->allowSpecificHTTPSCertificateForHost(WebCertificateInfo::create(WebCore::CertificateInfo((__bridge CFArrayRef)certificateChain)).ptr(), host);
 }
 
 #if PLATFORM(IOS)
index 807a7c5..576a585 100644 (file)
@@ -179,7 +179,7 @@ static WKProcessPool *sharedProcessPool;
 
 - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host
 {
-    _processPool->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).ptr(), host);
+    _processPool->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((__bridge CFArrayRef)certificateChain)).ptr(), host);
 }
 
 - (void)_registerURLSchemeServiceWorkersCanHandle:(NSString *)scheme
index 5c6f13d..56b8a61 100644 (file)
@@ -302,12 +302,12 @@ static Vector<WebKit::WebsiteDataRecord> toWebsiteDataRecords(NSArray *dataRecor
 
 - (void)_setProxyConfiguration:(NSDictionary *)configuration
 {
-    _websiteDataStore->websiteDataStore().setProxyConfiguration((CFDictionaryRef)configuration);
+    _websiteDataStore->websiteDataStore().setProxyConfiguration((__bridge CFDictionaryRef)configuration);
 }
 
 - (NSDictionary *)_proxyConfiguration
 {
-    return (NSDictionary *)_websiteDataStore->websiteDataStore().proxyConfiguration();
+    return (__bridge NSDictionary *)_websiteDataStore->websiteDataStore().proxyConfiguration();
 }
 
 - (void)_resourceLoadStatisticsSetShouldSubmitTelemetry:(BOOL)value
index 3c54f7b..4ea1c58 100644 (file)
@@ -197,7 +197,7 @@ using namespace WebKit;
     _waitingForSnapshot = NO;
     self.layer.sublayers = @[];
     self.layer.contentsGravity = kCAGravityResizeAspectFill;
-    self.layer.contents = (id)image;
+    self.layer.contents = (__bridge id)image;
 
     // If we got a scale change while snapshotting, we'll take another snapshot once the first one returns.
     if (_snapshotWasDeferred) {
index 90288a8..193b42e 100644 (file)
@@ -28,6 +28,7 @@
 
 #if WK_API_ENABLED
 
+#include "WKContentRuleListInternal.h"
 #include "WebCompiledContentRuleList.h"
 #include <WebCore/ContentExtensionCompiler.h>
 #include <WebCore/ContentExtensionError.h>
index 68de3ec..ba0f2c9 100644 (file)
@@ -67,7 +67,7 @@ static NSArray *chain(const CertificateInfo& certificateInfo)
 #endif
     ASSERT(certificateInfo.type() == CertificateInfo::Type::CertificateChain);
     CFIndex chainCount = CFArrayGetCount(certificateInfo.certificateChain());
-    return chainCount > 1 ? [(NSArray *)certificateInfo.certificateChain() subarrayWithRange:NSMakeRange(1, chainCount - 1)] : nil;
+    return chainCount > 1 ? [(__bridge NSArray *)certificateInfo.certificateChain() subarrayWithRange:NSMakeRange(1, chainCount - 1)] : nil;
 }
 
 WebCredential::WebCredential(WebCertificateInfo* certificateInfo)
index 3d18f62..40abf4f 100644 (file)
@@ -480,7 +480,7 @@ String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
 
 String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
 {
-    RetainPtr<NSString> cachePath = adoptNS((NSString *)_CFURLCacheCopyCacheDirectory([[NSURLCache sharedURLCache] _CFURLCache]));
+    NSString *cachePath = CFBridgingRelease(_CFURLCacheCopyCacheDirectory([[NSURLCache sharedURLCache] _CFURLCache]));
     if (!cachePath)
         cachePath = @"~/Library/Caches/com.apple.WebKit.WebProcess";
 
@@ -590,8 +590,7 @@ static CFURLStorageSessionRef privateBrowsingSession()
     static dispatch_once_t once;
     dispatch_once(&once, ^{
         NSString *identifier = [NSString stringWithFormat:@"%@.PrivateBrowsing", [[NSBundle mainBundle] bundleIdentifier]];
-
-        session = createPrivateStorageSession((CFStringRef)identifier);
+        session = createPrivateStorageSession((__bridge CFStringRef)identifier);
     });
 
     return session;
index 96b889b..d64f476 100644 (file)
@@ -3895,7 +3895,7 @@ void WebViewImpl::provideDataForPasteboard(NSPasteboard *pasteboard, NSString *t
     // FIXME: need to support NSRTFDPboardType
 
     if ([type isEqual:WebCore::legacyTIFFPasteboardType()] && m_promisedImage) {
-        [pasteboard setData:(NSData *)m_promisedImage->tiffRepresentation() forType:WebCore::legacyTIFFPasteboardType()];
+        [pasteboard setData:(__bridge NSData *)m_promisedImage->tiffRepresentation() forType:WebCore::legacyTIFFPasteboardType()];
         m_promisedImage = nullptr;
     }
 }
index 257c94c..723d444 100644 (file)
@@ -60,9 +60,9 @@ Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory)
     Vector<String> pluginPaths;
 
     RetainPtr<CFStringRef> directoryCFString = directory.createCFString();
-    NSArray *filenames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:(NSString *)directoryCFString.get() error:nil];
+    NSArray *filenames = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:(__bridge NSString *)directoryCFString.get() error:nil];
     for (NSString *filename in filenames)
-        pluginPaths.append([(NSString *)directoryCFString.get() stringByAppendingPathComponent:filename]);
+        pluginPaths.append([(__bridge NSString *)directoryCFString.get() stringByAppendingPathComponent:filename]);
     
     return pluginPaths;
 }
index 4cf32c3..3de0060 100644 (file)
@@ -294,7 +294,7 @@ void RemoteLayerTreeHost::detachRootLayer()
 static void recursivelyMapIOSurfaceBackingStore(CALayer *layer)
 {
     if (layer.contents && CFGetTypeID(layer.contents) == CAMachPortGetTypeID()) {
-        MachSendRight port = MachSendRight::create(CAMachPortGetPort((CAMachPortRef)layer.contents));
+        MachSendRight port = MachSendRight::create(CAMachPortGetPort((__bridge CAMachPortRef)layer.contents));
         auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(port), sRGBColorSpaceRef());
         layer.contents = surface ? surface->asLayerContents() : nil;
     }
index df9c5a8..3cc9343 100644 (file)
@@ -615,22 +615,22 @@ void ViewGestureController::beginSwipeGesture(WebBackForwardListItem* targetItem
         m_swipeShadowLayer = adoptNS([[CAGradientLayer alloc] init]);
         [m_swipeShadowLayer setName:@"Gesture Swipe Shadow Layer"];
         [m_swipeShadowLayer setColors:@[
-            (id)adoptCF(CGColorCreateGenericGray(0, 1.)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.99)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.98)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.95)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.92)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.82)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.71)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.46)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.35)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.25)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.17)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.11)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.07)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.04)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.01)).get(),
-            (id)adoptCF(CGColorCreateGenericGray(0, 0.)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 1.)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.99)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.98)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.95)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.92)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.82)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.71)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.46)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.35)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.25)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.17)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.11)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.07)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.04)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.01)).get(),
+            (__bridge id)adoptCF(CGColorCreateGenericGray(0, 0.)).get(),
         ]];
         [m_swipeShadowLayer setLocations:@[
             @0,
index 06762b5..ea50e32 100644 (file)
@@ -249,7 +249,7 @@ static RetainPtr<CGImageRef> createImageWithCopiedData(CGImageRef sourceImage)
         [_webViewPlaceholder setAction:@selector(cancelOperation:)];
     }
     [_webViewPlaceholder setTarget:nil];
-    [_webViewPlaceholder setContents:(id)webViewContents.get()];
+    [_webViewPlaceholder setContents:(__bridge id)webViewContents.get()];
     self.savedConstraints = _webView.superview.constraints;
     [self _replaceView:_webView with:_webViewPlaceholder.get()];
     
index bda42bc..fb81436 100644 (file)
@@ -102,7 +102,7 @@ void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection text
     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
     NSFont *font;
     if (data.fontInfo.fontAttributeDictionary) {
-        NSFontDescriptor *fontDescriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:(NSDictionary *)data.fontInfo.fontAttributeDictionary.get()];
+        NSFontDescriptor *fontDescriptor = [NSFontDescriptor fontDescriptorWithFontAttributes:(__bridge NSDictionary *)data.fontInfo.fontAttributeDictionary.get()];
         font = [NSFont fontWithDescriptor:fontDescriptor size:((pageScaleFactor != 1) ? [fontDescriptor pointSize] * pageScaleFactor : 0)];
     } else
         font = [NSFont menuFontOfSize:0];
index ef7c9b5..d2cc616 100644 (file)
@@ -54,7 +54,7 @@ using namespace WebKit;
 
 static void didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
 {
-    WKWebProcessPlugInController *plugInController = (WKWebProcessPlugInController *)clientInfo;
+    auto plugInController = (__bridge WKWebProcessPlugInController *)clientInfo;
     id <WKWebProcessPlugIn> principalClassInstance = plugInController->_principalClassInstance.get();
 
     if ([principalClassInstance respondsToSelector:@selector(webProcessPlugIn:didCreateBrowserContextController:)])
@@ -63,7 +63,7 @@ static void didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void*
 
 static void willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
 {
-    WKWebProcessPlugInController *plugInController = (WKWebProcessPlugInController *)clientInfo;
+    auto plugInController = (__bridge WKWebProcessPlugInController *)clientInfo;
     id <WKWebProcessPlugIn> principalClassInstance = plugInController->_principalClassInstance.get();
 
     if ([principalClassInstance respondsToSelector:@selector(webProcessPlugIn:willDestroyBrowserContextController:)])
@@ -76,7 +76,7 @@ static void setUpBundleClient(WKWebProcessPlugInController *plugInController, In
     memset(&bundleClient, 0, sizeof(bundleClient));
 
     bundleClient.base.version = 1;
-    bundleClient.base.clientInfo = plugInController;
+    bundleClient.base.clientInfo = (__bridge void*)plugInController;
     bundleClient.didCreatePage = didCreatePage;
     bundleClient.willDestroyPage = willDestroyPage;
 
index 866db45..d5e0936 100644 (file)
@@ -84,7 +84,7 @@ using namespace WebKit;
 
 static void didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userDataRef, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didStartProvisionalLoadForFrame:)])
@@ -93,7 +93,7 @@ static void didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameR
 
 static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef *userDataRef, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didReceiveServerRedirectForProvisionalLoadForFrame:)])
@@ -102,7 +102,7 @@ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef p
 
 static void didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didFinishLoadForFrame:)])
@@ -111,7 +111,7 @@ static void didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame,
 
 static void globalObjectIsAvailableForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef scriptWorld, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:globalObjectIsAvailableForFrame:inScriptWorld:)])
@@ -120,7 +120,7 @@ static void globalObjectIsAvailableForFrame(WKBundlePageRef page, WKBundleFrameR
 
 static void didRemoveFrameFromHierarchy(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didRemoveFrameFromHierarchy:)])
@@ -129,7 +129,7 @@ static void didRemoveFrameFromHierarchy(WKBundlePageRef page, WKBundleFrameRef f
 
 static void didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didCommitLoadForFrame:)])
@@ -138,7 +138,7 @@ static void didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame,
 
 static void didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didFinishDocumentLoadForFrame:)])
@@ -147,7 +147,7 @@ static void didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef
 
 static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef wkError, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didFailProvisionalLoadWithErrorForFrame:error:)])
@@ -156,7 +156,7 @@ static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBund
 
 static void didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef wkError, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didFailLoadWithErrorForFrame:error:)])
@@ -165,7 +165,7 @@ static void didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef
 
 static void didSameDocumentNavigationForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didSameDocumentNavigation:forFrame:)])
@@ -179,7 +179,7 @@ static void didSameDocumentNavigationForFrame(WKBundlePageRef page, WKBundleFram
 
 static void didLayoutForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didLayoutForFrame:)])
@@ -188,7 +188,7 @@ static void didLayoutForFrame(WKBundlePageRef page, WKBundleFrameRef frame, cons
 
 static void didReachLayoutMilestone(WKBundlePageRef page, WKLayoutMilestones milestones, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:renderingProgressDidChange:)])
@@ -197,7 +197,7 @@ static void didReachLayoutMilestone(WKBundlePageRef page, WKLayoutMilestones mil
 
 static void didFirstVisuallyNonEmptyLayoutForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didFirstVisuallyNonEmptyLayoutForFrame:)])
@@ -206,7 +206,7 @@ static void didFirstVisuallyNonEmptyLayoutForFrame(WKBundlePageRef page, WKBundl
 
 static void didHandleOnloadEventsForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:didHandleOnloadEventsForFrame:)])
@@ -215,7 +215,7 @@ static void didHandleOnloadEventsForFrame(WKBundlePageRef page, WKBundleFrameRef
 
 static WKStringRef userAgentForURL(WKBundleFrameRef frame, WKURLRef url, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
     
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:frame:userAgentForURL:)]) {
@@ -224,8 +224,7 @@ static WKStringRef userAgentForURL(WKBundleFrameRef frame, WKURLRef url, const v
         if (!string)
             return nullptr;
 
-        WKStringRef wkString = WKStringCreateWithCFString((CFStringRef)string);
-        return wkString;
+        return WKStringCreateWithCFString((__bridge CFStringRef)string);
     }
     
     return nullptr;
@@ -237,7 +236,7 @@ static void setUpPageLoaderClient(WKWebProcessPlugInBrowserContextController *co
     memset(&client, 0, sizeof(client));
 
     client.base.version = 8;
-    client.base.clientInfo = contextController;
+    client.base.clientInfo = (__bridge void*)contextController;
     client.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
     client.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
     client.didCommitLoadForFrame = didCommitLoadForFrame;
@@ -260,7 +259,7 @@ static void setUpPageLoaderClient(WKWebProcessPlugInBrowserContextController *co
 
 static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKURLRequestRef request, WKURLResponseRef redirectResponse, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:frame:willSendRequestForResource:request:redirectResponse:)]) {
@@ -285,7 +284,7 @@ static WKURLRequestRef willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef
 
 static void didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKURLRequestRef request, bool pageIsProvisionallyLoading, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:frame:didInitiateLoadForResource:request:pageIsProvisionallyLoading:)]) {
@@ -298,7 +297,7 @@ static void didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef frame,
 
 static void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:frame:didFinishLoadForResource:)]) {
@@ -310,7 +309,7 @@ static void didFinishLoadForResource(WKBundlePageRef, WKBundleFrameRef frame, ui
 
 static void didFailLoadForResource(WKBundlePageRef, WKBundleFrameRef frame, uint64_t resourceIdentifier, WKErrorRef error, const void* clientInfo)
 {
-    WKWebProcessPlugInBrowserContextController *pluginContextController = (WKWebProcessPlugInBrowserContextController *)clientInfo;
+    auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
     auto loadDelegate = pluginContextController->_loadDelegate.get();
 
     if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:frame:didFailLoadForResource:error:)]) {
@@ -327,7 +326,7 @@ static void setUpResourceLoadClient(WKWebProcessPlugInBrowserContextController *
     memset(&client, 0, sizeof(client));
 
     client.base.version = 1;
-    client.base.clientInfo = contextController;
+    client.base.clientInfo = (__bridge void*) contextController;
     client.willSendRequestForFrame = willSendRequestForFrame;
     client.didInitiateLoadForResource = didInitiateLoadForResource;
     client.didFinishLoadForResource = didFinishLoadForResource;
index b9d29a7..6d3e8d9 100644 (file)
@@ -73,7 +73,7 @@ bool InjectedBundle::initialize(const WebProcessCreationParameters& parameters,
         return false;
     }
 
-    m_platformBundle = [[NSBundle alloc] initWithURL:(NSURL *)bundleURL.get()];
+    m_platformBundle = [[NSBundle alloc] initWithURL:(__bridge NSURL *)bundleURL.get()];
     if (!m_platformBundle) {
         WTFLogAlways("InjectedBundle::load failed - Could not create the bundle.\n");
         return false;
index ec3ca5d..8bbed6b 100644 (file)
@@ -167,7 +167,7 @@ NPError NetscapePlugin::popUpContextMenu(NPMenu* npMenu)
     if (!convertPoint(m_currentMouseEvent->data.mouse.pluginX, m_currentMouseEvent->data.mouse.pluginY, NPCoordinateSpacePlugin, screenX, screenY, NPCoordinateSpaceScreen))
         ASSERT_NOT_REACHED();
 
-    _NSPopUpCarbonMenu3(reinterpret_cast<NSMenu *>(npMenu), nil, nil, NSMakePoint(screenX, screenY), -1, nil, 0, nil, NSPopUpMenuTypeContext, nil);
+    _NSPopUpCarbonMenu3((__bridge NSMenu *)npMenu, nil, nil, NSMakePoint(screenX, screenY), -1, nil, 0, nil, NSPopUpMenuTypeContext, nil);
     return NPERR_NO_ERROR;
 }
 
index 79a34ed..e58de2c 100644 (file)
@@ -249,8 +249,10 @@ private:
     WebCore::IntSize pdfDocumentSize() const { return m_pdfDocumentSize; }
     void setPDFDocumentSize(WebCore::IntSize size) { m_pdfDocumentSize = size; }
 
+#ifdef __OBJC__
     NSData *liveData() const;
-    NSData *rawData() const { return (NSData *)m_data.get(); }
+    NSData *rawData() const { return (__bridge NSData *)m_data.get(); }
+#endif
 
     WebFrame* webFrame() const { return m_frame; }
 
index f65cb24..71f673a 100644 (file)
@@ -154,7 +154,7 @@ void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Eleme
     SharedMemory::Handle archiveHandle;
     size_t archiveSize = 0;
     if (data) {
-        RefPtr<SharedBuffer> archiveBuffer = SharedBuffer::create((NSData *)data.get());
+        auto archiveBuffer = SharedBuffer::create((__bridge NSData *)data.get());
         RefPtr<SharedMemory> archiveSharedMemoryBuffer = SharedMemory::allocate(archiveBuffer->size());
         if (!archiveSharedMemoryBuffer)
             return;
index 7e6d665..4603dd6 100644 (file)
@@ -137,12 +137,12 @@ Ref<WebCore::PlatformCALayer> PlatformCALayerRemoteCustom::clone(PlatformCALayer
 
 CFTypeRef PlatformCALayerRemoteCustom::contents() const
 {
-    return [m_platformLayer contents];
+    return (__bridge CFTypeRef)[m_platformLayer contents];
 }
 
 void PlatformCALayerRemoteCustom::setContents(CFTypeRef contents)
 {
-    [m_platformLayer setContents:(id)contents];
+    [m_platformLayer setContents:(__bridge id)contents];
 }
 
 void PlatformCALayerRemoteCustom::setNeedsDisplayInRect(const FloatRect& rect)
index d02ed72..0082cba 100644 (file)
@@ -845,7 +845,7 @@ void TiledCoreAnimationDrawingArea::commitTransientZoom(double scale, FloatPoint
         RetainPtr<CABasicAnimation> shadowPositionAnimation = transientZoomSnapAnimationForKeyPath("position");
         [shadowPositionAnimation setToValue:[NSValue valueWithPoint:shadowLayerPositionForFrame(frameView, constrainedOrigin)]];
         RetainPtr<CABasicAnimation> shadowPathAnimation = transientZoomSnapAnimationForKeyPath("shadowPath");
-        [shadowPathAnimation setToValue:(id)shadowPath.get()];
+        [shadowPathAnimation setToValue:(__bridge id)shadowPath.get()];
 
         [shadowCALayer addAnimation:shadowBoundsAnimation.get() forKey:@"transientZoomCommitShadowBounds"];
         [shadowCALayer addAnimation:shadowPositionAnimation.get() forKey:@"transientZoomCommitShadowPosition"];
index c9a4081..2555c3d 100644 (file)
@@ -734,7 +734,7 @@ void WebPage::setTopOverhangImage(WebImage* image)
 
     layer->setSize(image->size());
     layer->setPosition(FloatPoint(0, -image->size().height()));
-    layer->platformLayer().contents = (id)image->bitmap().makeCGImageCopy().get();
+    layer->platformLayer().contents = (__bridge id)image->bitmap().makeCGImageCopy().get();
 }
 
 void WebPage::setBottomOverhangImage(WebImage* image)
@@ -748,7 +748,7 @@ void WebPage::setBottomOverhangImage(WebImage* image)
         return;
 
     layer->setSize(image->size());
-    layer->platformLayer().contents = (id)image->bitmap().makeCGImageCopy().get();
+    layer->platformLayer().contents = (__bridge id)image->bitmap().makeCGImageCopy().get();
 }
 
 void WebPage::updateHeaderAndFooterLayersForDeviceScaleChange(float scaleFactor)