Title: [173192] trunk/Source
Revision
173192
Author
[email protected]
Date
2014-09-02 17:14:06 -0700 (Tue, 02 Sep 2014)

Log Message

[iOS] Support using Foundation networking code
https://bugs.webkit.org/show_bug.cgi?id=136467

Reviewed by Pratik Solanki.

Source/WebCore:

We should support building iOS WebKit with the Foundation networking code
(i.e. !USE(CFNETWORK)).

Additionally, disable USE(CFNETWORK) and use the Foundation networking code
by default when building iOS WebKit without the Apple Internal SDK.

* Configurations/WebCore.xcconfig: Remove file WebCoreURLResponse.mm from the list of excluded files
so that we compile an implementation for function WebCore::synthesizeRedirectResponseIfNecessary when
building without USE(CFNETWORK).
* WebCore.exp.in: Add symbols for WebCore::synthesizeRedirectResponseIfNecessary() and WebCore::ResourceHandleClient::willCacheResponseAsync().
* WebCore.xcodeproj/project.pbxproj: Add new files CFNetworkConnectionCacheSPI.h and CFURLRequestSPI.h.
Also move group platform/spi such that it appears in alphabetical order in the platform group.
* platform/cf/URLCF.cpp: Remove unnecessary header <CoreFoundation/CFPriv.h>.
* platform/network/ResourceHandle.h: Declare iOS-specific variant of ResourceHandle::createNSURLConnection().
* platform/network/ResourceHandleClient.h: Always include header <wtf/RetainPtr.h> when building for iOS.
(WebCore::ResourceHandleClient::connectionProperties): Add PLATFORM(IOS)-guard around declaration.
* platform/network/cf/ResourceRequestCFNet.cpp: Substitute header CFNetworkConnectionCacheSPI.h for
<CFNetwork/CFNetworkConnectionCachePriv.h>.
* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::saveToPersistentStorage): Use Credential::nsCredential() and ProtectionSpace::nsSpace()
instead of WebCore::mac(const {Credential, ProtectionSpace}&) as the latter were removed in <http://trac.webkit.org/changeset/171801>
and <http://trac.webkit.org/changeset/171540>, respectively.
* platform/network/mac/ResourceErrorMac.mm: Add USE(CFNETWORK)-guard around <CFNetwork/CFSocketStreamPriv.h>.
* platform/network/mac/ResourceHandleMac.mm: Substitute header CFURLRequestSPI.h for <CFNetwork/CFURLRequest.h>.
(WebCore::ResourceHandle::start): Modified to use ResourceHandle::makeDelegate() instead of d->m_proxy, which
was removed in <http://trac.webkit.org/changeset/147476>.
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary): Add !USE(CFNETWORK)- and PLATFORM(IOS)- guards.
* platform/spi/cf/CFNetworkConnectionCacheSPI.h: Added.
* platform/spi/cf/CFURLRequestSPI.h: Added.

Source/WTF:

Disable USE(CFNETWORK) and use the Foundation networking code by default when building
iOS WebKit without the Apple Internal SDK.

* wtf/Platform.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (173191 => 173192)


--- trunk/Source/WTF/ChangeLog	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WTF/ChangeLog	2014-09-03 00:14:06 UTC (rev 173192)
@@ -1,3 +1,15 @@
+2014-09-02  Daniel Bates  <[email protected]>
+
+        [iOS] Support using Foundation networking code
+        https://bugs.webkit.org/show_bug.cgi?id=136467
+
+        Reviewed by Pratik Solanki.
+
+        Disable USE(CFNETWORK) and use the Foundation networking code by default when building
+        iOS WebKit without the Apple Internal SDK.
+
+        * wtf/Platform.h:
+
 2014-08-26  Maciej Stachowiak  <[email protected]>
 
         Use RetainPtr::autorelease in some places where it seems appropriate

Modified: trunk/Source/WTF/wtf/Platform.h (173191 => 173192)


--- trunk/Source/WTF/wtf/Platform.h	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WTF/wtf/Platform.h	2014-09-03 00:14:06 UTC (rev 173192)
@@ -451,6 +451,12 @@
 #define WTF_PLATFORM_COCOA 1
 #endif
 
+#if PLATFORM(COCOA)
+#if defined __has_include && __has_include(<CoreFoundation/CFPriv.h>)
+#define WTF_USE_APPLE_INTERNAL_SDK 1
+#endif
+#endif
+
 /* Graphics engines */
 
 /* USE(CG) and PLATFORM(CI) */
