⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267729 in webkit


Ignore:
Timestamp:
Sep 29, 2020, 12:20:13 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Stop using the default website data store for the inspector
https://bugs.webkit.org/show_bug.cgi?id=217034

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2020-09-29
Reviewed by Michael Catanzaro.

The GTK should never use the default website data store. Use a dedicated website data store for the inspector
with its own configuration to store persistent data.

  • UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:

(WebKit::inspectorWebsiteDataStore):
(WebKit::WebInspectorProxy::platformCreateFrontendPage):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r267725 r267729  
     12020-09-29  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Stop using the default website data store for the inspector
     4        https://bugs.webkit.org/show_bug.cgi?id=217034
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        The GTK should never use the default website data store. Use a dedicated website data store for the inspector
     9        with its own configuration to store persistent data.
     10
     11        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
     12        (WebKit::inspectorWebsiteDataStore):
     13        (WebKit::WebInspectorProxy::platformCreateFrontendPage):
     14
    1152020-09-28  Peng Liu  <peng.liu6@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp

    r262371 r267729  
    4343#include "WebProcessPool.h"
    4444#include "WebProcessProxy.h"
     45#include "WebsiteDataStore.h"
    4546#include <WebCore/CertificateInfo.h>
    4647#include <WebCore/GtkUtilities.h>
     
    138139}
    139140
     141static Ref<WebsiteDataStore> inspectorWebsiteDataStore()
     142{
     143    static const char* versionedDirectory = "webkitgtk-" WEBKITGTK_API_VERSION_STRING G_DIR_SEPARATOR_S "WebInspector" G_DIR_SEPARATOR_S;
     144    String baseCacheDirectory = FileSystem::pathByAppendingComponent(FileSystem::stringFromFileSystemRepresentation(g_get_user_cache_dir()), versionedDirectory);
     145    String baseDataDirectory = FileSystem::pathByAppendingComponent(FileSystem::stringFromFileSystemRepresentation(g_get_user_data_dir()), versionedDirectory);
     146
     147    auto configuration = WebsiteDataStoreConfiguration::create(IsPersistent::Yes, WillCopyPathsFromExistingConfiguration::Yes);
     148    configuration->setNetworkCacheDirectory(FileSystem::pathByAppendingComponent(baseCacheDirectory, "WebKitCache"));
     149    configuration->setApplicationCacheDirectory(FileSystem::pathByAppendingComponent(baseCacheDirectory, "applications"));
     150    configuration->setHSTSStorageDirectory(String(baseCacheDirectory));
     151    configuration->setCacheStorageDirectory(FileSystem::pathByAppendingComponent(baseCacheDirectory, "CacheStorage"));
     152    configuration->setLocalStorageDirectory(FileSystem::pathByAppendingComponent(baseDataDirectory, "localstorage"));
     153    configuration->setIndexedDBDatabaseDirectory(FileSystem::pathByAppendingComponent(baseDataDirectory, "indexeddb"));
     154    configuration->setWebSQLDatabaseDirectory(FileSystem::pathByAppendingComponent(baseDataDirectory, "databases"));
     155    configuration->setResourceLoadStatisticsDirectory(FileSystem::pathByAppendingComponent(baseDataDirectory, "itp"));
     156    configuration->setServiceWorkerRegistrationDirectory(FileSystem::pathByAppendingComponent(baseDataDirectory, "serviceworkers"));
     157    configuration->setDeviceIdHashSaltsStorageDirectory(FileSystem::pathByAppendingComponent(baseDataDirectory, "deviceidhashsalts"));
     158    return WebsiteDataStore::create(WTFMove(configuration), PAL::SessionID::defaultSessionID());
     159}
     160
    140161WebPageProxy* WebInspectorProxy::platformCreateFrontendPage()
    141162{
     
    153174    });
    154175    auto pageGroup = WebPageGroup::create(inspectorPageGroupIdentifierForPage(inspectedPage()));
     176    auto websiteDataStore = inspectorWebsiteDataStore();
     177    auto& processPool = inspectorProcessPool(inspectionLevel());
     178    processPool.setPrimaryDataStore(websiteDataStore.get());
    155179
    156180    auto pageConfiguration = API::PageConfiguration::create();
    157     pageConfiguration->setProcessPool(&inspectorProcessPool(inspectionLevel()));
     181    pageConfiguration->setProcessPool(&processPool);
    158182    pageConfiguration->setPreferences(preferences.ptr());
    159183    pageConfiguration->setPageGroup(pageGroup.ptr());
     184    pageConfiguration->setWebsiteDataStore(websiteDataStore.ptr());
    160185    m_inspectorView = GTK_WIDGET(webkitWebViewBaseCreate(*pageConfiguration.ptr()));
    161186    g_object_add_weak_pointer(G_OBJECT(m_inspectorView), reinterpret_cast<void**>(&m_inspectorView));
Note: See TracChangeset for help on using the changeset viewer.