Changeset 215897 in webkit
- Timestamp:
- Apr 27, 2017, 3:37:29 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r215892 r215897 1 2017-04-27 Alex Christensen <achristensen@webkit.org> 2 3 Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration 4 https://bugs.webkit.org/show_bug.cgi?id=171399 5 6 Reviewed by Brady Eidson. 7 8 This SPI isn't hooked up yet, but it has a test that will need to be updated once it works. 9 10 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 11 * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: 12 (-[WKWebsiteDataStore _initWithConfiguration:]): 13 * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: 14 * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: 15 * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: 16 (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): 17 (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): 18 * UIProcess/WebsiteData/WebsiteDataStore.h: 19 (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): 20 1 21 2017-04-27 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r215653 r215897 247 247 248 248 - (WKNavigation *)_reloadWithoutContentBlockers WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 249 - (WKNavigation *)_reloadExpiredOnly WK_API_AVAILABLE(macosx( 10.13), ios(11.0));249 - (WKNavigation *)_reloadExpiredOnly WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 250 250 251 251 - (void)_killWebContentProcessAndResetState; … … 289 289 @property (nonatomic, readonly) BOOL _webProcessIsResponsive WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 290 290 291 @property (nonatomic, setter=_setFullscreenDelegate:) id<_WKFullscreenDelegate> _fullscreenDelegate WK_API_AVAILABLE(macosx( 10.13));291 @property (nonatomic, setter=_setFullscreenDelegate:) id<_WKFullscreenDelegate> _fullscreenDelegate WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 292 292 @property (nonatomic, readonly) BOOL _isInFullscreen WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 293 293 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
r215441 r215897 161 161 if (configuration._indexedDBDatabaseDirectory) 162 162 config.indexedDBDatabaseDirectory = configuration._indexedDBDatabaseDirectory.path; 163 if (configuration._cookieStorageDirectory) 164 config.cookieStorageDirectory = configuration._cookieStorageDirectory.path; 163 165 164 166 API::Object::constructInWrapper<API::WebsiteDataStore>(self, config); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKDraggableElementInfo.h
r215573 r215897 30 30 NS_ASSUME_NONNULL_BEGIN 31 31 32 WK_CLASS_AVAILABLE(macosx( 10.13), ios(11.0))32 WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) 33 33 @interface _WKDraggableElementInfo : NSObject <NSCopying> 34 34 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h
r213331 r215897 32 32 NS_ASSUME_NONNULL_BEGIN 33 33 34 WK_CLASS_AVAILABLE(macosx( 10.13), ios(11.0))34 WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) 35 35 @interface _WKWebsiteDataStoreConfiguration : NSObject 36 36 … … 38 38 @property (nonatomic, copy, setter=_setIndexedDBDatabaseDirectory:) NSURL *_indexedDBDatabaseDirectory; 39 39 @property (nonatomic, copy, setter=_setWebSQLDatabaseDirectory:) NSURL *_webSQLDatabaseDirectory; 40 @property (nonatomic, copy, setter=_setCookieStorageDirectory:) NSURL *_cookieStorageDirectory WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 40 41 41 42 @end -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm
r213331 r215897 41 41 RetainPtr<NSURL> _indexedDBDatabaseDirectoryURL; 42 42 RetainPtr<NSURL> _webSQLDatabaseDirectoryURL; 43 RetainPtr<NSURL> _cookieStorageDirectoryURL; 43 44 } 44 45 … … 69 70 _webSQLDatabaseDirectoryURL = adoptNS([url copy]); 70 71 } 72 73 -(NSURL *)_cookieStorageDirectory { 74 return _cookieStorageDirectoryURL.get(); 75 } 76 77 -(void)_setCookieStorageDirectory:(NSURL *)url { 78 checkURLArgument(url); 79 _cookieStorageDirectoryURL = adoptNS([url copy]); 80 } 81 71 82 @end 72 83 -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h
r215741 r215897 70 70 String resourceLoadStatisticsDirectory; 71 71 String javaScriptConfigurationDirectory; 72 String cookieStorageDirectory; 72 73 }; 73 74 static Ref<WebsiteDataStore> createNonPersistent(); … … 101 102 const String& resolvedDatabaseDirectory() const { return m_resolvedConfiguration.webSQLDatabaseDirectory; } 102 103 const String& resolvedJavaScriptConfigurationDirectory() const { return m_resolvedConfiguration.javaScriptConfigurationDirectory; } 104 const String& resolvedCookieStorageDirectory() const { return m_resolvedConfiguration.cookieStorageDirectory; } 103 105 104 106 StorageManager* storageManager() { return m_storageManager.get(); } -
trunk/Tools/ChangeLog
r215888 r215897 1 2017-04-27 Alex Christensen <achristensen@webkit.org> 2 3 Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration 4 https://bugs.webkit.org/show_bug.cgi?id=171399 5 6 Reviewed by Brady Eidson. 7 8 * TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html: 9 * TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm: 10 (TEST): 11 1 12 2017-04-27 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.html
r213241 r215897 1 1 <script> 2 2 3 // This test opens an IndexedDB, a WebSQL db, and makes a localStorage write.3 // This test opens an IndexedDB, a WebSQL db, and a cookie storage, and makes a localStorage write. 4 4 5 5 function log(msg) … … 24 24 } 25 25 26 document.cookie = "testkey=value; expires=Mon, 01 Jan 2035 00:00:00 GMT"; 27 log('cookie written'); 28 26 29 try { 27 30 openDatabase('WebsiteDataStoreCustomPathsSQL', '1.0', 'Test DB', 524288, function() { -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsiteDataStoreCustomPaths.mm
r213331 r215897 78 78 NSURL *idbPath = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/CustomWebsiteData/IndexedDB/" stringByExpandingTildeInPath]]; 79 79 NSURL *localStoragePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/CustomWebsiteData/LocalStorage/" stringByExpandingTildeInPath]]; 80 NSURL *cookieStoragePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/CustomWebsiteData/CookieStorage/" stringByExpandingTildeInPath]]; 80 81 81 82 [[NSFileManager defaultManager] removeItemAtURL:sqlPath error:nil]; 82 83 [[NSFileManager defaultManager] removeItemAtURL:idbPath error:nil]; 83 84 [[NSFileManager defaultManager] removeItemAtURL:localStoragePath error:nil]; 85 [[NSFileManager defaultManager] removeItemAtURL:cookieStoragePath error:nil]; 84 86 85 87 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:sqlPath.path]); 88 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:idbPath.path]); 86 89 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:localStoragePath.path]); 87 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath: idbPath.path]);90 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:cookieStoragePath.path]); 88 91 89 92 _WKWebsiteDataStoreConfiguration *websiteDataStoreConfiguration = [[_WKWebsiteDataStoreConfiguration alloc] init]; … … 91 94 websiteDataStoreConfiguration._indexedDBDatabaseDirectory = idbPath; 92 95 websiteDataStoreConfiguration._webStorageDirectory = localStoragePath; 96 websiteDataStoreConfiguration._cookieStorageDirectory = cookieStoragePath; 93 97 94 98 configuration.get().websiteDataStore = [[WKWebsiteDataStore alloc] _initWithConfiguration:websiteDataStoreConfiguration]; … … 100 104 [webView loadRequest:request]; 101 105 102 // We expect 3 messages, 1 each for WebSQL, IndexedDB, and localStorage. 103 getNextMessage(); 104 getNextMessage(); 105 getNextMessage(); 106 // We expect 4 messages, 1 each for WebSQL, IndexedDB, cookies, and localStorage. 107 EXPECT_STREQ([getNextMessage().body UTF8String], "localstorage written"); 108 EXPECT_STREQ([getNextMessage().body UTF8String], "cookie written"); 109 EXPECT_STREQ([getNextMessage().body UTF8String], "Exception: QuotaExceededError (DOM Exception 22): The quota has been exceeded."); 110 EXPECT_STREQ([getNextMessage().body UTF8String], "Success opening indexed database"); 106 111 107 112 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:sqlPath.path]); 108 113 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:localStoragePath.path]); 109 114 115 // FIXME: Once this API works this should be true, and there should be a file that contains the bytes "testkey=value" 116 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:cookieStoragePath.path]); 117 110 118 // FIXME: <rdar://problem/30785618> - We don't yet support IDB database processes at custom paths per WebsiteDataStore 111 119 // EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:idbPath]);
Note:
See TracChangeset
for help on using the changeset viewer.