Changeset 247625 in webkit
- Timestamp:
- Jul 18, 2019 4:46:09 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247567 r247625 1 2019-07-18 Alex Christensen <achristensen@webkit.org> 2 3 Add and test _WKWebsiteDataStoreConfiguration.deviceIdHashSaltsStorageDirectory SPI 4 https://bugs.webkit.org/show_bug.cgi?id=199923 5 6 Reviewed by Youenn Fablet. 7 8 This is a step towards us getting rid of WebsiteDataStore::legacyDefaultDataStoreConfiguration 9 10 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: 11 (-[WKWebsiteDataStore _initWithConfiguration:]): 12 * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: 13 * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: 14 (-[_WKWebsiteDataStoreConfiguration deviceIdHashSaltsStorageDirectory]): 15 (-[_WKWebsiteDataStoreConfiguration setDeviceIdHashSaltsStorageDirectory:]): 16 1 17 2019-07-18 Alex Christensen <achristensen@webkit.org> 2 18 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
r247567 r247625 251 251 if (configuration.networkCacheDirectory) 252 252 config->setNetworkCacheDirectory(configuration.networkCacheDirectory.path); 253 if (configuration.deviceIdHashSaltsStorageDirectory) 254 config->setDeviceIdHashSaltsStorageDirectory(configuration.deviceIdHashSaltsStorageDirectory.path); 253 255 } else { 254 256 RELEASE_ASSERT(!configuration._webStorageDirectory); … … 260 262 RELEASE_ASSERT(!configuration._serviceWorkerRegistrationDirectory); 261 263 RELEASE_ASSERT(!configuration.networkCacheDirectory); 264 RELEASE_ASSERT(!configuration.deviceIdHashSaltsStorageDirectory); 262 265 } 263 266 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
r247567 r247625 55 55 @property (nonatomic, copy, setter=_setServiceWorkerRegistrationDirectory:) NSURL *_serviceWorkerRegistrationDirectory WK_API_AVAILABLE(macos(10.13.4), ios(11.3)); 56 56 @property (nonatomic, nullable, copy) NSURL *networkCacheDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 57 @property (nonatomic, nullable, copy) NSURL *deviceIdHashSaltsStorageDirectory WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 57 58 58 59 // Testing only. -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
r247567 r247625 103 103 } 104 104 105 - (NSURL *)deviceIdHashSaltsStorageDirectory 106 { 107 return [NSURL fileURLWithPath:_configuration->deviceIdHashSaltsStorageDirectory() isDirectory:YES]; 108 } 109 110 - (void)setDeviceIdHashSaltsStorageDirectory:(NSURL *)url 111 { 112 if (!_configuration->isPersistent()) 113 [NSException raise:NSInvalidArgumentException format:@"Cannot set deviceIdHashSaltsStorageDirectory on a non-persistent _WKWebsiteDataStoreConfiguration."]; 114 checkURLArgument(url); 115 _configuration->setDeviceIdHashSaltsStorageDirectory(url.path); 116 } 117 105 118 - (NSURL *)_webSQLDatabaseDirectory 106 119 { -
trunk/Tools/ChangeLog
r247622 r247625 1 2019-07-18 Alex Christensen <achristensen@webkit.org> 2 3 Add and test _WKWebsiteDataStoreConfiguration.deviceIdHashSaltsStorageDirectory SPI 4 https://bugs.webkit.org/show_bug.cgi?id=199923 5 6 Reviewed by Youenn Fablet. 7 8 * TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm: 9 (TestWebKitAPI::TEST): 10 1 11 2019-07-18 Aakash Jain <aakash_jain@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm
r242339 r247625 35 35 #import <WebKit/WKWebView.h> 36 36 #import <WebKit/WKWebViewConfiguration.h> 37 #import <WebKit/WKWebsiteDataStorePrivate.h> 37 38 #import <WebKit/_WKProcessPoolConfiguration.h> 39 #import <WebKit/_WKWebsiteDataStoreConfiguration.h> 38 40 39 41 static bool okToProceed = false; … … 100 102 } 101 103 104 TEST(WebKit, DeviceIdHashSaltsDirectory) 105 { 106 NSURL *tempDir = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"CustomPathsTest"] isDirectory:YES]; 107 NSURL *hashSaltLocation = [tempDir URLByAppendingPathComponent:@"1"]; 108 NSFileManager *fileManager = [NSFileManager defaultManager]; 109 EXPECT_FALSE([fileManager fileExistsAtPath:hashSaltLocation.path]); 110 111 auto websiteDataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]); 112 [websiteDataStoreConfiguration setDeviceIdHashSaltsStorageDirectory:tempDir]; 113 114 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 115 [configuration setWebsiteDataStore:[[[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration.get()] autorelease]]; 116 auto processPoolConfig = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 117 auto preferences = [configuration preferences]; 118 preferences._mediaCaptureRequiresSecureConnection = NO; 119 preferences._mediaDevicesEnabled = YES; 120 preferences._mockCaptureDevicesEnabled = YES; 121 auto webView = [[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500) configuration:configuration.get() processPoolConfiguration:processPoolConfig.get()]; 122 auto delegate = adoptNS([[NavigationWhileGetUserMediaPromptDisplayedUIDelegate alloc] init]); 123 webView.UIDelegate = delegate.get(); 124 125 [webView loadTestPageNamed:@"enumerateMediaDevices"]; 126 127 while (![fileManager fileExistsAtPath:hashSaltLocation.path]) 128 Util::spinRunLoop(); 129 NSError *error = nil; 130 [fileManager removeItemAtPath:tempDir.path error:&error]; 131 EXPECT_FALSE(error); 132 } 133 102 134 } // namespace TestWebKitAPI 103 135
Note: See TracChangeset
for help on using the changeset viewer.