Title: [259705] trunk
Revision
259705
Author
[email protected]
Date
2020-04-07 23:19:23 -0700 (Tue, 07 Apr 2020)

Log Message

[GTK][WPE] WTR: fix handling of WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=210106

Reviewed by Adrian Perez de Castro.

Source/WebKit:

Add WKContextSetPrimaryWebsiteDataStore() to expose WebProcessPool::setPrimaryDataStore().

* UIProcess/API/C/WKContext.cpp:
(WKContextSetPrimaryWebsiteDataStore):
* UIProcess/API/C/WKContextPrivate.h:

Tools:

The TestController::defaultWebsiteDataStore() is created and used but never really assigned to the
context. Since we are not assigning a WebsiteDataStore to the context, and we don't use the default
WebsiteDataStore, when a new page is created, we end up creating the default one (with the default config,
instead of the one created by WTR).

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::platformAdjustContext): Set defaultWebsiteDataStore() as the primary data store of the
context like the GLib API does.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (259704 => 259705)


--- trunk/Source/WebKit/ChangeLog	2020-04-08 05:46:25 UTC (rev 259704)
+++ trunk/Source/WebKit/ChangeLog	2020-04-08 06:19:23 UTC (rev 259705)
@@ -1,3 +1,16 @@
+2020-04-07  Carlos Garcia Campos  <[email protected]>
+
+        [GTK][WPE] WTR: fix handling of WebsiteDataStore
+        https://bugs.webkit.org/show_bug.cgi?id=210106
+
+        Reviewed by Adrian Perez de Castro.
+
+        Add WKContextSetPrimaryWebsiteDataStore() to expose WebProcessPool::setPrimaryDataStore().
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextSetPrimaryWebsiteDataStore):
+        * UIProcess/API/C/WKContextPrivate.h:
+
 2020-04-07  Per Arne Vollan  <[email protected]>
 
         [iOS] Deny mach lookup access to the runningboard service in the WebContent process

Modified: trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp (259704 => 259705)


--- trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp	2020-04-08 05:46:25 UTC (rev 259704)
+++ trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp	2020-04-08 06:19:23 UTC (rev 259705)
@@ -670,3 +670,8 @@
 {
     WebKit::toImpl(contextRef)->setUseSeparateServiceWorkerProcess(useSeparateServiceWorkerProcess);
 }
+
+void WKContextSetPrimaryWebsiteDataStore(WKContextRef contextRef, WKWebsiteDataStoreRef websiteDataStore)
+{
+    WebKit::toImpl(contextRef)->setPrimaryDataStore(*WebKit::toImpl(websiteDataStore));
+}

Modified: trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h (259704 => 259705)


--- trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h	2020-04-08 05:46:25 UTC (rev 259704)
+++ trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h	2020-04-08 06:19:23 UTC (rev 259705)
@@ -119,6 +119,8 @@
 
 WK_EXPORT void WKContextSetUseSeparateServiceWorkerProcess(WKContextRef context, bool forceServiceWorkerProcess);
 
+WK_EXPORT void WKContextSetPrimaryWebsiteDataStore(WKContextRef context, WKWebsiteDataStoreRef websiteDataStore);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Tools/ChangeLog (259704 => 259705)


--- trunk/Tools/ChangeLog	2020-04-08 05:46:25 UTC (rev 259704)
+++ trunk/Tools/ChangeLog	2020-04-08 06:19:23 UTC (rev 259705)
@@ -1,3 +1,19 @@
+2020-04-07  Carlos Garcia Campos  <[email protected]>
+
+        [GTK][WPE] WTR: fix handling of WebsiteDataStore
+        https://bugs.webkit.org/show_bug.cgi?id=210106
+
+        Reviewed by Adrian Perez de Castro.
+
+        The TestController::defaultWebsiteDataStore() is created and used but never really assigned to the
+        context. Since we are not assigning a WebsiteDataStore to the context, and we don't use the default
+        WebsiteDataStore, when a new page is created, we end up creating the default one (with the default config,
+        instead of the one created by WTR).
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::platformAdjustContext): Set defaultWebsiteDataStore() as the primary data store of the
+        context like the GLib API does.
+
 2020-04-07  Fujii Hironori  <[email protected]>
 
         [Clang 10] Fix -Wimplicit-int-float-conversion compilation warnings in TestWebKitAPI

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (259704 => 259705)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2020-04-08 05:46:25 UTC (rev 259704)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2020-04-08 06:19:23 UTC (rev 259705)
@@ -3111,7 +3111,12 @@
 
 WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)
 {
+#if PLATFORM(GTK) || PLATFORM(WPE)
+    WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(defaultWebsiteDataStore(), true);
+    WKContextSetPrimaryWebsiteDataStore(context, defaultWebsiteDataStore());
+#else
     WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(WKContextGetWebsiteDataStore(context), true);
+#endif
     return context;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to