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