1/*
2 * Copyright (C) 2012-2017 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 "CacheModel.h"
29#include "SandboxExtension.h"
30#include "WebsiteDataStoreParameters.h"
31#include <WebCore/Cookie.h>
32#include <wtf/ProcessID.h>
33#include <wtf/Vector.h>
34#include <wtf/text/WTFString.h>
35
36#if USE(SOUP)
37#include "HTTPCookieAcceptPolicy.h"
38#include <WebCore/SoupNetworkProxySettings.h>
39#endif
40
41namespace IPC {
42class Decoder;
43class Encoder;
44}
45
46namespace WebKit {
47
48struct NetworkProcessCreationParameters {
49 NetworkProcessCreationParameters();
50
51 void encode(IPC::Encoder&) const;
52 static bool decode(IPC::Decoder&, NetworkProcessCreationParameters&);
53
54 CacheModel cacheModel { CacheModel::DocumentViewer };
55 bool canHandleHTTPSServerTrustEvaluation { true };
56
57 String diskCacheDirectory;
58 SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
59#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
60 bool shouldEnableNetworkCacheSpeculativeRevalidation { false };
61#endif
62#if PLATFORM(MAC)
63 Vector<uint8_t> uiProcessCookieStorageIdentifier;
64#endif
65#if PLATFORM(IOS_FAMILY)
66 SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
67 SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
68 SandboxExtension::Handle parentBundleDirectoryExtensionHandle;
69#endif
70 bool shouldSuppressMemoryPressureHandler { false };
71 bool shouldUseTestingNetworkSession { false };
72
73 Vector<String> urlSchemesRegisteredForCustomProtocols;
74
75#if PLATFORM(COCOA)
76 String uiProcessBundleIdentifier;
77 uint32_t uiProcessSDKVersion { 0 };
78#if PLATFORM(IOS_FAMILY)
79 String ctDataConnectionServiceType;
80#endif
81 RetainPtr<CFDataRef> networkATSContext;
82 bool storageAccessAPIEnabled;
83 bool suppressesConnectionTerminationOnSystemChange;
84#endif
85
86 WebsiteDataStoreParameters defaultDataStoreParameters;
87
88#if USE(SOUP)
89 HTTPCookieAcceptPolicy cookieAcceptPolicy { HTTPCookieAcceptPolicyAlways };
90 bool ignoreTLSErrors { false };
91 Vector<String> languages;
92 WebCore::SoupNetworkProxySettings proxySettings;
93#endif
94
95 Vector<String> urlSchemesRegisteredAsSecure;
96 Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy;
97 Vector<String> urlSchemesRegisteredAsLocal;
98 Vector<String> urlSchemesRegisteredAsNoAccess;
99 Vector<String> urlSchemesRegisteredAsDisplayIsolated;
100 Vector<String> urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
101 Vector<String> urlSchemesRegisteredAsCORSEnabled;
102
103#if ENABLE(SERVICE_WORKER)
104 String serviceWorkerRegistrationDirectory;
105 SandboxExtension::Handle serviceWorkerRegistrationDirectoryExtensionHandle;
106 Vector<String> urlSchemesServiceWorkersCanHandle;
107 bool shouldDisableServiceWorkerProcessTerminationDelay { false };
108#endif
109 bool shouldEnableITPDatabase { false };
110 bool isITPFirstPartyWebsiteDataRemovalEnabled { true };
111 uint32_t downloadMonitorSpeedMultiplier { 1 };
112 bool enableAdClickAttributionDebugMode { false };
113 String hstsStorageDirectory;
114 SandboxExtension::Handle hstsStorageDirectoryExtensionHandle;
115};
116
117} // namespace WebKit
118