Pass sessionID to WebProcess with other WebProcessDataStoreParameters and store it on the WebProcess object.
Created attachment 378664 [details] Patch
Comment on attachment 378664 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=378664&action=review > Source/WebKit/Shared/WebProcessCreationParameters.h:199 > + Optional<WebProcessDataStoreParameters> websiteDataStoreParameters; Why Optional? Won't we always have a WebsiteDataStore when making a WebProcess? > Source/WebKit/Shared/WebProcessDataStoreParameters.h:131 > + return WebProcessDataStoreParameters { WTFMove(*sessionID), WTFMove(applicationCacheDirectory), WTFMove(*applicationCacheDirectoryExtensionHandle), WTFMove(applicationCacheFlatFileSubdirectoryName), WTFMove(webSQLDatabaseDirectory), WTFMove(*webSQLDatabaseDirectoryExtensionHandle), WTFMove(mediaCacheDirectory), WTFMove(*mediaCacheDirectoryExtensionHandle), WTFMove(mediaKeyStorageDirectory), WTFMove(*mediaKeyStorageDirectoryExtensionHandle), WTFMove(javaScriptConfigurationDirectory), WTFMove(*javaScriptConfigurationDirectoryExtensionHandle), resourceLoadStatisticsEnabled }; Please put these each on their own line so we can add to them and see the version history. > Source/WebKit/WebProcess/WebProcess.h:166 > + // Prewarmed WebProcesses do not have an associated sessionID yet, which is why this is an optional. > + // By the time the WebProcess gets a WebPage, it is guaranteed to have a sessionID. Why don't we just prewarm processes for use with a particular website data store?
Comment on attachment 378664 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=378664&action=review >> Source/WebKit/Shared/WebProcessCreationParameters.h:199 >> + Optional<WebProcessDataStoreParameters> websiteDataStoreParameters; > > Why Optional? Won't we always have a WebsiteDataStore when making a WebProcess? I guess you know now since you saw my comment below. >> Source/WebKit/Shared/WebProcessDataStoreParameters.h:131 >> + return WebProcessDataStoreParameters { WTFMove(*sessionID), WTFMove(applicationCacheDirectory), WTFMove(*applicationCacheDirectoryExtensionHandle), WTFMove(applicationCacheFlatFileSubdirectoryName), WTFMove(webSQLDatabaseDirectory), WTFMove(*webSQLDatabaseDirectoryExtensionHandle), WTFMove(mediaCacheDirectory), WTFMove(*mediaCacheDirectoryExtensionHandle), WTFMove(mediaKeyStorageDirectory), WTFMove(*mediaKeyStorageDirectoryExtensionHandle), WTFMove(javaScriptConfigurationDirectory), WTFMove(*javaScriptConfigurationDirectoryExtensionHandle), resourceLoadStatisticsEnabled }; > > Please put these each on their own line so we can add to them and see the version history. Ok. >> Source/WebKit/WebProcess/WebProcess.h:166 >> + // By the time the WebProcess gets a WebPage, it is guaranteed to have a sessionID. > > Why don't we just prewarm processes for use with a particular website data store? We don't know for which datastore we're going to need a process next at the time of pre-warming. We used to prewarm for the default session and then not use the pre-warmed process if the data store was not the default one but this was wasteful.
Created attachment 378680 [details] Patch
Comment on attachment 378680 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=378680&action=review > Source/WebKit/WebProcess/WebProcess.h:167 > + const Optional<PAL::SessionID>& sessionID() const { return m_sessionID; } Not that the only code that runs in a pre-warmed process is the initialization function so we could easily return an SessionID here instead of an Optional<SessionID> and ASSERT(m_sessionID). Let me know if you'd prefer that.
Comment on attachment 378680 [details] Patch Clearing flags on attachment: 378680 Committed r249818: <https://trac.webkit.org/changeset/249818>
All reviewed patches have been landed. Closing bug.
<rdar://problem/55320799>
<rdar://problem/55320800>