2015-11-03 Geoffrey Garen <ggaren@apple.com>
[WebKit-https.git] / Source / WebKit2 / Shared / WebProcessCreationParameters.h
1 /*
2  * Copyright (C) 2010, 2011, 2012 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 #ifndef WebProcessCreationParameters_h
27 #define WebProcessCreationParameters_h
28
29 #include "CacheModel.h"
30 #include "SandboxExtension.h"
31 #include "TextCheckerState.h"
32 #include "UserData.h"
33 #include <WebCore/SessionID.h>
34 #include <wtf/RetainPtr.h>
35 #include <wtf/Vector.h>
36 #include <wtf/text/StringHash.h>
37 #include <wtf/text/WTFString.h>
38
39 #if PLATFORM(COCOA)
40 #include "MachPort.h"
41 #include <WebCore/MachSendRight.h>
42 #endif
43
44 #if USE(SOUP)
45 #include "HTTPCookieAcceptPolicy.h"
46 #endif
47
48 namespace API {
49 class Data;
50 }
51
52 namespace IPC {
53 class ArgumentDecoder;
54 class ArgumentEncoder;
55 }
56
57 namespace WebKit {
58
59 struct WebProcessCreationParameters {
60     WebProcessCreationParameters();
61     ~WebProcessCreationParameters();
62
63     void encode(IPC::ArgumentEncoder&) const;
64     static bool decode(IPC::ArgumentDecoder&, WebProcessCreationParameters&);
65
66     String injectedBundlePath;
67     SandboxExtension::Handle injectedBundlePathExtensionHandle;
68
69     UserData initializationUserData;
70
71     String applicationCacheDirectory;    
72     SandboxExtension::Handle applicationCacheDirectoryExtensionHandle;
73     String webSQLDatabaseDirectory;
74     SandboxExtension::Handle webSQLDatabaseDirectoryExtensionHandle;
75 #if ENABLE(SECCOMP_FILTERS)
76     String cookieStorageDirectory;
77 #endif
78 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
79     Vector<uint8_t> uiProcessCookieStorageIdentifier;
80 #endif
81 #if PLATFORM(IOS)
82     SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
83     SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
84     SandboxExtension::Handle containerTemporaryDirectoryExtensionHandle;
85 #endif
86     SandboxExtension::Handle mediaKeyStorageDirectoryExtensionHandle;
87     String mediaKeyStorageDirectory;
88
89     bool shouldUseTestingNetworkSession;
90
91     Vector<String> urlSchemesRegisteredAsEmptyDocument;
92     Vector<String> urlSchemesRegisteredAsSecure;
93     Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy;
94     Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
95     Vector<String> urlSchemesRegisteredAsLocal;
96     Vector<String> urlSchemesRegisteredAsNoAccess;
97     Vector<String> urlSchemesRegisteredAsDisplayIsolated;
98     Vector<String> urlSchemesRegisteredAsCORSEnabled;
99 #if ENABLE(CACHE_PARTITIONING)
100     Vector<String> urlSchemesRegisteredAsCachePartitioned;
101 #endif
102     Vector<String> urlSchemesRegisteredForCustomProtocols;
103 #if USE(SOUP)
104     String diskCacheDirectory;
105     String cookiePersistentStoragePath;
106     uint32_t cookiePersistentStorageType;
107     HTTPCookieAcceptPolicy cookieAcceptPolicy;
108     bool ignoreTLSErrors;
109 #endif
110
111     CacheModel cacheModel;
112
113     bool shouldAlwaysUseComplexTextCodePath;
114     bool shouldEnableMemoryPressureReliefLogging;
115     bool shouldUseFontSmoothing;
116
117     Vector<String> fontWhitelist;
118
119     bool iconDatabaseEnabled;
120     bool shouldRewriteConstAsVar { false };
121
122     double terminationTimeout;
123
124     Vector<String> languages;
125
126     TextCheckerState textCheckerState;
127
128     bool fullKeyboardAccessEnabled;
129
130     double defaultRequestTimeoutInterval;
131
132 #if PLATFORM(COCOA) || USE(CFNETWORK)
133     String uiProcessBundleIdentifier;
134 #endif
135
136 #if PLATFORM(COCOA)
137     pid_t presenterApplicationPid;
138
139     bool accessibilityEnhancedUserInterfaceEnabled;
140
141     WebCore::MachSendRight acceleratedCompositingPort;
142
143     String uiProcessBundleResourcePath;
144     SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
145
146     bool shouldEnableJIT;
147     bool shouldEnableFTLJIT;
148     
149     RefPtr<API::Data> bundleParameterData;
150
151 #endif // PLATFORM(COCOA)
152
153 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
154     HashMap<String, bool> notificationPermissions;
155 #endif
156
157 #if ENABLE(NETWORK_PROCESS)
158     bool usesNetworkProcess;
159 #endif
160
161     HashMap<WebCore::SessionID, HashMap<unsigned, double>> plugInAutoStartOriginHashes;
162     Vector<String> plugInAutoStartOrigins;
163
164     bool memoryCacheDisabled;
165
166 #if ENABLE(SERVICE_CONTROLS)
167     bool hasImageServices;
168     bool hasSelectionServices;
169     bool hasRichContentServices;
170 #endif
171
172 #if ENABLE(NETSCAPE_PLUGIN_API)
173     HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPolicies;
174 #endif
175
176 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
177     RetainPtr<CFDataRef> networkATSContext;
178 #endif
179 };
180
181 } // namespace WebKit
182
183 #endif // WebProcessCreationParameters_h