Bug 201730 - Pass sessionID to WebProcess with other WebProcessDataStoreParameters
Summary: Pass sessionID to WebProcess with other WebProcessDataStoreParameters
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-12 11:42 PDT by Chris Dumez
Modified: 2019-09-12 15:47 PDT (History)
6 users (show)

See Also:


Attachments
Patch (21.26 KB, patch)
2019-09-12 11:44 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (21.57 KB, patch)
2019-09-12 14:44 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2019-09-12 11:42:39 PDT
Pass sessionID to WebProcess with other WebProcessDataStoreParameters and store it on the WebProcess object.
Comment 1 Chris Dumez 2019-09-12 11:44:44 PDT
Created attachment 378664 [details]
Patch
Comment 2 Alex Christensen 2019-09-12 14:10:09 PDT
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 3 Chris Dumez 2019-09-12 14:16:24 PDT
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.
Comment 4 Chris Dumez 2019-09-12 14:44:08 PDT
Created attachment 378680 [details]
Patch
Comment 5 Chris Dumez 2019-09-12 14:53:39 PDT
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 6 WebKit Commit Bot 2019-09-12 15:46:26 PDT
Comment on attachment 378680 [details]
Patch

Clearing flags on attachment: 378680

Committed r249818: <https://trac.webkit.org/changeset/249818>
Comment 7 WebKit Commit Bot 2019-09-12 15:46:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-09-12 15:47:17 PDT
<rdar://problem/55320799>
Comment 9 Radar WebKit Bug Importer 2019-09-12 15:47:19 PDT
<rdar://problem/55320800>