[webkit-changes] [WebKit/WebKit] a6406e: Resolve directories on WorkQueue in UI process

Sihui noreply at github.com
Fri Mar 15 09:32:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a6406e46b8fd16b95e9907276b9ddf9ffaffc9d1
      https://github.com/WebKit/WebKit/commit/a6406e46b8fd16b95e9907276b9ddf9ffaffc9d1
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-03-15 (Fri, 15 Mar 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
    M Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h
    M Source/WebKit/UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp
    M Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp

  Log Message:
  -----------
  Resolve directories on WorkQueue in UI process
https://bugs.webkit.org/show_bug.cgi?id=270300
rdar://123841003

Reviewed by Chris Dumez.

Move resolving directoreis off main thread in UI process to avoid slowing down main thread. Main thread still needs to
wait directories to be resolved before using them, but now we dipsatch the task when WebsiteDataStore is created, so
there is chance that the directories are already resolved before the use. Also, the queue has the same priority as main
thread, so in the worst case where client uses WebsiteDataStore immediately after creating it, the performance will be
the same as current implementation.

Reland 275959 at main with fix to wait for directories to resolve inside resolveDirectories(), so we can avoid null
deference on m_resolvedDirectories.

* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::gpuProcessSessionParameters):
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::webProcessDataStoreParameters):
* Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
(WebKit::WebsiteDataStore::saveRecentSearches):
(WebKit::WebsiteDataStore::loadRecentSearches):
(WebKit::WebsiteDataStore::removeRecentSearches):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::createNonPersistent):
(WebKit::WebsiteDataStore::create):
(WebKit::WebsiteDataStore::WebsiteDataStore):
(WebKit::WebsiteDataStore::defaultDataStore):
(WebKit::migrateMediaKeysStorageIfNecessary):
(WebKit::resolveDirectories):
(WebKit::WebsiteDataStore::resolvedDirectories const):
(WebKit::WebsiteDataStore::mediaKeysStorageSalt const):
(WebKit::WebsiteDataStore::resolveDirectoriesAsynchronously):
(WebKit::WebsiteDataStore::handleResolvedDirectoriesAsynchronously):
(WebKit::WebsiteDataStore::fetchDataAndApply):
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::migrateMediaKeysStorageIfNecessary): Deleted.
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Deleted.
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::perOriginStorageQuota const):
(WebKit::WebsiteDataStore::originQuotaRatio):
(WebKit::WebsiteDataStore::resolvedCacheStorageDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedLocalStorageDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedNetworkCacheDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedAlternativeServicesStorageDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedCookieStorageFile const): Deleted.
(WebKit::WebsiteDataStore::resolvedIndexedDBDatabaseDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedHSTSStorageDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedGeneralStorageDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedSearchFieldHistoryDirectory const): Deleted.
(WebKit::WebsiteDataStore::resolvedModelElementCacheDirectory const): Deleted.
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy const):
(WebKit::WebsiteDataStoreConfiguration::Directories::isolatedCopy const):
(WebKit::WebsiteDataStoreConfiguration::Directories::isolatedCopy):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::alternativeServicesDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setAlternativeServicesDirectory):
(WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
(WebKit::WebsiteDataStoreConfiguration::searchFieldHistoryDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setSearchFieldHistoryDirectory):
(WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
(WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
(WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::modelElementCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setModelElementCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::deviceIdHashSaltsStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setDeviceIdHashSaltsStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
(WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
(WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
(WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
(WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::generalStorageDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setGeneralStorageDirectory):
(WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
(WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
(WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
(WebKit::WebsiteDataStoreConfiguration::directories const):
* Source/WebKit/UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):
* Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):

Canonical link: https://commits.webkit.org/276161@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list