@@ -508,7 +514,9 @@
 
 #define DONT_FINALIZE_ON_MAIN_THREAD 1
 #define HAVE_READLINE 1
+#if USE(APPLE_INTERNAL_SDK)
 #define WTF_USE_CFNETWORK 1
+#endif
 #define WTF_USE_UIKIT_EDITING 1
 #define WTF_USE_WEB_THREAD 1
 #define WTF_USE_QUICK_LOOK 1
@@ -1054,12 +1062,6 @@
 #define WTF_USE_ASYNC_NSTEXTINPUTCLIENT 1
 #endif
 
-#if PLATFORM(COCOA)
-#if defined __has_include && __has_include(<CoreFoundation/CFPriv.h>)
-#define WTF_USE_APPLE_INTERNAL_SDK 1
-#endif
-#endif
-
 #if (OS(DARWIN) && USE(CG)) || USE(FREETYPE) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
 #undef ENABLE_OPENTYPE_MATH
 #define ENABLE_OPENTYPE_MATH 1

Modified: trunk/Source/WebCore/ChangeLog (173191 => 173192)


--- trunk/Source/WebCore/ChangeLog	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/ChangeLog	2014-09-03 00:14:06 UTC (rev 173192)
@@ -1,3 +1,42 @@
+2014-09-02  Daniel Bates  <[email protected]>
+
+        [iOS] Support using Foundation networking code
+        https://bugs.webkit.org/show_bug.cgi?id=136467
+
+        Reviewed by Pratik Solanki.
+
+        We should support building iOS WebKit with the Foundation networking code
+        (i.e. !USE(CFNETWORK)).
+
+        Additionally, disable USE(CFNETWORK) and use the Foundation networking code
+        by default when building iOS WebKit without the Apple Internal SDK.
+
+        * Configurations/WebCore.xcconfig: Remove file WebCoreURLResponse.mm from the list of excluded files
+        so that we compile an implementation for function WebCore::synthesizeRedirectResponseIfNecessary when
+        building without USE(CFNETWORK).
+        * WebCore.exp.in: Add symbols for WebCore::synthesizeRedirectResponseIfNecessary() and WebCore::ResourceHandleClient::willCacheResponseAsync().
+        * WebCore.xcodeproj/project.pbxproj: Add new files CFNetworkConnectionCacheSPI.h and CFURLRequestSPI.h.
+        Also move group platform/spi such that it appears in alphabetical order in the platform group.
+        * platform/cf/URLCF.cpp: Remove unnecessary header <CoreFoundation/CFPriv.h>.
+        * platform/network/ResourceHandle.h: Declare iOS-specific variant of ResourceHandle::createNSURLConnection().
+        * platform/network/ResourceHandleClient.h: Always include header <wtf/RetainPtr.h> when building for iOS.
+        (WebCore::ResourceHandleClient::connectionProperties): Add PLATFORM(IOS)-guard around declaration.
+        * platform/network/cf/ResourceRequestCFNet.cpp: Substitute header CFNetworkConnectionCacheSPI.h for
+        <CFNetwork/CFNetworkConnectionCachePriv.h>.
+        * platform/network/mac/CredentialStorageMac.mm:
+        (WebCore::CredentialStorage::saveToPersistentStorage): Use Credential::nsCredential() and ProtectionSpace::nsSpace()
+        instead of WebCore::mac(const {Credential, ProtectionSpace}&) as the latter were removed in <http://trac.webkit.org/changeset/171801>
+        and <http://trac.webkit.org/changeset/171540>, respectively.
+        * platform/network/mac/ResourceErrorMac.mm: Add USE(CFNETWORK)-guard around <CFNetwork/CFSocketStreamPriv.h>.
+        * platform/network/mac/ResourceHandleMac.mm: Substitute header CFURLRequestSPI.h for <CFNetwork/CFURLRequest.h>.
+        (WebCore::ResourceHandle::start): Modified to use ResourceHandle::makeDelegate() instead of d->m_proxy, which 
+        was removed in <http://trac.webkit.org/changeset/147476>.
+        (WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
+        * platform/network/mac/WebCoreURLResponse.mm:
+        (WebCore::synthesizeRedirectResponseIfNecessary): Add !USE(CFNETWORK)- and PLATFORM(IOS)- guards.
+        * platform/spi/cf/CFNetworkConnectionCacheSPI.h: Added.
+        * platform/spi/cf/CFURLRequestSPI.h: Added.
+
 2014-09-02  Myles C. Maxfield  <[email protected]>
 
         Use references in public EventSender functions

Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (173191 => 173192)


--- trunk/Source/WebCore/Configurations/WebCore.xcconfig	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig	2014-09-03 00:14:06 UTC (rev 173192)
@@ -122,6 +122,6 @@
 EXCLUDED_SOURCE_FILE_NAMES_FOR_GESTURE_EVENTS_IF_ENABLED_ = JSGesture* DOMGesture*;
 
 EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
-EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ColorMac.mm Cursor.cpp CursorMac.mm DataTransferMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm UserAgentMac.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreURLResponse.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WidgetMac.mm DisplayRefreshMonitorMac.cpp $(EXCLUDED_SOURCE_FILE_NAMES_FOR_TOUCH_EVENTS) $(EXCLUDED_SOURCE_FILE_NAMES_FOR_GESTURE_EVENTS);
+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ColorMac.mm Cursor.cpp CursorMac.mm DataTransferMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm UserAgentMac.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WidgetMac.mm DisplayRefreshMonitorMac.cpp $(EXCLUDED_SOURCE_FILE_NAMES_FOR_TOUCH_EVENTS) $(EXCLUDED_SOURCE_FILE_NAMES_FOR_GESTURE_EVENTS);
 EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
 EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm KillRingNone.cpp WAKAppKitStubs.h WAKClipView.h WAKResponder.h WAKScrollView.h WAKView.h WAKViewPrivate.h WAKWindow.h WKContentObservation.h WKGraphics.h WKTypes.h WKUtilities.h WKView.h WKViewPrivate.h WebCoreThread.h WebCoreThreadMessage.h WebCoreThreadRun.h WebCoreThreadSystemInterface.h $(EXCLUDED_SOURCE_FILE_NAMES_FOR_TOUCH_EVENTS) $(EXCLUDED_SOURCE_FILE_NAMES_FOR_GESTURE_EVENTS);

Modified: trunk/Source/WebCore/WebCore.exp.in (173191 => 173192)


--- trunk/Source/WebCore/WebCore.exp.in	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-09-03 00:14:06 UTC (rev 173192)
@@ -1069,6 +1069,9 @@
 __ZN7WebCore36standardUserAgentWithApplicationNameERKN3WTF6StringES3_
 __ZN7WebCore37WidgetHierarchyUpdatesSuspensionScope11moveWidgetsEv
 __ZN7WebCore37WidgetHierarchyUpdatesSuspensionScope35s_widgetHierarchyUpdateSuspendCountE
+#if !USE(CFNETWORK)
+__ZN7WebCore37synthesizeRedirectResponseIfNecessaryEP15NSURLConnectionP12NSURLRequestP13NSURLResponse
+#endif
 __ZN7WebCore3URL10invalidateEv
 __ZN7WebCore3URL11setProtocolERKN3WTF6StringE
 __ZN7WebCore3URL7setPathERKN3WTF6StringE
@@ -2638,7 +2641,6 @@
 __ZN7WebCore19applicationIsWebAppEv
 __ZN7WebCore19asciiLineBreakTableE
 __ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP8WebEvent
-__ZN7WebCore20ResourceHandleClient22willCacheResponseAsyncEPNS_14ResourceHandleEPK20_CFCachedURLResponse
 __ZN7WebCore20applicationIsOkCupidEv
 __ZN7WebCore20endOfEditableContentERKNS_15VisiblePositionE
 __ZN7WebCore20lastOffsetForEditingEPKNS_4NodeE
@@ -2827,6 +2829,10 @@
 _wkSetLayerContentsScale
 #endif
 
+#if PLATFORM(IOS) && USE(CFNETWORK)
+__ZN7WebCore20ResourceHandleClient22willCacheResponseAsyncEPNS_14ResourceHandleEPK20_CFCachedURLResponse
+#endif
+
 #if PLATFORM(IOS) && defined(__LP64__) && __LP64__
 __ZN7WebCore28createCGColorWithDeviceWhiteEdd
 #endif

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (173191 => 173192)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-09-03 00:14:06 UTC (rev 173192)
@@ -5736,6 +5736,8 @@
 		CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
 		CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CE7B2DB61586ABAD0098B3FA /* TextAlternativeWithRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */; };
