Remove support for legacy Notifications
[WebKit-https.git] / Source / WebKit2 / 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 <WebCore/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) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
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     Vector<String> urlSchemesRegisteredAsEmptyDocument;
97     Vector<String> urlSchemesRegisteredAsSecure;
98     Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy;
99     Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
100     Vector<String> urlSchemesRegisteredAsLocal;
101     Vector<String> urlSchemesRegisteredAsNoAccess;
102     Vector<String> urlSchemesRegisteredAsDisplayIsolated;
103     Vector<String> urlSchemesRegisteredAsCORSEnabled;
104     Vector<String> urlSchemesRegisteredAsAlwaysRevalidated;
105     Vector<String> urlSchemesRegisteredAsCachePartitioned;
106
107     Vector<String> fontWhitelist;
108     Vector<String> languages;
109
110     CacheModel cacheModel;
111
112     double defaultRequestTimeoutInterval { INT_MAX };
113
114     bool shouldUseTestingNetworkSession { false };
115     bool shouldAlwaysUseComplexTextCodePath { false };
116     bool shouldEnableMemoryPressureReliefLogging { false };
117     bool shouldSuppressMemoryPressureHandler { false };
118     bool shouldUseFontSmoothing { true };
119     bool resourceLoadStatisticsEnabled { false };
120     bool iconDatabaseEnabled { false };
121     bool fullKeyboardAccessEnabled { false };
122     bool memoryCacheDisabled { false };
123
124 #if ENABLE(SERVICE_CONTROLS)
125     bool hasImageServices { false };
126     bool hasSelectionServices { false };
127     bool hasRichContentServices { false };
128 #endif
129
130     Seconds terminationTimeout;
131
132     TextCheckerState textCheckerState;
133
134 #if PLATFORM(COCOA) || USE(CFURLCONNECTION)
135     String uiProcessBundleIdentifier;
136 #endif
137
138 #if PLATFORM(COCOA)
139     pid_t presenterApplicationPid { 0 };
140
141     WebCore::MachSendRight acceleratedCompositingPort;
142
143     String uiProcessBundleResourcePath;
144     SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
145
146     bool shouldEnableJIT { false };
147     bool shouldEnableFTLJIT { false };
148     bool accessibilityEnhancedUserInterfaceEnabled { false };
149     
150     RefPtr<API::Data> bundleParameterData;
151 #endif // PLATFORM(COCOA)
152
153 #if ENABLE(NOTIFICATIONS)
154     HashMap<String, bool> notificationPermissions;
155 #endif
156
157     HashMap<WebCore::SessionID, HashMap<unsigned, double>> plugInAutoStartOriginHashes;
158     Vector<String> plugInAutoStartOrigins;
159
160 #if ENABLE(NETSCAPE_PLUGIN_API)
161     HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPolicies;
162 #endif
163
164 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
165     RetainPtr<CFDataRef> networkATSContext;
166 #endif
167
168 #if OS(LINUX)
169     IPC::Attachment memoryPressureMonitorHandle;
170 #endif
171
172 #if PLATFORM(WAYLAND)
173     String waylandCompositorDisplayName;
174 #endif
175
176 #if USE(SOUP)
177     WebCore::SoupNetworkProxySettings proxySettings;
178 #endif
179 };
180
181 } // namespace WebKit