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 <wtf/RetainPtr.h>
33#include <wtf/Vector.h>
34#include <wtf/text/StringHash.h>
35#include <wtf/text/WTFString.h>
36
37#if PLATFORM(MAC)
38#include "MachPort.h"
39#endif
40
41#if USE(SOUP)
42#include "HTTPCookieAcceptPolicy.h"
43#endif
44
45namespace CoreIPC {
46    class ArgumentDecoder;
47    class ArgumentEncoder;
48}
49
50namespace WebKit {
51
52struct WebProcessCreationParameters {
53    WebProcessCreationParameters();
54
55    void encode(CoreIPC::ArgumentEncoder&) const;
56    static bool decode(CoreIPC::ArgumentDecoder&, WebProcessCreationParameters&);
57
58    String injectedBundlePath;
59    SandboxExtension::Handle injectedBundlePathExtensionHandle;
60
61    String applicationCacheDirectory;
62    SandboxExtension::Handle applicationCacheDirectoryExtensionHandle;
63    String databaseDirectory;
64    SandboxExtension::Handle databaseDirectoryExtensionHandle;
65    String localStorageDirectory;
66    SandboxExtension::Handle localStorageDirectoryExtensionHandle;
67    String diskCacheDirectory;
68    SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
69    String cookieStorageDirectory;
70    SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
71
72    Vector<String> urlSchemesRegistererdAsEmptyDocument;
73    Vector<String> urlSchemesRegisteredAsSecure;
74    Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
75    Vector<String> urlSchemesRegisteredAsLocal;
76    Vector<String> urlSchemesRegisteredAsNoAccess;
77    Vector<String> urlSchemesRegisteredAsDisplayIsolated;
78    Vector<String> urlSchemesRegisteredAsCORSEnabled;
79#if ENABLE(CUSTOM_PROTOCOLS)
80    Vector<String> urlSchemesRegisteredForCustomProtocols;
81#endif
82#if USE(SOUP)
83    Vector<String> urlSchemesRegistered;
84    String cookiePersistentStoragePath;
85    uint32_t cookiePersistentStorageType;
86    HTTPCookieAcceptPolicy cookieAcceptPolicy;
87    bool ignoreTLSErrors;
88#endif
89
90    CacheModel cacheModel;
91    bool shouldTrackVisitedLinks;
92
93    bool shouldAlwaysUseComplexTextCodePath;
94    bool shouldUseFontSmoothing;
95
96    bool iconDatabaseEnabled;
97
98    double terminationTimeout;
99
100    Vector<String> languages;
101
102    TextCheckerState textCheckerState;
103
104    bool fullKeyboardAccessEnabled;
105
106    double defaultRequestTimeoutInterval;
107
108#if PLATFORM(MAC) || USE(CFNETWORK)
109    String uiProcessBundleIdentifier;
110#endif
111
112#if PLATFORM(MAC)
113    pid_t presenterApplicationPid;
114
115    bool accessibilityEnhancedUserInterfaceEnabled;
116
117    uint64_t nsURLCacheMemoryCapacity;
118    uint64_t nsURLCacheDiskCapacity;
119
120    CoreIPC::MachPort acceleratedCompositingPort;
121
122    String uiProcessBundleResourcePath;
123    SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
124
125    bool shouldForceScreenFontSubstitution;
126    bool shouldEnableKerningAndLigaturesByDefault;
127#endif // PLATFORM(MAC)
128
129#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
130    HashMap<String, bool> notificationPermissions;
131#endif
132
133#if ENABLE(NETWORK_PROCESS)
134    bool usesNetworkProcess;
135#endif
136
137    HashMap<unsigned, double> plugInAutoStartOriginHashes;
138    Vector<String> plugInAutoStartOrigins;
139
140    bool memoryCacheDisabled;
141};
142
143} // namespace WebKit
144
145#endif // WebProcessCreationParameters_h
146