+		CE8245F019B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE8245EF19B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CE8245F219B671D500AC0122 /* CFURLRequestSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE8245F119B671D500AC0122 /* CFURLRequestSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CE95208A1811B475007A5392 /* WebSafeIncrementalSweeperIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */; };
 		CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC2153778FF00E37068 /* DictationAlternative.cpp */; };
 		CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */ = {isa = PBXBuildFile; fileRef = CECADFC3153778FF00E37068 /* DictationAlternative.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -13198,6 +13200,8 @@
 		CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = "<group>"; };
 		CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextAlternativeWithRange.h; path = mac/TextAlternativeWithRange.h; sourceTree = "<group>"; };
 		CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextAlternativeWithRange.mm; path = mac/TextAlternativeWithRange.mm; sourceTree = "<group>"; };
+		CE8245EF19B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNetworkConnectionCacheSPI.h; sourceTree = "<group>"; };
+		CE8245F119B671D500AC0122 /* CFURLRequestSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFURLRequestSPI.h; sourceTree = "<group>"; };
 		CECADFC2153778FF00E37068 /* DictationAlternative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationAlternative.cpp; sourceTree = "<group>"; };
 		CECADFC3153778FF00E37068 /* DictationAlternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationAlternative.h; sourceTree = "<group>"; };
 		CECADFC4153778FF00E37068 /* DictationCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommand.cpp; sourceTree = "<group>"; };
@@ -16140,6 +16144,8 @@
 			isa = PBXGroup;
 			children = (
 				65086DA719AC1719009AF46B /* CFLocaleSPI.h */,
+				CE8245EF19B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h */,
+				CE8245F119B671D500AC0122 /* CFURLRequestSPI.h */,
 			);
 			path = cf;
 			sourceTree = "<group>";
