Source/WebKit:
[WebKit-https.git] / Source / WebKit / Shared / WebProcessCreationParameters.h
1 /*
2  * Copyright (C) 2010-2018 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 "TextCheckerState.h"
31 #include "UserData.h"
32 #include <pal/SessionID.h>
33 #include <wtf/HashMap.h>
34 #include <wtf/ProcessID.h>
35 #include <wtf/RetainPtr.h>
36 #include <wtf/Vector.h>
37 #include <wtf/text/StringHash.h>
38 #include <wtf/text/WTFString.h>
39
40 #if PLATFORM(COCOA)
41 #include <wtf/MachSendRight.h>
42 #endif
43
44 #if USE(SOUP)
45 #include "HTTPCookieAcceptPolicy.h"
46 #include <WebCore/SoupNetworkProxySettings.h>
47 #endif
48
49 namespace API {
50 class Data;
51 }
52
53 namespace IPC {
54 class Decoder;
55 class Encoder;
56 }
57
58 namespace WebKit {
59
60 struct WebProcessCreationParameters {
61     WebProcessCreationParameters();
62     ~WebProcessCreationParameters();
63
64     void encode(IPC::Encoder&) const;
65     static bool decode(IPC::Decoder&, WebProcessCreationParameters&);
66
67     String injectedBundlePath;
68     SandboxExtension::Handle injectedBundlePathExtensionHandle;
69     SandboxExtension::HandleArray additionalSandboxExtensionHandles;
70
71     UserData initializationUserData;
72
73     String applicationCacheDirectory;
74     String applicationCacheFlatFileSubdirectoryName;
75     SandboxExtension::Handle applicationCacheDirectoryExtensionHandle;
76     String webSQLDatabaseDirectory;
77     SandboxExtension::Handle webSQLDatabaseDirectoryExtensionHandle;
78     String mediaCacheDirectory;
79     SandboxExtension::Handle mediaCacheDirectoryExtensionHandle;
80     String javaScriptConfigurationDirectory;
81     SandboxExtension::Handle javaScriptConfigurationDirectoryExtensionHandle;
82 #if PLATFORM(COCOA)
83     Vector<uint8_t> uiProcessCookieStorageIdentifier;
84 #endif
85 #if PLATFORM(IOS)
86     SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
87     SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
88     SandboxExtension::Handle containerTemporaryDirectoryExtensionHandle;
89 #endif
90     SandboxExtension::Handle mediaKeyStorageDirectoryExtensionHandle;
91 #if ENABLE(MEDIA_STREAM)
92     SandboxExtension::Handle audioCaptureExtensionHandle;
93     bool shouldCaptureAudioInUIProcess { false };
94 #endif
95     String mediaKeyStorageDirectory;
96
97     String webCoreLoggingChannels;
98     String webKitLoggingChannels;
99
100     Vector<String> urlSchemesRegisteredAsEmptyDocument;
101     Vector<String> urlSchemesRegisteredAsSecure;
102     Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy;
103     Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
104     Vector<String> urlSchemesRegisteredAsLocal;
105     Vector<String> urlSchemesRegisteredAsNoAccess;
106     Vector<String> urlSchemesRegisteredAsDisplayIsolated;
107     Vector<String> urlSchemesRegisteredAsCORSEnabled;
108     Vector<String> urlSchemesRegisteredAsAlwaysRevalidated;
109     Vector<String> urlSchemesRegisteredAsCachePartitioned;
110     Vector<String> urlSchemesServiceWorkersCanHandle;
111     Vector<String> urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest;
112
113     Vector<String> fontWhitelist;
114     Vector<String> languages;
115 #if USE(GSTREAMER)
116     Vector<String> gstreamerOptions;
117 #endif
118
119     CacheModel cacheModel;
120
121     double defaultRequestTimeoutInterval { INT_MAX };
122
123     bool shouldUseTestingNetworkSession { false };
124     bool shouldAlwaysUseComplexTextCodePath { false };
125     bool shouldEnableMemoryPressureReliefLogging { false };
126     bool shouldSuppressMemoryPressureHandler { false };
127     bool shouldUseFontSmoothing { true };
128     bool resourceLoadStatisticsEnabled { false };
129     bool fullKeyboardAccessEnabled { false };
130     bool memoryCacheDisabled { false };
131
132 #if ENABLE(SERVICE_CONTROLS)
133     bool hasImageServices { false };
134     bool hasSelectionServices { false };
135     bool hasRichContentServices { false };
136 #endif
137
138     Seconds terminationTimeout;
139
140     TextCheckerState textCheckerState;
141
142 #if PLATFORM(COCOA)
143     String uiProcessBundleIdentifier;
144 #endif
145
146     ProcessID presentingApplicationPID { 0 };
147
148 #if PLATFORM(COCOA)
149     WTF::MachSendRight acceleratedCompositingPort;
150
151     String uiProcessBundleResourcePath;
152     SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
153
154     bool shouldEnableJIT { false };
155     bool shouldEnableFTLJIT { false };
156     bool accessibilityEnhancedUserInterfaceEnabled { false };
157     
158     RefPtr<API::Data> bundleParameterData;
159 #endif // PLATFORM(COCOA)
160
161 #if ENABLE(NOTIFICATIONS)
162     HashMap<String, bool> notificationPermissions;
163 #endif
164
165     HashMap<PAL::SessionID, HashMap<unsigned, WallTime>> plugInAutoStartOriginHashes;
166     Vector<String> plugInAutoStartOrigins;
167
168 #if ENABLE(NETSCAPE_PLUGIN_API)
169     HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPolicies;
170 #endif
171
172 #if PLATFORM(COCOA)
173     RetainPtr<CFDataRef> networkATSContext;
174 #endif
175
176 #if OS(LINUX)
177     IPC::Attachment memoryPressureMonitorHandle;
178 #endif
179
180 #if PLATFORM(WAYLAND)
181     String waylandCompositorDisplayName;
182 #endif
183
184 #if USE(SOUP)
185     WebCore::SoupNetworkProxySettings proxySettings;
186 #endif
187
188 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED
189     bool shouldLogUserInteraction { false };
190 #endif
191 };
192
193 } // namespace WebKit