9167a3fdc821a4f92119d8e8a3b7ae90145f71be
[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
121     double terminationTimeout;
122
123     Vector<String> languages;
124
125     TextCheckerState textCheckerState;
126
127     bool fullKeyboardAccessEnabled;
128
129     double defaultRequestTimeoutInterval;
130
131 #if PLATFORM(COCOA) || USE(CFNETWORK)
132     String uiProcessBundleIdentifier;
133 #endif
134
135 #if PLATFORM(COCOA)
136     pid_t presenterApplicationPid;
137
138     bool accessibilityEnhancedUserInterfaceEnabled;
139
140     WebCore::MachSendRight acceleratedCompositingPort;
141
142     String uiProcessBundleResourcePath;
143     SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
144
145     bool shouldEnableJIT;
146     bool shouldEnableFTLJIT;
147     
148     RefPtr<API::Data> bundleParameterData;
149
150 #endif // PLATFORM(COCOA)
151
152 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
153     HashMap<String, bool> notificationPermissions;
154 #endif
155
156 #if ENABLE(NETWORK_PROCESS)
157     bool usesNetworkProcess;
158 #endif
159
160     HashMap<WebCore::SessionID, HashMap<unsigned, double>> plugInAutoStartOriginHashes;
161     Vector<String> plugInAutoStartOrigins;
162
163     bool memoryCacheDisabled;
164
165 #if ENABLE(SERVICE_CONTROLS)
166     bool hasImageServices;
167     bool hasSelectionServices;
168     bool hasRichContentServices;
169 #endif
170
171 #if ENABLE(NETSCAPE_PLUGIN_API)
172     HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPolicies;
173 #endif
174
175 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
176     RetainPtr<CFDataRef> networkATSContext;
177 #endif
178 };
179
180 } // namespace WebKit
181
182 #endif // WebProcessCreationParameters_h