@@ -21233,8 +21239,8 @@
 				59C77F101054591C00506104 /* mock */,
 				656B84D70AEA1CE900A095B4 /* network */,
 				516030090CC4245400C8AC25 /* posix */,
+				653EF83619A043AE0052202C /* spi */,
 				1A2E6E560CC551E0004A2062 /* sql */,
-				653EF83619A043AE0052202C /* spi */,
 				B2C3D9EC0D006C1D00EF6F26 /* text */,
 				49AE2D94134EE5F90072920A /* CalculationValue.cpp */,
 				49AE2D95134EE5F90072920A /* CalculationValue.h */,
@@ -23434,7 +23440,9 @@
 				6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
 				CDDD571518B57A8200A94FCB /* CDMSession.h in Headers */,
 				5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */,
+				CE8245F019B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h in Headers */,
 				E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */,
+				CE8245F219B671D500AC0122 /* CFURLRequestSPI.h in Headers */,
 				FE36FD1516C7826500F887C1 /* ChangeVersionData.h in Headers */,
 				97BC69DD1505F076001B74AC /* ChangeVersionWrapper.h in Headers */,
 				FD315FFF12B0267600C1A359 /* ChannelMergerNode.h in Headers */,

Modified: trunk/Source/WebCore/platform/cf/URLCF.cpp (173191 => 173192)


--- trunk/Source/WebCore/platform/cf/URLCF.cpp	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/cf/URLCF.cpp	2014-09-03 00:14:06 UTC (rev 173192)
@@ -32,7 +32,6 @@
 
 #if PLATFORM(IOS)
 #include "RuntimeApplicationChecksIOS.h"
-#include <CoreFoundation/CFPriv.h>
 #endif
 
 namespace WebCore {

Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (173191 => 173192)


--- trunk/Source/WebCore/platform/network/ResourceHandle.h	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h	2014-09-03 00:14:06 UTC (rev 173192)
@@ -290,10 +290,14 @@
     void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior, CFDictionaryRef clientProperties);
 #endif
 
-#if PLATFORM(COCOA) && !USE(CFNETWORK)
+#if PLATFORM(MAC) && !USE(CFNETWORK)
     void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior);
 #endif
 
+#if PLATFORM(IOS) && !USE(CFNETWORK)
+    void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, SchedulingBehavior, NSDictionary *connectionProperties);
+#endif
+
 #if PLATFORM(COCOA) && ENABLE(WEB_TIMING)
 static void getConnectionTimingData(NSDictionary *timingData, ResourceLoadTiming&);
 #endif

Modified: trunk/Source/WebCore/platform/network/ResourceHandleClient.h (173191 => 173192)


