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