WebKit Bugzilla
Attachment 339256 Details for
Bug 185179
: Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185179-20180501191152.patch (text/plain), 11.53 KB, created by
Alex Christensen
on 2018-05-01 19:11:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-05-01 19:11:53 PDT
Size:
11.53 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 231220) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,33 @@ >+2018-05-01 Alex Christensen <achristensen@webkit.org> >+ >+ Add WKWebsiteDataStorePrivate._proxyConfiguration SPI >+ https://bugs.webkit.org/show_bug.cgi?id=185179 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-01 Jer Noble <jer.noble@apple.com> > > Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value >Index: Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (revision 231215) >+++ Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (working copy) >@@ -26,6 +26,7 @@ > #pragma once > > #include "ArgumentCoders.h" >+#include "ArgumentCodersCF.h" > #include <pal/SessionID.h> > #include <wtf/EnumTraits.h> > #include <wtf/text/WTFString.h> >@@ -43,6 +44,9 @@ struct NetworkSessionCreationParameters > 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 +54,9 @@ inline void NetworkSessionCreationParame > 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 +75,20 @@ inline std::optional<NetworkSessionCreat > 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 >Index: Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (revision 231215) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (working copy) >@@ -92,7 +92,10 @@ void NetworkDataTaskCocoa::applySniffing > 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 @@ void NetworkDataTaskCocoa::applySniffing > if (!cocoaSession.m_boundInterfaceIdentifier.isNull()) > [mutableRequest setBoundInterfaceIdentifier:cocoaSession.m_boundInterfaceIdentifier]; > >+ if (cocoaSession.m_proxyConfiguration) >+ CFURLRequestSetProxySettings([mutableRequest _CFURLRequest], cocoaSession.m_proxyConfiguration.get()); >+ > nsRequest = mutableRequest.autorelease(); > } > >Index: Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (revision 231215) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (working copy) >@@ -82,6 +82,7 @@ private: > RetainPtr<WKNetworkSessionDelegate> m_statelessSessionDelegate; > > String m_boundInterfaceIdentifier; >+ RetainPtr<CFDictionaryRef> m_proxyConfiguration; > }; > > } // namespace WebKit >Index: Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (revision 231215) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (working copy) >@@ -655,6 +655,7 @@ Ref<NetworkSession> NetworkSessionCocoa: > NetworkSessionCocoa::NetworkSessionCocoa(NetworkSessionCreationParameters&& parameters) > : NetworkSession(parameters.sessionID) > , m_boundInterfaceIdentifier(parameters.boundInterfaceIdentifier) >+ , m_proxyConfiguration(parameters.proxyConfiguration) > { > ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); > >Index: Source/WebKit/Shared/WebsiteDataStoreParameters.cpp >=================================================================== >--- Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (revision 231215) >+++ Source/WebKit/Shared/WebsiteDataStoreParameters.cpp (working copy) >@@ -89,7 +89,11 @@ std::optional<WebsiteDataStoreParameters > 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 >Index: Source/WebKit/Shared/cf/ArgumentCodersCF.cpp >=================================================================== >--- Source/WebKit/Shared/cf/ArgumentCodersCF.cpp (revision 231215) >+++ Source/WebKit/Shared/cf/ArgumentCodersCF.cpp (working copy) >@@ -409,6 +409,12 @@ bool decode(Decoder& decoder, RetainPtr< > > 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 @@ void encode(Encoder& encoder, CFDictiona > > 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; >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (revision 231215) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (working copy) >@@ -300,6 +300,16 @@ - (BOOL)_allowsCellularAccess > 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(); >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (revision 231215) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (working copy) >@@ -52,6 +52,7 @@ typedef NS_OPTIONS(NSUInteger, _WKWebsit > > @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)); >Index: Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >=================================================================== >--- Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (revision 231215) >+++ Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (working copy) >@@ -163,6 +163,11 @@ public: > 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 @@ private: > #if PLATFORM(COCOA) > Vector<uint8_t> m_uiProcessCookieStorageIdentifier; > RetainPtr<CFHTTPCookieStorageRef> m_cfCookieStorage; >+ RetainPtr<CFDictionaryRef> m_proxyConfiguration; > #endif > HashSet<WebCore::Cookie> m_pendingCookies; > >Index: Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm >=================================================================== >--- Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (revision 231215) >+++ Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (working copy) >@@ -58,7 +58,7 @@ WebsiteDataStoreParameters WebsiteDataSt > resolveDirectoriesIfNecessary(); > > WebsiteDataStoreParameters parameters; >- parameters.networkSessionParameters = { m_sessionID, m_boundInterfaceIdentifier, m_allowsCellularAccess }; >+ parameters.networkSessionParameters = { m_sessionID, m_boundInterfaceIdentifier, m_allowsCellularAccess, m_proxyConfiguration }; > > auto cookieFile = resolvedCookieStorageFile(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185179
:
339256
|
339298
|
339309
|
339311