--- trunk/Source/WebCore/platform/network/ResourceHandleClient.h	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/ResourceHandleClient.h	2014-09-03 00:14:06 UTC (rev 173192)
@@ -32,6 +32,9 @@
 #if USE(CFNETWORK)
 #include <CFNetwork/CFURLCachePriv.h>
 #include <CFNetwork/CFURLResponsePriv.h>
+#endif
+
+#if PLATFORM(IOS) || USE(CFNETWORK)
 #include <wtf/RetainPtr.h>
 #endif
 
@@ -115,9 +118,12 @@
 #endif
         virtual void receivedCancellation(ResourceHandle*, const AuthenticationChallenge&) { }
 
+#if PLATFORM(IOS)
+        virtual RetainPtr<CFDictionaryRef> connectionProperties(ResourceHandle*) { return nullptr; }
+#endif
+
 #if USE(CFNETWORK)
         virtual CFCachedURLResponseRef willCacheResponse(ResourceHandle*, CFCachedURLResponseRef response) { return response; }
-        virtual RetainPtr<CFDictionaryRef> connectionProperties(ResourceHandle*) { return nullptr; }
 #if PLATFORM(WIN)
         virtual bool shouldCacheResponse(ResourceHandle*, CFCachedURLResponseRef) { return true; }
 #endif // PLATFORM(WIN)

Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp (173191 => 173192)


--- trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2014-09-03 00:14:06 UTC (rev 173192)
@@ -38,10 +38,11 @@
 #include "FormDataStreamCFNet.h"
 #include <CFNetwork/CFURLRequestPriv.h>
 #include <wtf/text/CString.h>
+#endif
+
 #if PLATFORM(IOS)
-#include <CFNetwork/CFNetworkConnectionCachePriv.h>
+#include "CFNetworkConnectionCacheSPI.h"
 #endif
-#endif
 
 #if PLATFORM(COCOA)
 #include "ResourceLoadPriority.h"

Modified: trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm (173191 => 173192)


--- trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm	2014-09-03 00:14:06 UTC (rev 173192)
@@ -45,9 +45,9 @@
 {
     if (credential.persistence() == CredentialPersistenceNone) {
         Credential sessionCredential(credential, CredentialPersistenceForSession);
-        [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:mac(sessionCredential) forProtectionSpace:mac(protectionSpace)];
+        [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:sessionCredential.nsCredential() forProtectionSpace:protectionSpace.nsSpace()];
     } else
-        [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:mac(credential) forProtectionSpace:mac(protectionSpace)];
+        [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential.nsCredential() forProtectionSpace:protectionSpace.nsSpace()];
 }
 #endif
 

Modified: trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm (173191 => 173192)


--- trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm	2014-09-03 00:14:06 UTC (rev 173192)
@@ -31,9 +31,8 @@
 #import <CoreFoundation/CFError.h>
 #import <Foundation/Foundation.h>
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && USE(CFNETWORK)
 #import <CFNetwork/CFSocketStreamPriv.h>
-#import <Foundation/NSURLError.h>
 #endif
 
 @interface NSError (WebExtras)

Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (173191 => 173192)


--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm	2014-09-03 00:14:06 UTC (rev 173192)
@@ -75,8 +75,7 @@
 #endif
 
 #if PLATFORM(IOS)
-#import <CFNetwork/CFURLRequest.h>
-
+#import "CFURLRequestSPI.h"
 #import "RuntimeApplicationChecksIOS.h"
 #import "WebCoreThreadRun.h"
 
@@ -106,6 +105,7 @@
     request.setHTTPHeaderField(HTTPHeaderName::Authorization, authenticationHeader);
 }
 
+#if !PLATFORM(IOS)
 static NSOperationQueue *operationQueueForAsyncClients()
 {
     static NSOperationQueue *queue;
@@ -116,6 +116,7 @@
     }
     return queue;
 }
+#endif
 
 ResourceHandleInternal::~ResourceHandleInternal()
 {
@@ -252,11 +253,11 @@
         SchedulingBehavior::Asynchronous);
 #else
     createNSURLConnection(
-        d->m_proxy.get(),
+        ResourceHandle::makeDelegate(shouldUseCredentialStorage),
         shouldUseCredentialStorage,
         d->m_shouldContentSniff || d->m_context->localFileContentSniffingEnabled(),
         SchedulingBehavior::Asynchronous,
-        (NSDictionary *)client()->connectionProperties(this));
+        (NSDictionary *)client()->connectionProperties(this).get());
 #endif
 
 #if PLATFORM(IOS)
