Changeset 263736 in webkit
- Timestamp:
- Jun 30, 2020 2:26:57 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r263726 r263736 1 2020-06-30 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r263724. 4 https://bugs.webkit.org/show_bug.cgi?id=213781 5 6 7 Reverted changeset: 8 9 "Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to 10 replace _WKProcessPoolConfiguration.hstsStorageDirectory" 11 https://bugs.webkit.org/show_bug.cgi?id=213048 12 https://trac.webkit.org/changeset/263724 13 1 14 2020-06-29 Geoffrey Garen <ggaren@apple.com> 2 15 -
trunk/Source/WTF/wtf/PlatformHave.h
r263724 r263736 408 408 #endif 409 409 410 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) \411 || ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \412 || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \413 || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)414 #define HAVE_HSTS_STORAGE 1415 #endif416 417 410 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) 418 411 #define HAVE_CFNETWORK_METRICS_APIS_V4 1 -
trunk/Source/WebCore/PAL/ChangeLog
r263724 r263736 1 2020-06-30 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r263724. 4 https://bugs.webkit.org/show_bug.cgi?id=213781 5 6 7 Reverted changeset: 8 9 "Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to 10 replace _WKProcessPoolConfiguration.hstsStorageDirectory" 11 https://bugs.webkit.org/show_bug.cgi?id=213048 12 https://trac.webkit.org/changeset/263724 13 1 14 2020-06-29 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
r263724 r263736 408 408 Boolean _CFNetworkSetATSContext(CFDataRef); 409 409 410 #if PLATFORM(COCOA) && !HAVE(HSTS_STORAGE)410 #if PLATFORM(COCOA) 411 411 extern const CFStringRef _kCFNetworkHSTSPreloaded; 412 412 CFDictionaryRef _CFNetworkCopyHSTSPolicies(CFURLStorageSessionRef); … … 459 459 @end 460 460 461 #if HAVE(HSTS_STORAGE)462 @interface _NSHSTSStorage : NSObject463 -(instancetype)initPersistentStoreWithURL:(nullable NSURL*)path;464 -(BOOL)shouldPromoteHostToHTTPS:(NSString *)host;465 -(NSArray<NSString *> *)nonPreloadedHosts;466 -(void)resetHSTSForHost:(NSString *)host;467 -(void)resetHSTSHostsSinceDate:(NSDate *)date;468 @end469 #endif470 471 461 @interface NSURLSessionConfiguration () 472 462 // FIXME: Remove this once rdar://problem/40650244 is in a build. 473 463 @property (copy) NSDictionary *_socketStreamProperties; 474 #if HAVE(HSTS_STORAGE)475 @property (nullable, retain) _NSHSTSStorage *_hstsStorage;476 #endif477 464 @end 478 465 -
trunk/Source/WebKit/ChangeLog
r263734 r263736 1 2020-06-30 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r263724. 4 https://bugs.webkit.org/show_bug.cgi?id=213781 5 6 7 Reverted changeset: 8 9 "Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to 10 replace _WKProcessPoolConfiguration.hstsStorageDirectory" 11 https://bugs.webkit.org/show_bug.cgi?id=213048 12 https://trac.webkit.org/changeset/263724 13 1 14 2020-06-30 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r263724 r263736 1535 1535 1536 1536 #if PLATFORM(COCOA) || USE(SOUP) 1537 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) 1538 callbackAggregator->m_websiteData.hostNamesWithHSTSCache = hostNamesWithHSTSCache(sessionID); 1537 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) { 1538 if (auto* networkStorageSession = storageSession(sessionID)) 1539 getHostNamesWithHSTSCache(*networkStorageSession, callbackAggregator->m_websiteData.hostNamesWithHSTSCache); 1540 } 1539 1541 #endif 1540 1542 … … 1595 1597 { 1596 1598 #if PLATFORM(COCOA) || USE(SOUP) 1597 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) 1598 clearHSTSCache(sessionID, modifiedSince); 1599 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) { 1600 if (auto* networkStorageSession = storageSession(sessionID)) 1601 clearHSTSCache(*networkStorageSession, modifiedSince); 1602 } 1599 1603 #endif 1600 1604 … … 1698 1702 1699 1703 #if PLATFORM(COCOA) || USE(SOUP) 1700 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) 1701 deleteHSTSCacheForHostNames(sessionID, HSTSCacheHostNames); 1704 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) { 1705 if (auto* networkStorageSession = storageSession(sessionID)) 1706 deleteHSTSCacheForHostNames(*networkStorageSession, HSTSCacheHostNames); 1707 } 1702 1708 #endif 1703 1709 … … 1867 1873 #if PLATFORM(COCOA) || USE(SOUP) 1868 1874 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) { 1869 hostNamesWithHSTSCache = this->hostNamesWithHSTSCache(sessionID); 1870 hostnamesWithHSTSToDelete = filterForRegistrableDomains(domainsToDeleteAllNonCookieWebsiteDataFor, hostNamesWithHSTSCache); 1871 1872 for (const auto& host : hostnamesWithHSTSToDelete) 1873 callbackAggregator->m_domains.add(RegistrableDomain::uncheckedCreateFromHost(host)); 1874 1875 deleteHSTSCacheForHostNames(sessionID, hostnamesWithHSTSToDelete); 1875 if (auto* networkStorageSession = storageSession(sessionID)) { 1876 getHostNamesWithHSTSCache(*networkStorageSession, hostNamesWithHSTSCache); 1877 hostnamesWithHSTSToDelete = filterForRegistrableDomains(domainsToDeleteAllNonCookieWebsiteDataFor, hostNamesWithHSTSCache); 1878 1879 for (const auto& host : hostnamesWithHSTSToDelete) 1880 callbackAggregator->m_domains.add(RegistrableDomain::uncheckedCreateFromHost(host)); 1881 1882 deleteHSTSCacheForHostNames(*networkStorageSession, hostnamesWithHSTSToDelete); 1883 } 1876 1884 } 1877 1885 #endif … … 2050 2058 })); 2051 2059 2052 auto& websiteData = callbackAggregator->m_websiteData;2060 auto& websiteDataStore = callbackAggregator->m_websiteData; 2053 2061 2054 2062 if (websiteDataTypes.contains(WebsiteDataType::Cookies)) { 2055 2063 if (auto* networkStorageSession = storageSession(sessionID)) 2056 networkStorageSession->getHostnamesWithCookies(websiteData .hostNamesWithCookies);2064 networkStorageSession->getHostnamesWithCookies(websiteDataStore.hostNamesWithCookies); 2057 2065 } 2058 2066 2059 2067 #if PLATFORM(COCOA) || USE(SOUP) 2060 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) 2061 websiteData.hostNamesWithHSTSCache = hostNamesWithHSTSCache(sessionID); 2068 if (websiteDataTypes.contains(WebsiteDataType::HSTSCache)) { 2069 if (auto* networkStorageSession = storageSession(sessionID)) 2070 getHostNamesWithHSTSCache(*networkStorageSession, websiteDataStore.hostNamesWithHSTSCache); 2071 } 2062 2072 #endif 2063 2073 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r263724 r263736 194 194 #endif 195 195 #if PLATFORM(COCOA) || USE(SOUP) 196 HashSet<String> hostNamesWithHSTSCache(PAL::SessionID) const;197 void deleteHSTSCacheForHostNames( PAL::SessionID, const Vector<String>&);198 void clearHSTSCache( PAL::SessionID, WallTime modifiedSince);196 void getHostNamesWithHSTSCache(WebCore::NetworkStorageSession&, HashSet<String>&); 197 void deleteHSTSCacheForHostNames(WebCore::NetworkStorageSession&, const Vector<String>&); 198 void clearHSTSCache(WebCore::NetworkStorageSession&, WallTime modifiedSince); 199 199 #endif 200 200 -
trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp
r263724 r263736 58 58 encoder << http3Enabled; 59 59 #endif 60 encoder << hstsStorageDirectory;61 encoder << hstsStorageDirectoryExtensionHandle;62 60 #if USE(SOUP) 63 61 encoder << cookiePersistentStoragePath; … … 156 154 #endif 157 155 158 Optional<String> hstsStorageDirectory;159 decoder >> hstsStorageDirectory;160 if (!hstsStorageDirectory)161 return WTF::nullopt;162 163 Optional<SandboxExtension::Handle> hstsStorageDirectoryExtensionHandle;164 decoder >> hstsStorageDirectoryExtensionHandle;165 if (!hstsStorageDirectoryExtensionHandle)166 return WTF::nullopt;167 168 156 #if USE(SOUP) 169 157 Optional<String> cookiePersistentStoragePath; … … 288 276 , WTFMove(*http3Enabled) 289 277 #endif 290 , WTFMove(*hstsStorageDirectory)291 , WTFMove(*hstsStorageDirectoryExtensionHandle)292 278 #if USE(SOUP) 293 279 , WTFMove(*cookiePersistentStoragePath) -
trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h
r263724 r263736 70 70 bool http3Enabled { false }; 71 71 #endif 72 String hstsStorageDirectory;73 SandboxExtension::Handle hstsStorageDirectoryExtensionHandle;74 72 #if USE(SOUP) 75 73 String cookiePersistentStoragePath; -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
r263724 r263736 135 135 } 136 136 137 #if !HAVE(HSTS_STORAGE)138 137 static void filterPreloadHSTSEntry(const void* key, const void* value, void* context) 139 138 { … … 154 153 hostnames->add((CFStringRef)key); 155 154 } 156 #endif 157 158 HashSet<String> NetworkProcess::hostNamesWithHSTSCache(PAL::SessionID sessionID) const 159 { 160 HashSet<String> hostNames; 161 #if HAVE(HSTS_STORAGE) 162 if (auto* networkSession = static_cast<NetworkSessionCocoa*>(this->networkSession(sessionID))) { 163 for (NSString *host in networkSession->hstsStorage().nonPreloadedHosts) 164 hostNames.add(host); 155 156 void NetworkProcess::getHostNamesWithHSTSCache(WebCore::NetworkStorageSession& session, HashSet<String>& hostNames) 157 { 158 if (auto HSTSPolicies = adoptCF(_CFNetworkCopyHSTSPolicies(session.platformSession()))) 159 CFDictionaryApplyFunction(HSTSPolicies.get(), filterPreloadHSTSEntry, &hostNames); 160 } 161 162 void NetworkProcess::deleteHSTSCacheForHostNames(WebCore::NetworkStorageSession& session, const Vector<String>& hostNames) 163 { 164 for (auto& hostName : hostNames) { 165 auto url = URL({ }, makeString("https://", hostName)); 166 _CFNetworkResetHSTS(url.createCFURL().get(), session.platformSession()); 165 167 } 166 #else 167 if (auto* session = storageSession(sessionID)) { 168 if (auto HSTSPolicies = adoptCF(_CFNetworkCopyHSTSPolicies(session->platformSession()))) 169 CFDictionaryApplyFunction(HSTSPolicies.get(), filterPreloadHSTSEntry, &hostNames); 170 } 171 #endif 172 return hostNames; 173 } 174 175 void NetworkProcess::deleteHSTSCacheForHostNames(PAL::SessionID sessionID, const Vector<String>& hostNames) 176 { 177 #if HAVE(HSTS_STORAGE) 178 if (auto* networkSession = static_cast<NetworkSessionCocoa*>(this->networkSession(sessionID))) { 179 for (auto& hostName : hostNames) 180 [networkSession->hstsStorage() resetHSTSForHost:hostName]; 181 } 182 #else 183 if (auto* session = storageSession(sessionID)) { 184 for (auto& hostName : hostNames) { 185 auto url = URL({ }, makeString("https://", hostName)); 186 _CFNetworkResetHSTS(url.createCFURL().get(), session->platformSession()); 187 } 188 } 189 #endif 190 } 191 192 void NetworkProcess::clearHSTSCache(PAL::SessionID sessionID, WallTime modifiedSince) 168 } 169 170 void NetworkProcess::clearHSTSCache(WebCore::NetworkStorageSession& session, WallTime modifiedSince) 193 171 { 194 172 NSTimeInterval timeInterval = modifiedSince.secondsSinceEpoch().seconds(); 195 173 NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeInterval]; 196 #if HAVE(HSTS_STORAGE) 197 if (auto* networkSession = static_cast<NetworkSessionCocoa*>(this->networkSession(sessionID))) 198 [networkSession->hstsStorage() resetHSTSHostsSinceDate:date]; 199 #else 200 if (auto* session = storageSession(sessionID)) 201 _CFNetworkResetHSTSHostsSinceDate(session->platformSession(), (__bridge CFDateRef)date); 202 #endif 174 175 _CFNetworkResetHSTSHostsSinceDate(session.platformSession(), (__bridge CFDateRef)date); 203 176 } 204 177 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
r263724 r263736 34 34 OBJC_CLASS WKNetworkSessionDelegate; 35 35 OBJC_CLASS WKNetworkSessionWebSocketDelegate; 36 OBJC_CLASS _NSHSTSStorage;37 36 38 37 #include "DownloadID.h" … … 106 105 void taskFailed(NetworkDataTaskCocoa::TaskIdentifier); 107 106 NSURLCredential *successfulClientCertificateForHost(const String& host, uint16_t port) const; 108 _NSHSTSStorage *hstsStorage() const;109 107 110 108 private: -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r263724 r263736 68 68 69 69 #import "DeviceManagementSoftLink.h" 70 71 // FIXME: Remove this soft link once rdar://problem/50109631 is in a build and bots are updated.72 SOFT_LINK_FRAMEWORK(CFNetwork)73 SOFT_LINK_CLASS_OPTIONAL(CFNetwork, _NSHSTSStorage)74 70 75 71 using namespace WebKit; … … 1097 1093 } 1098 1094 1099 _NSHSTSStorage *NetworkSessionCocoa::hstsStorage() const1100 {1101 #if HAVE(HSTS_STORAGE)1102 NSURLSessionConfiguration *configuration = m_sessionWithCredentialStorage.session.get().configuration;1103 // FIXME: Remove this respondsToSelector check once rdar://problem/50109631 is in a build and bots are updated.1104 if ([configuration respondsToSelector:@selector(_hstsStorage)])1105 return m_sessionWithCredentialStorage.session.get().configuration._hstsStorage;1106 #endif1107 return nil;1108 }1109 1110 1095 const String& NetworkSessionCocoa::boundInterfaceIdentifier() const 1111 1096 { … … 1187 1172 1188 1173 NSURLSessionConfiguration *configuration = configurationForSessionID(m_sessionID); 1189 1190 #if HAVE(HSTS_STORAGE)1191 if (!!parameters.hstsStorageDirectory && !m_sessionID.isEphemeral()) {1192 SandboxExtension::consumePermanently(parameters.hstsStorageDirectoryExtensionHandle);1193 // FIXME: Remove this respondsToSelector check once rdar://problem/50109631 is in a build and bots are updated.1194 if ([configuration respondsToSelector:@selector(_hstsStorage)])1195 configuration._hstsStorage = [[alloc_NSHSTSStorageInstance() initPersistentStoreWithURL:[NSURL fileURLWithPath:parameters.hstsStorageDirectory isDirectory:YES]] autorelease];1196 }1197 #endif1198 1174 1199 1175 #if HAVE(APP_SSO) || PLATFORM(MACCATALYST) -
trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
r263724 r263736 95 95 } 96 96 97 HashSet<String> NetworkProcess::hostNamesWithHSTSCache(PAL::SessionID sessionID) const 98 { 99 HashSet<String> hostNames; 100 const auto* session = static_cast<NetworkSessionSoup*>(networkSession(sessionID)); 97 void NetworkProcess::getHostNamesWithHSTSCache(WebCore::NetworkStorageSession& storageSession, HashSet<String>& hostNames) 98 { 99 const auto* session = static_cast<NetworkSessionSoup*>(networkSession(storageSession.sessionID())); 101 100 session->soupNetworkSession().getHostNamesWithHSTSCache(hostNames); 102 return hostNames; 103 } 104 105 void NetworkProcess::deleteHSTSCacheForHostNames(PAL::SessionID sessionID, const Vector<String>& hostNames) 106 { 107 const auto* session = static_cast<NetworkSessionSoup*>(networkSession(sessionID)); 101 } 102 103 void NetworkProcess::deleteHSTSCacheForHostNames(WebCore::NetworkStorageSession& storageSession, const Vector<String>& hostNames) 104 { 105 const auto* session = static_cast<NetworkSessionSoup*>(networkSession(storageSession.sessionID())); 108 106 session->soupNetworkSession().deleteHSTSCacheForHostNames(hostNames); 109 107 } 110 108 111 void NetworkProcess::clearHSTSCache( PAL::SessionID sessionID, WallTime modifiedSince)112 { 113 const auto* session = static_cast<NetworkSessionSoup*>(networkSession(s essionID));109 void NetworkProcess::clearHSTSCache(WebCore::NetworkStorageSession& storageSession, WallTime modifiedSince) 110 { 111 const auto* session = static_cast<NetworkSessionSoup*>(networkSession(storageSession.sessionID())); 114 112 session->soupNetworkSession().clearHSTSCache(modifiedSince); 115 113 } -
trunk/Source/WebKit/UIProcess/API/C/mac/WKContextPrivateMac.h
r263724 r263736 28 28 29 29 #include <WebKit/WKBase.h> 30 #include <WebKit/WKDeprecated.h>31 30 #include <WebKit/WKPluginLoadPolicy.h> 32 31 … … 45 44 WK_EXPORT void WKContextGetInfoForInstalledPlugIns(WKContextRef context, WKContextGetInfoForInstalledPlugInsBlock block); 46 45 47 WK_EXPORT void WKContextResetHSTSHosts(WKContextRef context) WK_C_API_DEPRECATED; 48 WK_EXPORT void WKContextResetHSTSHostsAddedAfterDate(WKContextRef context, double startDateIntervalSince1970) WK_C_API_DEPRECATED; 46 WK_EXPORT void WKContextResetHSTSHosts(WKContextRef context); 47 48 // The time here is relative to the Unix epoch. 49 WK_EXPORT void WKContextResetHSTSHostsAddedAfterDate(WKContextRef context, double startDateIntervalSince1970); 49 50 50 51 WK_EXPORT void WKContextRegisterSchemeForCustomProtocol(WKContextRef context, WKStringRef scheme); -
trunk/Source/WebKit/UIProcess/API/C/mac/WKContextPrivateMac.mm
r263724 r263736 102 102 } 103 103 104 void WKContextResetHSTSHosts(WKContextRef )104 void WKContextResetHSTSHosts(WKContextRef context) 105 105 { 106 return WebKit::toImpl(context)->resetHSTSHosts(); 106 107 } 107 108 108 void WKContextResetHSTSHostsAddedAfterDate(WKContextRef , double)109 void WKContextResetHSTSHostsAddedAfterDate(WKContextRef context, double startDateIntervalSince1970) 109 110 { 111 return WebKit::toImpl(context)->resetHSTSHostsAddedAfterDate(startDateIntervalSince1970); 110 112 } 111 113 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
r263724 r263736 69 69 @property (nonatomic) BOOL pageCacheEnabled WK_API_AVAILABLE(macos(10.14), ios(12.0)); 70 70 @property (nonatomic, getter=isJITEnabled) BOOL JITEnabled WK_API_AVAILABLE(macos(10.14.4), ios(12.2)); 71 @property (nonatomic, nullable, copy, setter=setHSTSStorageDirectory:) NSURL *hstsStorageDirectory WK_API_ DEPRECATED_WITH_REPLACEMENT("_WKWebsiteDataStoreConfiguration.hstsStorageDirectory", macos(10.15, WK_MAC_TBA), ios(13.0, WK_IOS_TBA));71 @property (nonatomic, nullable, copy, setter=setHSTSStorageDirectory:) NSURL *hstsStorageDirectory WK_API_AVAILABLE(macos(10.15), ios(13.0)); 72 72 73 73 @property (nonatomic) BOOL configureJSCForTesting WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
r263724 r263736 73 73 @property (nonatomic) BOOL suppressesConnectionTerminationOnSystemChange WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 74 74 @property (nonatomic) BOOL allowsServerPreconnect WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 75 @property (nonatomic, nullable, copy, setter=setHSTSStorageDirectory:) NSURL *hstsStorageDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));76 75 77 76 @property (nonatomic, nullable, copy) NSURL *alternativeServicesStorageDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
r263724 r263736 291 291 } 292 292 293 - (NSURL *)hstsStorageDirectory294 {295 return [NSURL fileURLWithPath:_configuration->hstsStorageDirectory() isDirectory:YES];296 }297 298 - (void)setHSTSStorageDirectory:(NSURL *)url299 {300 if (!_configuration->isPersistent())301 [NSException raise:NSInvalidArgumentException format:@"Cannot set mediaKeysStorageDirectory on a non-persistent _WKWebsiteDataStoreConfiguration."];302 checkURLArgument(url);303 _configuration->setHSTSStorageDirectory(url.path);304 }305 306 293 - (NSURL *)alternativeServicesStorageDirectory 307 294 { -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r263724 r263736 729 729 } 730 730 731 static CFURLStorageSessionRef privateBrowsingSession() 732 { 733 static CFURLStorageSessionRef session; 734 static dispatch_once_t once; 735 dispatch_once(&once, ^{ 736 NSString *identifier = [NSString stringWithFormat:@"%@.PrivateBrowsing", [[NSBundle mainBundle] bundleIdentifier]]; 737 session = createPrivateStorageSession((__bridge CFStringRef)identifier); 738 }); 739 740 return session; 741 } 742 731 743 bool WebProcessPool::isURLKnownHSTSHost(const String& urlString) const 732 744 { … … 734 746 735 747 return _CFNetworkIsKnownHSTSHostWithSession(url.get(), nullptr); 748 } 749 750 void WebProcessPool::resetHSTSHosts() 751 { 752 _CFNetworkResetHSTSHostsWithSession(nullptr); 753 _CFNetworkResetHSTSHostsWithSession(privateBrowsingSession()); 754 } 755 756 void WebProcessPool::resetHSTSHostsAddedAfterDate(double startDateIntervalSince1970) 757 { 758 NSDate *startDate = [NSDate dateWithTimeIntervalSince1970:startDateIntervalSince1970]; 759 _CFNetworkResetHSTSHostsSinceDate(nullptr, (__bridge CFDateRef)startDate); 760 _CFNetworkResetHSTSHostsSinceDate(privateBrowsingSession(), (__bridge CFDateRef)startDate); 736 761 } 737 762 -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r263724 r263736 423 423 424 424 bool isURLKnownHSTSHost(const String& urlString) const; 425 void resetHSTSHosts(); 426 void resetHSTSHostsAddedAfterDate(double startDateIntervalSince1970); 425 427 426 428 static void registerGlobalURLSchemeAsHavingCustomProtocolHandlers(const String&); -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r263724 r263736 233 233 if (!m_configuration->cacheStorageDirectory().isEmpty() && m_resolvedConfiguration->cacheStorageDirectory().isEmpty()) 234 234 m_resolvedConfiguration->setCacheStorageDirectory(resolvePathForSandboxExtension(m_configuration->cacheStorageDirectory())); 235 if (!m_configuration->hstsStorageDirectory().isEmpty() && m_resolvedConfiguration->hstsStorageDirectory().isEmpty())236 m_resolvedConfiguration->setHSTSStorageDirectory(resolvePathForSandboxExtension(m_configuration->hstsStorageDirectory()));237 235 238 236 // Resolve directories for file paths. … … 2262 2260 SandboxExtension::createHandleForReadWriteDirectory(networkCacheDirectory, networkCacheDirectoryExtensionHandle); 2263 2261 2264 auto hstsStorageDirectory = resolvedHSTSStorageDirectory();2265 SandboxExtension::Handle hstsStorageDirectoryExtensionHandle;2266 if (!hstsStorageDirectory.isEmpty())2267 SandboxExtension::createHandleForReadWriteDirectory(hstsStorageDirectory, hstsStorageDirectoryExtensionHandle);2268 2269 2262 bool shouldIncludeLocalhostInResourceLoadStatistics = false; 2270 2263 bool enableResourceLoadStatisticsDebugMode = false; … … 2308 2301 networkSessionParameters.networkCacheDirectory = WTFMove(networkCacheDirectory); 2309 2302 networkSessionParameters.networkCacheDirectoryExtensionHandle = WTFMove(networkCacheDirectoryExtensionHandle); 2310 networkSessionParameters.hstsStorageDirectory = WTFMove(hstsStorageDirectory);2311 networkSessionParameters.hstsStorageDirectoryExtensionHandle = WTFMove(hstsStorageDirectoryExtensionHandle);2312 2303 networkSessionParameters.dataConnectionServiceType = m_configuration->dataConnectionServiceType(); 2313 2304 networkSessionParameters.fastServerTrustEvaluationEnabled = m_configuration->fastServerTrustEvaluationEnabled(); -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r263724 r263736 225 225 const String& resolvedServiceWorkerRegistrationDirectory() const { return m_resolvedConfiguration->serviceWorkerRegistrationDirectory(); } 226 226 const String& resolvedResourceLoadStatisticsDirectory() const { return m_resolvedConfiguration->resourceLoadStatisticsDirectory(); } 227 const String& resolvedHSTSStorageDirectory() const { return m_resolvedConfiguration->hstsStorageDirectory(); }228 227 229 228 DeviceIdHashSaltStorage& deviceIdHashSaltStorage() { return m_deviceIdHashSaltStorage.get(); } -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
r263724 r263736 68 68 copy->m_serviceWorkerRegistrationDirectory = this->m_serviceWorkerRegistrationDirectory; 69 69 copy->m_webSQLDatabaseDirectory = this->m_webSQLDatabaseDirectory; 70 #if USE(GLIB) 70 71 copy->m_hstsStorageDirectory = this->m_hstsStorageDirectory; 72 #endif 71 73 copy->m_localStorageDirectory = this->m_localStorageDirectory; 72 74 copy->m_mediaKeysStorageDirectory = this->m_mediaKeysStorageDirectory; -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h
r263724 r263736 67 67 const String& webSQLDatabaseDirectory() const { return m_webSQLDatabaseDirectory; } 68 68 void setWebSQLDatabaseDirectory(String&& directory) { m_webSQLDatabaseDirectory = WTFMove(directory); } 69 69 #if USE(GLIB) // According to r245075 this will eventually move here. 70 70 const String& hstsStorageDirectory() const { return m_hstsStorageDirectory; } 71 71 void setHSTSStorageDirectory(String&& directory) { m_hstsStorageDirectory = WTFMove(directory); } 72 72 #endif 73 73 const String& localStorageDirectory() const { return m_localStorageDirectory; } 74 74 void setLocalStorageDirectory(String&& directory) { m_localStorageDirectory = WTFMove(directory); } … … 175 175 String m_serviceWorkerRegistrationDirectory; 176 176 String m_webSQLDatabaseDirectory; 177 #if USE(GLIB) 177 178 String m_hstsStorageDirectory; 178 #if USE(GLIB)179 179 bool m_networkCacheSpeculativeValidationEnabled { true }; 180 180 #else
Note: See TracChangeset
for help on using the changeset viewer.