Diff
Modified: trunk/Source/WebCore/PAL/ChangeLog (231263 => 231264)
--- trunk/Source/WebCore/PAL/ChangeLog 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebCore/PAL/ChangeLog 2018-05-02 21:17:58 UTC (rev 231264)
@@ -1,3 +1,12 @@
+2018-05-02 Alex Christensen <[email protected]>
+
+ Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
+ https://bugs.webkit.org/show_bug.cgi?id=185179
+
+ Reviewed by Andy Estes.
+
+ * pal/spi/cf/CFNetworkSPI.h:
+
2018-05-02 Eric Carlson <[email protected]>
[iOS] Provide audio route information when invoking AirPlay picker
Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (231263 => 231264)
--- trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h 2018-05-02 21:17:58 UTC (rev 231264)
@@ -97,7 +97,7 @@
+ (void)setAllowsSpecificHTTPSCertificate:(NSArray *)allow forHost:(NSString *)host;
+ (void)setDefaultTimeoutInterval:(NSTimeInterval)seconds;
- (NSArray *)contentDispositionEncodingFallbackArray;
-- (CFURLRequestRef)_CFURLRequest;
+- (CFMutableURLRequestRef)_CFURLRequest;
- (id)_initWithCFURLRequest:(CFURLRequestRef)request;
- (id)_propertyForKey:(NSString *)key;
- (void)_setProperty:(id)value forKey:(NSString *)key;
@@ -265,6 +265,7 @@
Boolean _CFHostIsDomainTopLevel(CFStringRef domain);
void _CFURLRequestCreateArchiveList(CFAllocatorRef, CFURLRequestRef, CFIndex* version, CFTypeRef** objects, CFIndex* objectCount, CFDictionaryRef* protocolProperties);
CFMutableURLRequestRef _CFURLRequestCreateFromArchiveList(CFAllocatorRef, CFIndex version, CFTypeRef* objects, CFIndex objectCount, CFDictionaryRef protocolProperties);
+void CFURLRequestSetProxySettings(CFMutableURLRequestRef, CFDictionaryRef);
#endif // !PLATFORM(WIN)
Modified: trunk/Source/WebKit/ChangeLog (231263 => 231264)
--- trunk/Source/WebKit/ChangeLog 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/ChangeLog 2018-05-02 21:17:58 UTC (rev 231264)
@@ -1,3 +1,33 @@
+2018-05-02 Alex Christensen <[email protected]>
+
+ Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
+ https://bugs.webkit.org/show_bug.cgi?id=185179
+
+ Reviewed by Andy Estes.
+
+ * NetworkProcess/NetworkSessionCreationParameters.h:
+ (WebKit::NetworkSessionCreationParameters::encode const):
+ (WebKit::NetworkSessionCreationParameters::decode):
+ * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+ (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
+ * NetworkProcess/cocoa/NetworkSessionCocoa.h:
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+ * Shared/WebsiteDataStoreParameters.cpp:
+ (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
+ * Shared/cf/ArgumentCodersCF.cpp:
+ (IPC::encode):
+ (IPC::decode):
+ * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+ (-[WKWebsiteDataStore _setProxyConfiguration:]):
+ (-[WKWebsiteDataStore _proxyConfiguration]):
+ * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+ * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+ (WebKit::WebsiteDataStore::parameters):
+ * UIProcess/WebsiteData/WebsiteDataStore.h:
+ (WebKit::WebsiteDataStore::setProxyConfiguration):
+ (WebKit::WebsiteDataStore::proxyConfiguration):
+
2018-05-02 Youenn Fablet <[email protected]>
Use NetworkLoadChecker for navigation loads
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (231263 => 231264)
--- trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h 2018-05-02 21:17:58 UTC (rev 231264)
@@ -30,6 +30,10 @@
#include <wtf/EnumTraits.h>
#include <wtf/text/WTFString.h>
+#if PLATFORM(COCOA)
+#include "ArgumentCodersCF.h"
+#endif
+
namespace WebKit {
class LegacyCustomProtocolManager;
@@ -43,6 +47,9 @@
PAL::SessionID sessionID { PAL::SessionID::defaultSessionID() };
String boundInterfaceIdentifier;
AllowsCellularAccess allowsCellularAccess { AllowsCellularAccess::Yes };
+#if PLATFORM(COCOA)
+ RetainPtr<CFDictionaryRef> proxyConfiguration;
+#endif
};
inline void NetworkSessionCreationParameters::encode(IPC::Encoder& encoder) const
@@ -50,6 +57,9 @@
encoder << sessionID;
encoder << boundInterfaceIdentifier;
encoder << allowsCellularAccess;
+#if PLATFORM(COCOA)
+ IPC::encode(encoder, proxyConfiguration.get());
+#endif
}
inline std::optional<NetworkSessionCreationParameters> NetworkSessionCreationParameters::decode(IPC::Decoder& decoder)
@@ -68,7 +78,20 @@
if (!allowsCellularAccess)
return std::nullopt;
- return {{ sessionID, WTFMove(*boundInterfaceIdentifier), WTFMove(*allowsCellularAccess) }};
+#if PLATFORM(COCOA)
+ RetainPtr<CFDictionaryRef> proxyConfiguration;
+ if (!IPC::decode(decoder, proxyConfiguration))
+ return std::nullopt;
+#endif
+
+ return {{
+ sessionID
+ , WTFMove(*boundInterfaceIdentifier)
+ , WTFMove(*allowsCellularAccess)
+#if PLATFORM(COCOA)
+ , WTFMove(proxyConfiguration)
+#endif
+ }};
}
} // namespace WebKit
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (231263 => 231264)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm 2018-05-02 21:17:58 UTC (rev 231264)
@@ -92,7 +92,10 @@
shouldContentEncodingSniff = true;
#endif
auto& cocoaSession = static_cast<NetworkSessionCocoa&>(m_session.get());
- if (shouldContentSniff && shouldContentEncodingSniff && cocoaSession.m_boundInterfaceIdentifier.isNull())
+ if (shouldContentSniff
+ && shouldContentEncodingSniff
+ && cocoaSession.m_boundInterfaceIdentifier.isNull()
+ && !cocoaSession.m_proxyConfiguration)
return;
auto mutableRequest = adoptNS([nsRequest mutableCopy]);
@@ -108,6 +111,9 @@
if (!cocoaSession.m_boundInterfaceIdentifier.isNull())
[mutableRequest setBoundInterfaceIdentifier:cocoaSession.m_boundInterfaceIdentifier];
+ if (cocoaSession.m_proxyConfiguration)
+ CFURLRequestSetProxySettings([mutableRequest _CFURLRequest], cocoaSession.m_proxyConfiguration.get());
+
nsRequest = mutableRequest.autorelease();
}
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (231263 => 231264)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h 2018-05-02 21:17:58 UTC (rev 231264)
@@ -82,6 +82,7 @@
RetainPtr<WKNetworkSessionDelegate> m_statelessSessionDelegate;
String m_boundInterfaceIdentifier;
+ RetainPtr<CFDictionaryRef> m_proxyConfiguration;
};
} // namespace WebKit
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (231263 => 231264)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2018-05-02 21:17:58 UTC (rev 231264)
@@ -655,6 +655,7 @@
NetworkSessionCocoa::NetworkSessionCocoa(NetworkSessionCreationParameters&& parameters)
: NetworkSession(parameters.sessionID)
, m_boundInterfaceIdentifier(parameters.boundInterfaceIdentifier)
+ , m_proxyConfiguration(parameters.proxyConfiguration)
{
ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies));
Modified: trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (231263 => 231264)
--- trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/Shared/WebsiteDataStoreParameters.cpp 2018-05-02 21:17:58 UTC (rev 231264)
@@ -89,7 +89,11 @@
WebsiteDataStoreParameters WebsiteDataStoreParameters::privateSessionParameters(PAL::SessionID sessionID)
{
ASSERT(sessionID.isEphemeral());
- return { { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }, { sessionID, { }, AllowsCellularAccess::Yes }};
+ return { { }, { }, { }, { }, WebsiteDataStore::defaultCacheStoragePerOriginQuota, { }, { sessionID, { }, AllowsCellularAccess::Yes
+#if PLATFORM(COCOA)
+ , nullptr
+#endif
+ }};
}
} // namespace WebKit
Modified: trunk/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp (231263 => 231264)
--- trunk/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp 2018-05-02 21:17:58 UTC (rev 231264)
@@ -409,6 +409,12 @@
void encode(Encoder& encoder, CFDictionaryRef dictionary)
{
+ if (!dictionary) {
+ encoder << true;
+ return;
+ }
+ encoder << false;
+
CFIndex size = CFDictionaryGetCount(dictionary);
Vector<CFTypeRef, 32> keys(size);
Vector<CFTypeRef, 32> values(size);
@@ -433,6 +439,14 @@
bool decode(Decoder& decoder, RetainPtr<CFDictionaryRef>& result)
{
+ bool isNull = false;
+ if (!decoder.decode(isNull))
+ return false;
+ if (isNull) {
+ result = nullptr;
+ return true;
+ }
+
uint64_t size;
if (!decoder.decode(size))
return false;
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (231263 => 231264)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm 2018-05-02 21:17:58 UTC (rev 231264)
@@ -300,6 +300,16 @@
return _websiteDataStore->websiteDataStore().allowsCellularAccess() == WebKit::AllowsCellularAccess::Yes;
}
+- (void)_setProxyConfiguration:(NSDictionary *)configuration
+{
+ _websiteDataStore->websiteDataStore().setProxyConfiguration((CFDictionaryRef)configuration);
+}
+
+- (NSDictionary *)_proxyConfiguration
+{
+ return (NSDictionary *)_websiteDataStore->websiteDataStore().proxyConfiguration();
+}
+
- (void)_resourceLoadStatisticsSetShouldSubmitTelemetry:(BOOL)value
{
auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (231263 => 231264)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h 2018-05-02 21:17:58 UTC (rev 231264)
@@ -52,6 +52,7 @@
@property (nonatomic, setter=_setBoundInterfaceIdentifier:) NSString *_boundInterfaceIdentifier WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
@property (nonatomic, setter=_setAllowsCellularAccess:) BOOL _allowsCellularAccess WK_API_AVAILABLE(macosx(10.13.4), ios(11.3));
+@property (nonatomic, setter=_setProxyConfiguration:) NSDictionary *_proxyConfiguration WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
- (void)_resourceLoadStatisticsSetShouldSubmitTelemetry:(BOOL)value WK_API_AVAILABLE(macosx(10.13), ios(11.0));
- (void)_setResourceLoadStatisticsTestingCallback:(nullable void (^)(WKWebsiteDataStore *, NSString *))callback WK_API_AVAILABLE(macosx(10.13), ios(11.0));
Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (231263 => 231264)
--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm 2018-05-02 21:17:58 UTC (rev 231264)
@@ -58,7 +58,7 @@
resolveDirectoriesIfNecessary();
WebsiteDataStoreParameters parameters;
- parameters.networkSessionParameters = { m_sessionID, m_boundInterfaceIdentifier, m_allowsCellularAccess };
+ parameters.networkSessionParameters = { m_sessionID, m_boundInterfaceIdentifier, m_allowsCellularAccess, m_proxyConfiguration };
auto cookieFile = resolvedCookieStorageFile();
Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (231263 => 231264)
--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2018-05-02 21:13:28 UTC (rev 231263)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h 2018-05-02 21:17:58 UTC (rev 231264)
@@ -163,6 +163,11 @@
void setAllowsCellularAccess(AllowsCellularAccess allows) { m_allowsCellularAccess = allows; }
AllowsCellularAccess allowsCellularAccess() { return m_allowsCellularAccess; }
+#if PLATFORM(COCOA)
+ void setProxyConfiguration(CFDictionaryRef configuration) { m_proxyConfiguration = configuration; }
+ CFDictionaryRef proxyConfiguration() { return m_proxyConfiguration.get(); }
+#endif
+
static void allowWebsiteDataRecordsForAllOrigins();
private:
@@ -210,6 +215,7 @@
#if PLATFORM(COCOA)
Vector<uint8_t> m_uiProcessCookieStorageIdentifier;
RetainPtr<CFHTTPCookieStorageRef> m_cfCookieStorage;
+ RetainPtr<CFDictionaryRef> m_proxyConfiguration;
#endif
HashSet<WebCore::Cookie> m_pendingCookies;