Test expectation adjustment.
[WebKit-https.git] / Source / WebKit / UIProcess / WebsiteData / WebsiteDataStore.h
1 /*
2  * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma once
27
28 #include "LocalStorageDatabaseTracker.h"
29 #include "NetworkSessionCreationParameters.h"
30 #include "WebDeviceOrientationAndMotionAccessController.h"
31 #include "WebFramePolicyListenerProxy.h"
32 #include "WebPageProxyIdentifier.h"
33 #include "WebResourceLoadStatisticsStore.h"
34 #include "WebsiteDataStoreClient.h"
35 #include "WebsiteDataStoreConfiguration.h"
36 #include <WebCore/Cookie.h>
37 #include <WebCore/DeviceOrientationOrMotionPermissionState.h>
38 #include <WebCore/PageIdentifier.h>
39 #include <WebCore/SecurityOriginData.h>
40 #include <WebCore/SecurityOriginHash.h>
41 #include <pal/SessionID.h>
42 #include <wtf/Function.h>
43 #include <wtf/HashSet.h>
44 #include <wtf/Identified.h>
45 #include <wtf/OptionSet.h>
46 #include <wtf/RefCounted.h>
47 #include <wtf/RefPtr.h>
48 #include <wtf/UniqueRef.h>
49 #include <wtf/WeakHashSet.h>
50 #include <wtf/WeakPtr.h>
51 #include <wtf/WorkQueue.h>
52 #include <wtf/text/WTFString.h>
53
54 #if PLATFORM(COCOA)
55 #include <pal/spi/cf/CFNetworkSPI.h>
56 #endif
57
58 #if USE(CURL)
59 #include <WebCore/CurlProxySettings.h>
60 #endif
61
62 namespace API {
63 class HTTPCookieStore;
64 }
65
66 namespace WebCore {
67 class RegistrableDomain;
68 class SecurityOrigin;
69
70 struct MockWebAuthenticationConfiguration;
71 }
72
73 namespace WebKit {
74
75 class AuthenticatorManager;
76 class SecKeyProxyStore;
77 class DeviceIdHashSaltStorage;
78 class SOAuthorizationCoordinator;
79 class WebCertificateInfo;
80 class WebPageProxy;
81 class WebProcessPool;
82 class WebProcessProxy;
83 class WebResourceLoadStatisticsStore;
84 enum class CacheModel : uint8_t;
85 enum class WebsiteDataFetchOption : uint8_t;
86 enum class WebsiteDataType : uint32_t;
87 struct WebsiteDataRecord;
88 struct WebsiteDataStoreParameters;
89
90 #if ENABLE(RESOURCE_LOAD_STATISTICS)
91 enum class ShouldGrandfatherStatistics : bool;
92 enum class StorageAccessStatus : uint8_t;
93 enum class StorageAccessPromptStatus;
94 #endif
95
96 #if ENABLE(NETSCAPE_PLUGIN_API)
97 struct PluginModuleInfo;
98 #endif
99
100 class WebsiteDataStore : public API::ObjectImpl<API::Object::Type::WebsiteDataStore>, public Identified<WebsiteDataStore>, public CanMakeWeakPtr<WebsiteDataStore>  {
101 public:
102     static Ref<WebsiteDataStore> defaultDataStore();
103     static bool defaultDataStoreExists();
104     static void deleteDefaultDataStoreForTesting();
105     
106     static Ref<WebsiteDataStore> createNonPersistent();
107     static Ref<WebsiteDataStore> create(Ref<WebsiteDataStoreConfiguration>&&, PAL::SessionID);
108
109     WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&&, PAL::SessionID);
110     ~WebsiteDataStore();
111
112     static WebsiteDataStore* existingNonDefaultDataStoreForSessionID(PAL::SessionID);
113
114     bool isPersistent() const { return !m_sessionID.isEphemeral(); }
115     PAL::SessionID sessionID() const { return m_sessionID; }
116     
117     void registerProcess(WebProcessProxy&);
118     void unregisterProcess(WebProcessProxy&);
119     
120     const WeakHashSet<WebProcessProxy>& processes() const { return m_processes; }
121
122     bool resourceLoadStatisticsEnabled() const;
123     void setResourceLoadStatisticsEnabled(bool);
124     bool resourceLoadStatisticsDebugMode() const;
125     void setResourceLoadStatisticsDebugMode(bool);
126     void setResourceLoadStatisticsDebugMode(bool, CompletionHandler<void()>&&);
127     void isResourceLoadStatisticsEphemeral(CompletionHandler<void(bool)>&&) const;
128
129     void setAdClickAttributionDebugMode(bool);
130
131     uint64_t perOriginStorageQuota() const { return m_resolvedConfiguration->perOriginStorageQuota(); }
132     uint64_t perThirdPartyOriginStorageQuota() const;
133     const String& cacheStorageDirectory() const { return m_resolvedConfiguration->cacheStorageDirectory(); }
134
135 #if ENABLE(RESOURCE_LOAD_STATISTICS)
136     void clearResourceLoadStatisticsInWebProcesses(CompletionHandler<void()>&&);
137 #endif
138
139     void fetchData(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, Function<void(Vector<WebsiteDataRecord>)>&& completionHandler);
140     void removeData(OptionSet<WebsiteDataType>, WallTime modifiedSince, Function<void()>&& completionHandler);
141     void removeData(OptionSet<WebsiteDataType>, const Vector<WebsiteDataRecord>&, Function<void()>&& completionHandler);
142
143     void getLocalStorageDetails(Function<void(Vector<LocalStorageDatabaseTracker::OriginDetails>&&)>&&);
144     void setCacheModelSynchronouslyForTesting(CacheModel);
145     void setServiceWorkerTimeoutForTesting(Seconds);
146     void resetServiceWorkerTimeoutForTesting();
147
148 #if ENABLE(RESOURCE_LOAD_STATISTICS)
149     void fetchDataForRegistrableDomains(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, const Vector<WebCore::RegistrableDomain>&, CompletionHandler<void(Vector<WebsiteDataRecord>&&, HashSet<WebCore::RegistrableDomain>&&)>&&);
150     void clearPrevalentResource(const URL&, CompletionHandler<void()>&&);
151     void clearUserInteraction(const URL&, CompletionHandler<void()>&&);
152     void dumpResourceLoadStatistics(CompletionHandler<void(const String&)>&&);
153     void logTestingEvent(const String&);
154     void logUserInteraction(const URL&, CompletionHandler<void()>&&);
155     void getAllStorageAccessEntries(WebPageProxyIdentifier, CompletionHandler<void(Vector<String>&& domains)>&&);
156     void hasHadUserInteraction(const URL&, CompletionHandler<void(bool)>&&);
157     void isRelationshipOnlyInDatabaseOnce(const URL& subUrl, const URL& topUrl, CompletionHandler<void(bool)>&&);
158     void isPrevalentResource(const URL&, CompletionHandler<void(bool)>&&);
159     void isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom, const URL& hostRedirectedTo, CompletionHandler<void(bool)>&&);
160     void isRegisteredAsSubresourceUnder(const URL& subresource, const URL& topFrame, CompletionHandler<void(bool)>&&);
161     void isRegisteredAsSubFrameUnder(const URL& subFrame, const URL& topFrame, CompletionHandler<void(bool)>&&);
162     void isVeryPrevalentResource(const URL&, CompletionHandler<void(bool)>&&);
163     void resetParametersToDefaultValues(CompletionHandler<void()>&&);
164     void scheduleCookieBlockingUpdate(CompletionHandler<void()>&&);
165     void scheduleClearInMemoryAndPersistent(WallTime modifiedSince, ShouldGrandfatherStatistics, CompletionHandler<void()>&&);
166     void scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics, CompletionHandler<void()>&&);
167     void getResourceLoadStatisticsDataSummary(CompletionHandler<void(Vector<WebResourceLoadStatisticsStore::ThirdPartyData>&&)>&&);
168     void scheduleStatisticsAndDataRecordsProcessing(CompletionHandler<void()>&&);
169     void submitTelemetry();
170     void setGrandfathered(const URL&, bool, CompletionHandler<void()>&&);
171     void isGrandfathered(const URL&, CompletionHandler<void(bool)>&&);
172     void setUseITPDatabase(bool, CompletionHandler<void()>&&);
173     void setGrandfatheringTime(Seconds, CompletionHandler<void()>&&);
174     void setLastSeen(const URL&, Seconds, CompletionHandler<void()>&&);
175     void domainIDExistsInDatabase(int domainID, CompletionHandler<void(bool)>&&);
176     void statisticsDatabaseHasAllTables(CompletionHandler<void(bool)>&&);
177     void mergeStatisticForTesting(const URL&, const URL& topFrameUrl1, const URL& topFrameUrl2, Seconds lastSeen, bool hadUserInteraction, Seconds mostRecentUserInteraction, bool isGrandfathered, bool isPrevalent, bool isVeryPrevalent, unsigned dataRecordsRemoved, CompletionHandler<void()>&&);
178     void insertExpiredStatisticForTesting(const URL&, bool hadUserInteraction, bool isScheduledForAllButCookieDataRemoval, bool isPrevalent, CompletionHandler<void()>&&);
179     void setNotifyPagesWhenDataRecordsWereScanned(bool, CompletionHandler<void()>&&);
180     void setIsRunningResourceLoadStatisticsTest(bool, CompletionHandler<void()>&&);
181     void setPruneEntriesDownTo(size_t, CompletionHandler<void()>&&);
182     void setSubframeUnderTopFrameDomain(const URL& subframe, const URL& topFrame, CompletionHandler<void()>&&);
183     void setSubresourceUnderTopFrameDomain(const URL& subresource, const URL& topFrame, CompletionHandler<void()>&&);
184     void setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo, CompletionHandler<void()>&&);
185     void setSubresourceUniqueRedirectFrom(const URL& subresource, const URL& hostNameRedirectedFrom, CompletionHandler<void()>&&);
186     void setTimeToLiveUserInteraction(Seconds, CompletionHandler<void()>&&);
187     void setTopFrameUniqueRedirectTo(const URL& topFrameHostName, const URL& hostNameRedirectedTo, CompletionHandler<void()>&&);
188     void setTopFrameUniqueRedirectFrom(const URL& topFrameHostName, const URL& hostNameRedirectedFrom, CompletionHandler<void()>&&);
189     void setMaxStatisticsEntries(size_t, CompletionHandler<void()>&&);
190     void setMinimumTimeBetweenDataRecordsRemoval(Seconds, CompletionHandler<void()>&&);
191     void setPrevalentResource(const URL&, CompletionHandler<void()>&&);
192     void setPrevalentResourceForDebugMode(const URL&, CompletionHandler<void()>&&);
193     void setShouldClassifyResourcesBeforeDataRecordsRemoval(bool, CompletionHandler<void()>&&);
194     void setStatisticsTestingCallback(Function<void(const String&)>&&);
195     bool hasStatisticsTestingCallback() const { return !!m_statisticsTestingCallback; }
196     void setVeryPrevalentResource(const URL&, CompletionHandler<void()>&&);
197     void setSubframeUnderTopFrameDomain(const URL& subframe, const URL& topFrame);
198     void setCrossSiteLoadWithLinkDecorationForTesting(const URL& fromURL, const URL& toURL, CompletionHandler<void()>&&);
199     void resetCrossSiteLoadsWithLinkDecorationForTesting(CompletionHandler<void()>&&);
200     void deleteCookiesForTesting(const URL&, bool includeHttpOnlyCookies, CompletionHandler<void()>&&);
201     void hasLocalStorageForTesting(const URL&, CompletionHandler<void(bool)>&&) const;
202     void hasIsolatedSessionForTesting(const URL&, CompletionHandler<void(bool)>&&) const;
203     void setResourceLoadStatisticsShouldDowngradeReferrerForTesting(bool, CompletionHandler<void()>&&);
204     void setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting(bool enabled, bool onlyOnSitesWithoutUserInteraction, CompletionHandler<void()>&&);
205     void setThirdPartyCookieBlockingMode(WebCore::ThirdPartyCookieBlockingMode, CompletionHandler<void()>&&);
206     void setResourceLoadStatisticsShouldEnbleSameSiteStrictEnforcementForTesting(bool enabled, CompletionHandler<void()>&&);
207     void setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting(bool enabled, CompletionHandler<void()>&&);
208     void setResourceLoadStatisticsToSameSiteStrictCookiesForTesting(const URL&, CompletionHandler<void()>&&);
209     void setResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting(const URL& firstPartyURL, const URL& cnameURL, CompletionHandler<void()>&&);
210     void setResourceLoadStatisticsThirdPartyCNAMEDomainForTesting(const URL&, CompletionHandler<void()>&&);
211     WebCore::ThirdPartyCookieBlockingMode thirdPartyCookieBlockingMode() const;
212     bool isItpStateExplicitlySet() const { return m_isItpStateExplicitlySet; }
213     void useExplicitITPState() { m_isItpStateExplicitlySet = true; }
214 #endif
215     void syncLocalStorage(CompletionHandler<void()>&&);
216     void setCacheMaxAgeCapForPrevalentResources(Seconds, CompletionHandler<void()>&&);
217     void resetCacheMaxAgeCapForPrevalentResources(CompletionHandler<void()>&&);
218     void resolveDirectoriesIfNecessary();
219     const String& applicationCacheFlatFileSubdirectoryName() const { return m_configuration->applicationCacheFlatFileSubdirectoryName(); }
220     const String& resolvedApplicationCacheDirectory() const { return m_resolvedConfiguration->applicationCacheDirectory(); }
221     const String& resolvedLocalStorageDirectory() const { return m_resolvedConfiguration->localStorageDirectory(); }
222     const String& resolvedNetworkCacheDirectory() const { return m_resolvedConfiguration->networkCacheDirectory(); }
223     const String& resolvedAlternativeServicesStorageDirectory() const { return m_resolvedConfiguration->alternativeServicesDirectory(); }
224     const String& resolvedMediaCacheDirectory() const { return m_resolvedConfiguration->mediaCacheDirectory(); }
225     const String& resolvedMediaKeysDirectory() const { return m_resolvedConfiguration->mediaKeysStorageDirectory(); }
226     const String& resolvedDatabaseDirectory() const { return m_resolvedConfiguration->webSQLDatabaseDirectory(); }
227     const String& resolvedJavaScriptConfigurationDirectory() const { return m_resolvedConfiguration->javaScriptConfigurationDirectory(); }
228     const String& resolvedCookieStorageFile() const { return m_resolvedConfiguration->cookieStorageFile(); }
229     const String& resolvedIndexedDatabaseDirectory() const { return m_resolvedConfiguration->indexedDBDatabaseDirectory(); }
230     const String& resolvedServiceWorkerRegistrationDirectory() const { return m_resolvedConfiguration->serviceWorkerRegistrationDirectory(); }
231     const String& resolvedResourceLoadStatisticsDirectory() const { return m_resolvedConfiguration->resourceLoadStatisticsDirectory(); }
232     const String& resolvedHSTSStorageDirectory() const { return m_resolvedConfiguration->hstsStorageDirectory(); }
233
234     void allowSpecificHTTPSCertificateForHost(const WebCertificateInfo*, const String& host);
235
236     DeviceIdHashSaltStorage& deviceIdHashSaltStorage() { return m_deviceIdHashSaltStorage.get(); }
237
238     WebProcessPool* processPoolForCookieStorageOperations();
239     bool isAssociatedProcessPool(WebProcessPool&) const;
240
241     WebsiteDataStoreParameters parameters();
242
243     Vector<WebCore::Cookie> pendingCookies() const;
244     void addPendingCookie(const WebCore::Cookie&);
245     void removePendingCookie(const WebCore::Cookie&);
246     void clearPendingCookies();
247     void flushCookies(CompletionHandler<void()>&&);
248     void clearCachedCredentials();
249
250     void setAllowsAnySSLCertificateForWebSocket(bool);
251
252     void dispatchOnQueue(Function<void()>&&);
253
254 #if USE(CURL)
255     void setNetworkProxySettings(WebCore::CurlProxySettings&&);
256     const WebCore::CurlProxySettings& networkProxySettings() const { return m_proxySettings; }
257 #endif
258
259 #if USE(SOUP)
260     void setPersistentCredentialStorageEnabled(bool);
261     bool persistentCredentialStorageEnabled() const { return m_persistentCredentialStorageEnabled && isPersistent(); }
262 #endif
263
264     static void allowWebsiteDataRecordsForAllOrigins();
265
266 #if HAVE(SEC_KEY_PROXY)
267     void addSecKeyProxyStore(Ref<SecKeyProxyStore>&&);
268 #endif
269
270 #if ENABLE(WEB_AUTHN)
271     AuthenticatorManager& authenticatorManager() { return m_authenticatorManager.get(); }
272     void setMockWebAuthenticationConfiguration(WebCore::MockWebAuthenticationConfiguration&&);
273 #endif
274
275     void didCreateNetworkProcess();
276
277     const WebsiteDataStoreConfiguration& configuration() { return m_configuration.get(); }
278
279     WebsiteDataStoreClient& client() { return m_client.get(); }
280     void setClient(UniqueRef<WebsiteDataStoreClient>&& client) { m_client = WTFMove(client); }
281
282     API::HTTPCookieStore& cookieStore();
283
284     void renameOriginInWebsiteData(URL&&, URL&&, OptionSet<WebsiteDataType>, CompletionHandler<void()>&&);
285
286 #if ENABLE(DEVICE_ORIENTATION)
287     WebDeviceOrientationAndMotionAccessController& deviceOrientationAndMotionAccessController() { return m_deviceOrientationAndMotionAccessController; }
288 #endif
289
290 #if HAVE(APP_SSO)
291     SOAuthorizationCoordinator& soAuthorizationCoordinator() { return m_soAuthorizationCoordinator.get(); }
292 #endif
293
294     static WTF::String defaultServiceWorkerRegistrationDirectory();
295     static WTF::String defaultLocalStorageDirectory();
296     static WTF::String defaultResourceLoadStatisticsDirectory();
297     static WTF::String defaultNetworkCacheDirectory();
298     static WTF::String defaultAlternativeServicesDirectory();
299     static WTF::String defaultApplicationCacheDirectory();
300     static WTF::String defaultWebSQLDatabaseDirectory();
301 #if USE(GLIB)
302     static WTF::String defaultHSTSDirectory();
303 #endif
304     static WTF::String defaultIndexedDBDatabaseDirectory();
305     static WTF::String defaultCacheStorageDirectory();
306     static WTF::String defaultMediaCacheDirectory();
307     static WTF::String defaultMediaKeysStorageDirectory();
308     static WTF::String defaultDeviceIdHashSaltsStorageDirectory();
309     static WTF::String defaultJavaScriptConfigurationDirectory();
310     static bool http3Enabled();
311
312     void resetQuota(CompletionHandler<void()>&&);
313
314 #if ENABLE(APP_BOUND_DOMAINS)
315     void hasAppBoundSession(CompletionHandler<void(bool)>&&) const;
316     void clearAppBoundSession(CompletionHandler<void()>&&);
317     void beginAppBoundDomainCheck(const URL&, WebFramePolicyListenerProxy&);
318     void getAppBoundDomains(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&)>&&) const;
319     void getAppBoundSchemes(CompletionHandler<void(const HashSet<String>&)>&&) const;
320     void ensureAppBoundDomains(CompletionHandler<void(const HashSet<WebCore::RegistrableDomain>&, const HashSet<String>&)>&&) const;
321     void reinitializeAppBoundDomains();
322     static void setAppBoundDomainsForTesting(HashSet<WebCore::RegistrableDomain>&&, CompletionHandler<void()>&&);
323 #endif
324     void updateBundleIdentifierInNetworkProcess(const String&, CompletionHandler<void()>&&);
325     void clearBundleIdentifierInNetworkProcess(CompletionHandler<void()>&&);
326     
327 private:
328     enum class ForceReinitialization : bool { No, Yes };
329 #if ENABLE(APP_BOUND_DOMAINS)
330     void initializeAppBoundDomains(ForceReinitialization = ForceReinitialization::No);
331     void addTestDomains() const;
332 #endif
333
334     void fetchDataAndApply(OptionSet<WebsiteDataType>, OptionSet<WebsiteDataFetchOption>, RefPtr<WorkQueue>&&, Function<void(Vector<WebsiteDataRecord>)>&& apply);
335
336     void platformInitialize();
337     void platformDestroy();
338     static void platformRemoveRecentSearches(WallTime);
339
340     void platformSetNetworkParameters(WebsiteDataStoreParameters&);
341
342     WebsiteDataStore();
343
344     enum class ShouldCreateDirectory { No, Yes };
345     static WTF::String tempDirectoryFileSystemRepresentation(const WTF::String& directoryName, ShouldCreateDirectory = ShouldCreateDirectory::Yes);
346     static WTF::String cacheDirectoryFileSystemRepresentation(const WTF::String& directoryName, ShouldCreateDirectory = ShouldCreateDirectory::Yes);
347     static WTF::String websiteDataDirectoryFileSystemRepresentation(const WTF::String& directoryName);
348
349     HashSet<RefPtr<WebProcessPool>> processPools(size_t limit = std::numeric_limits<size_t>::max()) const;
350
351     // Will create a temporary process pool is none exists yet.
352     HashSet<RefPtr<WebProcessPool>> ensureProcessPools() const;
353
354 #if ENABLE(NETSCAPE_PLUGIN_API)
355     Vector<PluginModuleInfo> plugins() const;
356 #endif
357
358     static Vector<WebCore::SecurityOriginData> mediaKeyOrigins(const String& mediaKeysStorageDirectory);
359     static void removeMediaKeys(const String& mediaKeysStorageDirectory, WallTime modifiedSince);
360     static void removeMediaKeys(const String& mediaKeysStorageDirectory, const HashSet<WebCore::SecurityOriginData>&);
361
362     void maybeRegisterWithSessionIDMap();
363
364 #if ENABLE(APP_BOUND_DOMAINS)
365     static Optional<HashSet<WebCore::RegistrableDomain>> appBoundDomainsIfInitialized();
366     constexpr static const std::atomic<bool> isAppBoundITPRelaxationEnabled = false;
367     static void forwardAppBoundDomainsToITPIfInitialized(CompletionHandler<void()>&&);
368     void setAppBoundDomainsForITP(const HashSet<WebCore::RegistrableDomain>&, CompletionHandler<void()>&&);
369 #endif
370
371     const PAL::SessionID m_sessionID;
372
373     Ref<WebsiteDataStoreConfiguration> m_resolvedConfiguration;
374     Ref<const WebsiteDataStoreConfiguration> m_configuration;
375     bool m_hasResolvedDirectories { false };
376
377     const Ref<DeviceIdHashSaltStorage> m_deviceIdHashSaltStorage;
378
379 #if ENABLE(RESOURCE_LOAD_STATISTICS)
380     bool m_resourceLoadStatisticsDebugMode { false };
381     bool m_resourceLoadStatisticsEnabled { false };
382     WTF::Function<void(const String&)> m_statisticsTestingCallback;
383 #endif
384
385     Ref<WorkQueue> m_queue;
386
387 #if PLATFORM(COCOA)
388     Vector<uint8_t> m_uiProcessCookieStorageIdentifier;
389     RetainPtr<CFHTTPCookieStorageRef> m_cfCookieStorage;
390 #endif
391
392 #if USE(CURL)
393     WebCore::CurlProxySettings m_proxySettings;
394 #endif
395
396 #if USE(SOUP)
397     bool m_persistentCredentialStorageEnabled { true };
398 #endif
399
400     HashSet<WebCore::Cookie> m_pendingCookies;
401     
402     WeakHashSet<WebProcessProxy> m_processes;
403
404     bool m_isItpStateExplicitlySet { false };
405     bool m_isInAppBrowserPrivacyTestModeEnabled { false };
406
407 #if HAVE(SEC_KEY_PROXY)
408     Vector<Ref<SecKeyProxyStore>> m_secKeyProxyStores;
409 #endif
410
411 #if ENABLE(WEB_AUTHN)
412     UniqueRef<AuthenticatorManager> m_authenticatorManager;
413 #endif
414
415 #if ENABLE(DEVICE_ORIENTATION)
416     WebDeviceOrientationAndMotionAccessController m_deviceOrientationAndMotionAccessController;
417 #endif
418
419     UniqueRef<WebsiteDataStoreClient> m_client;
420
421     RefPtr<API::HTTPCookieStore> m_cookieStore;
422
423 #if HAVE(APP_SSO)
424     UniqueRef<SOAuthorizationCoordinator> m_soAuthorizationCoordinator;
425 #endif
426 #if ENABLE(RESOURCE_LOAD_STATISTICS)
427     mutable Optional<WebCore::ThirdPartyCookieBlockingMode> m_thirdPartyCookieBlockingMode; // Lazily computed.
428 #endif
429 };
430
431 }