Title: [292255] trunk
- Revision
- 292255
- Author
- [email protected]
- Date
- 2022-04-01 20:29:20 -0700 (Fri, 01 Apr 2022)
Log Message
Avoid initializing default WKWebsiteDataStore in -[WKWebViewConfiguration copyWithZone]
https://bugs.webkit.org/show_bug.cgi?id=238531
rdar://90628101
Reviewed by Tim Horton.
Source/WebKit:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
Tools:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (292254 => 292255)
--- trunk/Source/WebKit/ChangeLog 2022-04-02 03:04:20 UTC (rev 292254)
+++ trunk/Source/WebKit/ChangeLog 2022-04-02 03:29:20 UTC (rev 292255)
@@ -1,3 +1,16 @@
+2022-04-01 Sihui Liu <[email protected]>
+
+ Avoid initializing default WKWebsiteDataStore in -[WKWebViewConfiguration copyWithZone]
+ https://bugs.webkit.org/show_bug.cgi?id=238531
+ rdar://90628101
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _initializeWithConfiguration:]):
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+ (-[WKWebViewConfiguration copyWithZone:]):
+
2022-04-01 Jeff Miller <[email protected]>
WKBundlePageUIClient console message support should include source URL, column number, and console messages with arguments
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (292254 => 292255)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2022-04-02 03:04:20 UTC (rev 292254)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2022-04-02 03:29:20 UTC (rev 292255)
@@ -335,6 +335,8 @@
if (!configuration)
[NSException raise:NSInvalidArgumentException format:@"Configuration cannot be nil"];
+ if (!configuration.websiteDataStore)
+ [NSException raise:NSInvalidArgumentException format:@"Configuration websiteDataStore cannot be nil"];
_configuration = adoptNS([configuration copy]);
if (WKWebView *relatedWebView = [_configuration _relatedWebView]) {
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (292254 => 292255)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2022-04-02 03:04:20 UTC (rev 292254)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2022-04-02 03:29:20 UTC (rev 292255)
@@ -381,7 +381,8 @@
configuration.processPool = self.processPool;
configuration.preferences = self.preferences;
configuration.userContentController = self.userContentController;
- configuration.websiteDataStore = self.websiteDataStore;
+ if (self._websiteDataStoreIfExists)
+ [configuration setWebsiteDataStore:self._websiteDataStoreIfExists];
configuration.defaultWebpagePreferences = self.defaultWebpagePreferences;
configuration._visitedLinkStore = self._visitedLinkStore;
configuration._relatedWebView = _relatedWebView.get().get();
Modified: trunk/Tools/ChangeLog (292254 => 292255)
--- trunk/Tools/ChangeLog 2022-04-02 03:04:20 UTC (rev 292254)
+++ trunk/Tools/ChangeLog 2022-04-02 03:29:20 UTC (rev 292255)
@@ -1,3 +1,14 @@
+2022-04-01 Sihui Liu <[email protected]>
+
+ Avoid initializing default WKWebsiteDataStore in -[WKWebViewConfiguration copyWithZone]
+ https://bugs.webkit.org/show_bug.cgi?id=238531
+ rdar://90628101
+
+ Reviewed by Tim Horton.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
+ (TestWebKitAPI::TEST):
+
2022-04-01 Jeff Miller <[email protected]>
WKBundlePageUIClient console message support should include source URL, column number, and console messages with arguments
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm (292254 => 292255)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm 2022-04-02 03:04:20 UTC (rev 292254)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm 2022-04-02 03:29:20 UTC (rev 292255)
@@ -413,4 +413,11 @@
[webView synchronouslyLoadRequest:[NSURLRequest requestWithURL:url]];
}
+TEST(WKWebsiteDataStore, DoNotCreateDefaultDataStore)
+{
+ auto configuration = adoptNS([WKWebViewConfiguration new]);
+ [configuration.get() copy];
+ EXPECT_FALSE([WKWebsiteDataStore _defaultDataStoreExists]);
+}
+
} // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes