Changeset 259705 in webkit


Ignore:
Timestamp:
Apr 7, 2020 11:19:23 PM (4 years ago)
Author:
Carlos Garcia Campos
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.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r259700 r259705  
     12020-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] WTR: fix handling of WebsiteDataStore
     4        https://bugs.webkit.org/show_bug.cgi?id=210106
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        Add WKContextSetPrimaryWebsiteDataStore() to expose WebProcessPool::setPrimaryDataStore().
     9
     10        * UIProcess/API/C/WKContext.cpp:
     11        (WKContextSetPrimaryWebsiteDataStore):
     12        * UIProcess/API/C/WKContextPrivate.h:
     13
    1142020-04-07  Per Arne Vollan  <pvollan@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp

    r258734 r259705  
    671671    WebKit::toImpl(contextRef)->setUseSeparateServiceWorkerProcess(useSeparateServiceWorkerProcess);
    672672}
     673
     674void WKContextSetPrimaryWebsiteDataStore(WKContextRef contextRef, WKWebsiteDataStoreRef websiteDataStore)
     675{
     676    WebKit::toImpl(contextRef)->setPrimaryDataStore(*WebKit::toImpl(websiteDataStore));
     677}
  • trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h

    r254006 r259705  
    120120WK_EXPORT void WKContextSetUseSeparateServiceWorkerProcess(WKContextRef context, bool forceServiceWorkerProcess);
    121121
     122WK_EXPORT void WKContextSetPrimaryWebsiteDataStore(WKContextRef context, WKWebsiteDataStoreRef websiteDataStore);
     123
    122124#ifdef __cplusplus
    123125}
  • trunk/Tools/ChangeLog

    r259704 r259705  
     12020-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] WTR: fix handling of WebsiteDataStore
     4        https://bugs.webkit.org/show_bug.cgi?id=210106
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        The TestController::defaultWebsiteDataStore() is created and used but never really assigned to the
     9        context. Since we are not assigning a WebsiteDataStore to the context, and we don't use the default
     10        WebsiteDataStore, when a new page is created, we end up creating the default one (with the default config,
     11        instead of the one created by WTR).
     12
     13        * WebKitTestRunner/TestController.cpp:
     14        (WTR::TestController::platformAdjustContext): Set defaultWebsiteDataStore() as the primary data store of the
     15        context like the GLib API does.
     16
    1172020-04-07  Fujii Hironori  <Hironori.Fujii@sony.com>
    218
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r259634 r259705  
    31123112WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)
    31133113{
     3114#if PLATFORM(GTK) || PLATFORM(WPE)
     3115    WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(defaultWebsiteDataStore(), true);
     3116    WKContextSetPrimaryWebsiteDataStore(context, defaultWebsiteDataStore());
     3117#else
    31143118    WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(WKContextGetWebsiteDataStore(context), true);
     3119#endif
    31153120    return context;
    31163121}
Note: See TracChangeset for help on using the changeset viewer.