@@ -409,8 +410,8 @@
         return;
     }
 
+    bool shouldUseCredentialStorage = storedCredentials == AllowStoredCredentials;
 #if !PLATFORM(IOS)
-    bool shouldUseCredentialStorage = storedCredentials == AllowStoredCredentials;
     handle->createNSURLConnection(
         handle->makeDelegate(shouldUseCredentialStorage),
         shouldUseCredentialStorage,
@@ -418,11 +419,11 @@
         SchedulingBehavior::Synchronous);
 #else
     handle->createNSURLConnection(
-        handle->delegate(), // A synchronous request cannot turn into a download, so there is no need to proxy the delegate.
-        storedCredentials == AllowStoredCredentials,
+        handle->makeDelegate(shouldUseCredentialStorage), // A synchronous request cannot turn into a download, so there is no need to proxy the delegate.
+        shouldUseCredentialStorage,
         handle->shouldContentSniff() || (context && context->localFileContentSniffingEnabled()),
         SchedulingBehavior::Synchronous,
-        (NSDictionary *)handle->client()->connectionProperties(handle.get()));
+        (NSDictionary *)handle->client()->connectionProperties(handle.get()).get());
 #endif
 
     [handle->connection() scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:(NSString *)synchronousLoadRunLoopMode()];

Modified: trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm (173191 => 173192)


--- trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm	2014-09-02 23:09:02 UTC (rev 173191)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm	2014-09-03 00:14:06 UTC (rev 173192)
@@ -37,6 +37,7 @@
 
 namespace WebCore {
 
+#if PLATFORM(MAC)
 // <rdar://problem/7007389> CoreTypes UTI map is missing 100+ file extensions that GateKeeper knew about
 // When we disabled content sniffing for file URLs we caused problems with these 100+ extensions that CoreTypes
 // doesn't know about.
@@ -322,10 +323,12 @@
     if (result != originalResult)
         wkSetCFURLResponseMIMEType(cfResponse, result.get());
 }
+#endif
 
+#if !USE(CFNETWORK)
 NSURLResponse *synthesizeRedirectResponseIfNecessary(NSURLConnection *connection, NSURLRequest *newRequest, NSURLResponse *redirectResponse)
 {
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     if (redirectResponse)
         return redirectResponse;
 
@@ -342,5 +345,6 @@
     return redirectResponse;
 #endif
 }
+#endif
 
 }

Copied: trunk/Source/WebCore/platform/spi/cf/CFNetworkConnectionCacheSPI.h (from rev 173191, trunk/Source/WebCore/platform/cf/URLCF.cpp) (0 => 173192)


--- trunk/Source/WebCore/platform/spi/cf/CFNetworkConnectionCacheSPI.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/spi/cf/CFNetworkConnectionCacheSPI.h	2014-09-03 00:14:06 UTC (rev 173192)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2014 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef CFNetworkConnectionCacheSPI_h
+#define CFNetworkConnectionCacheSPI_h
+
+#if USE(APPLE_INTERNAL_SDK)
+#include <CFNetwork/CFNetworkConnectionCachePriv.h>
+#else
+enum HTTPConnectionCacheLimitKeys {
+    kHTTPNumFastLanes = 4,
+};
+#endif
+
+extern "C" void _CFNetworkHTTPConnectionCacheSetLimit(HTTPConnectionCacheLimitKeys, int);
+
+#endif

Copied: trunk/Source/WebCore/platform/spi/cf/CFURLRequestSPI.h (from rev 173191, trunk/Source/WebCore/platform/cf/URLCF.cpp) (0 => 173192)


--- trunk/Source/WebCore/platform/spi/cf/CFURLRequestSPI.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/spi/cf/CFURLRequestSPI.h	2014-09-03 00:14:06 UTC (rev 173192)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef CFURLRequestSPI_h
+#define CFURLRequestSPI_h
+
+#if USE(APPLE_INTERNAL_SDK)
+#include <CFNetwork/CFURLRequest.h>
+#else
+#include <CoreFoundation/CFBase.h>
+typedef const struct _CFURLRequest *CFURLRequestRef;
+#endif
+
+extern "C" void CFURLRequestSetShouldStartSynchronously(CFURLRequestRef, Boolean);
+
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to